Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1394)

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 22867009: Swap main menu with app-specific menu when app window focused. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gypi Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/app_controller_mac.h ('k') | chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index d25953b6e6310b047e27ec4e3154c470ac9a4ecd..34147c631f762cd7464502ce67f7c09f8574081e 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -53,6 +53,7 @@
#include "chrome/browser/ui/browser_mac.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
+#import "chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
#import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
@@ -435,6 +436,8 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
localPrefRegistrar_.RemoveAll();
[self unregisterEventHandlers];
+
+ appShimMenuController_.reset();
}
- (void)didEndMainMessageLoop {
@@ -653,6 +656,11 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
[self setUpdateCheckInterval];
+ // Start managing the menu for app windows. This needs to be done here because
+ // main menu item titles are not yet initialized in awakeFromNib.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppShims))
+ appShimMenuController_.reset([[AppShimMenuController alloc] init]);
+
// Build up the encoding menu, the order of the items differs based on the
// current locale (see http://crbug.com/7647 for details).
// We need a valid g_browser_process to get the profile which is why we can't
« no previous file with comments | « chrome/browser/app_controller_mac.h ('k') | chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698