OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <numeric> | 10 #include <numeric> |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1016 case IDC_FULLSCREEN: { | 1016 case IDC_FULLSCREEN: { |
1017 enable &= [self supportsFullscreen]; | 1017 enable &= [self supportsFullscreen]; |
1018 if ([static_cast<NSObject*>(item) isKindOfClass:[NSMenuItem class]]) { | 1018 if ([static_cast<NSObject*>(item) isKindOfClass:[NSMenuItem class]]) { |
1019 NSString* menuTitle = l10n_util::GetNSString( | 1019 NSString* menuTitle = l10n_util::GetNSString( |
1020 [self isFullscreen] ? IDS_EXIT_FULLSCREEN_MAC : | 1020 [self isFullscreen] ? IDS_EXIT_FULLSCREEN_MAC : |
1021 IDS_ENTER_FULLSCREEN_MAC); | 1021 IDS_ENTER_FULLSCREEN_MAC); |
1022 [static_cast<NSMenuItem*>(item) setTitle:menuTitle]; | 1022 [static_cast<NSMenuItem*>(item) setTitle:menuTitle]; |
1023 } | 1023 } |
1024 break; | 1024 break; |
1025 } | 1025 } |
1026 case IDC_SYNC_BOOKMARKS: | 1026 case IDC_SYNC_BOOKMARKS: { |
1027 enable &= browser_->profile()->IsSyncAccessible(); | 1027 Profile* original_profile = |
1028 sync_ui_util::UpdateSyncItem(item, enable, browser_->profile()); | 1028 browser_->profile()->GetOriginalProfile(); |
1029 enable &= original_profile->IsSyncAccessible(); | |
1030 sync_ui_util::UpdateSyncItem(item, enable, original_profile); | |
Scott Hess - ex-Googler
2011/08/04 22:28:20
The only other place UpdateSyncItem() is called fr
| |
1029 break; | 1031 break; |
1032 } | |
1030 default: | 1033 default: |
1031 // Special handling for the contents of the Text Encoding submenu. On | 1034 // Special handling for the contents of the Text Encoding submenu. On |
1032 // Mac OS, instead of enabling/disabling the top-level menu item, we | 1035 // Mac OS, instead of enabling/disabling the top-level menu item, we |
1033 // enable/disable the submenu's contents (per Apple's HIG). | 1036 // enable/disable the submenu's contents (per Apple's HIG). |
1034 EncodingMenuController encoding_controller; | 1037 EncodingMenuController encoding_controller; |
1035 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { | 1038 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { |
1036 enable &= browser_->command_updater()->IsCommandEnabled( | 1039 enable &= browser_->command_updater()->IsCommandEnabled( |
1037 IDC_ENCODING_MENU) ? YES : NO; | 1040 IDC_ENCODING_MENU) ? YES : NO; |
1038 } | 1041 } |
1039 } | 1042 } |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2319 | 2322 |
2320 - (BOOL)supportsBookmarkBar { | 2323 - (BOOL)supportsBookmarkBar { |
2321 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2324 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2322 } | 2325 } |
2323 | 2326 |
2324 - (BOOL)isTabbedWindow { | 2327 - (BOOL)isTabbedWindow { |
2325 return browser_->is_type_tabbed(); | 2328 return browser_->is_type_tabbed(); |
2326 } | 2329 } |
2327 | 2330 |
2328 @end // @implementation BrowserWindowController(WindowType) | 2331 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |