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

Side by Side Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 2905003: Implement support for disabling sync through configuration management. (Closed)
Patch Set: Fix PrefsControllerTest on MAC. Created 10 years, 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/cocoa/preferences_window_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/cocoa/browser_window_controller.h" 5 #import "chrome/browser/cocoa/browser_window_controller.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 8
9 #include "app/l10n_util_mac.h" 9 #include "app/l10n_util_mac.h"
10 #include "base/mac_util.h" 10 #include "base/mac_util.h"
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 enable &= [self supportsFullscreen]; 871 enable &= [self supportsFullscreen];
872 if ([static_cast<NSObject*>(item) isKindOfClass:[NSMenuItem class]]) { 872 if ([static_cast<NSObject*>(item) isKindOfClass:[NSMenuItem class]]) {
873 NSString* menuTitle = l10n_util::GetNSString( 873 NSString* menuTitle = l10n_util::GetNSString(
874 [self isFullscreen] ? IDS_EXIT_FULLSCREEN_MAC : 874 [self isFullscreen] ? IDS_EXIT_FULLSCREEN_MAC :
875 IDS_ENTER_FULLSCREEN_MAC); 875 IDS_ENTER_FULLSCREEN_MAC);
876 [static_cast<NSMenuItem*>(item) setTitle:menuTitle]; 876 [static_cast<NSMenuItem*>(item) setTitle:menuTitle];
877 } 877 }
878 break; 878 break;
879 } 879 }
880 case IDC_SYNC_BOOKMARKS: 880 case IDC_SYNC_BOOKMARKS:
881 enable &= ProfileSyncService::IsSyncEnabled(); 881 enable &= browser_->profile()->IsSyncAccessible();
882 sync_ui_util::UpdateSyncItem(item, enable, browser_->profile()); 882 sync_ui_util::UpdateSyncItem(item, enable, browser_->profile());
883 break; 883 break;
884 default: 884 default:
885 // Special handling for the contents of the Text Encoding submenu. On 885 // Special handling for the contents of the Text Encoding submenu. On
886 // Mac OS, instead of enabling/disabling the top-level menu item, we 886 // Mac OS, instead of enabling/disabling the top-level menu item, we
887 // enable/disable the submenu's contents (per Apple's HIG). 887 // enable/disable the submenu's contents (per Apple's HIG).
888 EncodingMenuController encoding_controller; 888 EncodingMenuController encoding_controller;
889 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) { 889 if (encoding_controller.DoesCommandBelongToEncodingMenu(tag)) {
890 enable &= browser_->command_updater()->IsCommandEnabled( 890 enable &= browser_->command_updater()->IsCommandEnabled(
891 IDC_ENCODING_MENU) ? YES : NO; 891 IDC_ENCODING_MENU) ? YES : NO;
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 1872
1873 - (BOOL)supportsBookmarkBar { 1873 - (BOOL)supportsBookmarkBar {
1874 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 1874 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
1875 } 1875 }
1876 1876
1877 - (BOOL)isNormalWindow { 1877 - (BOOL)isNormalWindow {
1878 return browser_->type() == Browser::TYPE_NORMAL; 1878 return browser_->type() == Browser::TYPE_NORMAL;
1879 } 1879 }
1880 1880
1881 @end // @implementation BrowserWindowController(WindowType) 1881 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/cocoa/preferences_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698