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

Unified Diff: chrome/browser/ui/cocoa/apps/app_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: Address comment 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
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..3345f824eeca30c492724083f8ad1c62d11ca560
--- /dev/null
+++ b/chrome/browser/ui/cocoa/apps/app_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_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 {
Robert Sesek 2013/08/22 16:22:45 This may be better named "AppShimMenuController" s
jackhou1 2013/08/23 02:36:41 Done.
+ @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_MENU_CONTROLLER_MAC_H_

Powered by Google App Engine
This is Rietveld 408576698