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

Unified Diff: chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h

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.mm ('k') | chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h
diff --git a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..111b9dedeff1286a1ac0178782fcdf376badc7e3
--- /dev/null
+++ b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h
@@ -0,0 +1,28 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_COCOA_APPS_APP_SHIM_MENU_CONTROLLER_MAC_H_
+#define CHROME_BROWSER_UI_COCOA_APPS_APP_SHIM_MENU_CONTROLLER_MAC_H_
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/mac/scoped_nsobject.h"
+
+// This controller listens to NSWindowDidBecomeMainNotification and
+// NSWindowDidResignMainNotification and modifies the main menu bar to mimic a
+// main menu for the app. When an app window becomes main, all Chrome menu items
+// are hidden and menu items for the app are appended to the main menu. When the
+// app window resigns main, its menu items are removed and all Chrome menu items
+// are unhidden.
+@interface AppShimMenuController : NSObject {
+ @private
+ // The extension id of the currently focused packaged app.
+ base::scoped_nsobject<NSString> appId_;
+ // A menu item for the currently focused packaged app.
+ base::scoped_nsobject<NSMenuItem> appMenuItem_;
+}
+
+@end
+
+#endif // CHROME_BROWSER_UI_COCOA_APPS_APP_SHIM_MENU_CONTROLLER_MAC_H_
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698