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 |