File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 27
27
#include " content/nw/src/shell_browser_context.h"
28
28
#include " content/nw/src/shell_browser_main_parts.h"
29
29
#include " content/nw/src/shell_content_browser_client.h"
30
+ #include " base/values.h"
30
31
31
32
@implementation AppController
32
33
@@ -59,13 +60,17 @@ - (void) applicationDidFinishLaunching: (NSNotification *) note {
59
60
browser_client->shell_browser_main_parts ()->Init ();
60
61
61
62
// And init menu.
63
+ bool no_edit_menu = false ;
64
+ browser_client->shell_browser_main_parts ()->package ()->root ()->GetBoolean (" no-edit-menu" , &no_edit_menu);
65
+
62
66
[NSApp setMainMenu: [[[NSMenu alloc ] init ] autorelease ]];
63
67
[[NSApp mainMenu ] addItem: [[[NSMenuItem alloc ]
64
68
initWithTitle: @" " action: nil keyEquivalent: @" " ] autorelease ]];
65
69
nw::StandardMenusMac standard_menus (
66
70
browser_client->shell_browser_main_parts ()->package ()->GetName ());
67
71
standard_menus.BuildAppleMenu ();
68
- standard_menus.BuildEditMenu ();
72
+ if (!no_edit_menu)
73
+ standard_menus.BuildEditMenu ();
69
74
standard_menus.BuildWindowMenu ();
70
75
}
71
76
Original file line number Diff line number Diff line change @@ -629,10 +629,14 @@ - (NSRect)contentRectForFrameRect:(NSRect)frameRect {
629
629
}
630
630
631
631
void NativeWindowCocoa::SetMenu (api::Menu* menu) {
632
+ bool no_edit_menu = false ;
633
+ shell_->GetPackage ()->root ()->GetBoolean (" no-edit-menu" , &no_edit_menu);
634
+
632
635
StandardMenusMac standard_menus (shell_->GetPackage ()->GetName ());
633
636
[NSApp setMainMenu: menu->menu_];
634
637
standard_menus.BuildAppleMenu ();
635
- standard_menus.BuildEditMenu ();
638
+ if (!no_edit_menu)
639
+ standard_menus.BuildEditMenu ();
636
640
standard_menus.BuildWindowMenu ();
637
641
}
638
642
You can’t perform that action at this time.
0 commit comments