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

Unified Diff: chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm

Issue 18089012: Swap main menu with app-specific menu when app window focused. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
Index: chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
index 583f7e95dc72ca8526e8fc80f571330c84e4e440..422bc1d67a56be9daf282f51c50120bbf1584fdf 100644
--- a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
@@ -6,6 +6,7 @@
#include "base/mac/mac_util.h"
#include "base/strings/sys_string_conversions.h"
+#include "chrome/browser/app_controller_mac.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_window_utils.h"
#import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
@@ -745,6 +746,9 @@ void NativeAppWindowCocoa::WindowDidBecomeKey() {
web_contents()->GetRenderWidgetHostView();
if (rwhv)
rwhv->SetActive(true);
+ const extensions::Extension* app = shell_window_->extension();
+ [[NSApp delegate] setMenuBarToApp:base::SysUTF8ToNSString(app->id())
+ withTitle:base::SysUTF8ToNSString(app->name())];
shell_window_->OnNativeWindowActivated();
}
« chrome/browser/app_controller_mac.mm ('K') | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698