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

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

Issue 23514021: Add Hide to app menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 3 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/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
index 6346b793e006fade0d57d7ee1a63133a33394ea4..b1cf4891dbf9e7b6d3684d5830a81718154dadce 100644
--- a/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h
+++ b/chrome/browser/ui/cocoa/apps/app_shim_menu_controller_mac.h
@@ -9,6 +9,19 @@
#include "base/mac/scoped_nsobject.h"
+// Used by AppShimMenuController to manage menu items that are a copy of a
+// Chrome menu item but with a different action. This manages unsetting and
+// restoring the original item's key equivalent, so that we can use the same
+// key equivalent in the copied item with a different action.
+@interface DoppelgangerMenuItem : NSObject {
tapted 2013/09/03 08:17:25 I think you can forward declare this, using @clas
jackhou1 2013/09/04 01:31:31 Done.
+ @private
+ base::scoped_nsobject<NSMenuItem> menuItem_;
+ base::scoped_nsobject<NSMenuItem> sourceItem_;
+ int resourceId_;
+}
+
+@end
+
// 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
@@ -19,8 +32,9 @@
@private
// The extension id of the currently focused packaged app.
base::scoped_nsobject<NSString> appId_;
- // A reference to the "Quit Chrome" menu item.
- base::scoped_nsobject<NSMenuItem> chromeMenuQuitItem_;
+ // Items that need a doppelganger.
+ base::scoped_nsobject<DoppelgangerMenuItem> hideDoppelganger_;
+ base::scoped_nsobject<DoppelgangerMenuItem> quitDoppelganger_;
// Menu items for the currently focused packaged app.
base::scoped_nsobject<NSMenuItem> appMenuItem_;
base::scoped_nsobject<NSMenuItem> fileMenuItem_;

Powered by Google App Engine
This is Rietveld 408576698