Index: chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h |
diff --git a/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h b/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8b45dd98ccf235215ab8e85d042fa10184cb3101 |
--- /dev/null |
+++ b/chrome/browser/ui/cocoa/apps/app_menu_controller_mac.h |
@@ -0,0 +1,30 @@ |
+// 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_MENU_CONTROLLER_MAC_H_ |
+#define CHROME_BROWSER_UI_COCOA_APPS_APP_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 AppMenuController : 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_; |
+} |
+ |
+- (void)unregisterEventHandlers; |
Robert Sesek
2013/08/21 14:21:49
nit: please document. Is this unnecessary if you j
jackhou1
2013/08/21 23:54:48
It's called in AppController-applicationWillTermin
tapted
2013/08/22 00:27:02
Hehe - dealing with weird OjbC lifetime issues in
jackhou1
2013/08/22 01:44:02
Done.
|
+ |
+@end |
+ |
+#endif // CHROME_BROWSER_UI_COCOA_APPS_APP_MENU_CONTROLLER_MAC_H_ |