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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 2865763002: [Mac] Move the "Customize Touch Bar" Menu Item (Closed)
Patch Set: Cleaned up Created 3 years, 7 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/app/nibs/MainMenu.xib ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 81118892157f648b9ed4ddb8c7bc7cfe2feefc7f..9f0ace2955ec8bc0bca8980017d5ce5600454b57 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -344,6 +344,18 @@ class AppControllerProfileObserver : public ProfileAttributesStorage::Observer {
// Initialize the Profile menu.
[self initProfileMenu];
+
+ // If the OSX version supports this method, the system will automatically
+ // hide the item if there's no touch bar. However, for unsupported versions,
+ // we'll have to manually remove the item from the menu.
+ if (![NSApp
+ respondsToSelector:@selector(toggleTouchBarCustomizationPalette:)]) {
+ NSMenu* mainMenu = [NSApp mainMenu];
+ NSMenu* viewMenu = [[mainMenu itemWithTag:IDC_VIEW_MENU] submenu];
+ NSMenuItem* customizeItem = [viewMenu itemWithTag:IDC_CUSTOMIZE_TOUCH_BAR];
+ if (customizeItem)
+ [viewMenu removeItem:customizeItem];
+ }
}
- (void)unregisterEventHandlers {
@@ -741,12 +753,6 @@ class AppControllerProfileObserver : public ProfileAttributesStorage::Observer {
handoff_active_url_observer_bridge_.reset(
new HandoffActiveURLObserverBridge(self));
-
- NSApplication* application = [NSApplication sharedApplication];
- if ([application respondsToSelector:
- @selector(setAutomaticCustomizeTouchBarMenuItemEnabled:)]) {
- [application setAutomaticCustomizeTouchBarMenuItemEnabled:YES];
- }
}
// Helper function for populating and displaying the in progress downloads at
« no previous file with comments | « chrome/app/nibs/MainMenu.xib ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698