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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 2435053002: Remove the sign-in menu item on macOS. (Closed)
Patch Set: Rebase Created 4 years, 2 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/browser/app_controller_mac.h ('k') | chrome/browser/app_controller_mac_unittest.mm » ('j') | 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 309fceaf20d509b9f9a9d448ad18bf7653ade2e7..4f248343f7f799dd5ff33036365c7cdfb5f55228 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -291,33 +291,6 @@ class AppControllerProfileObserver : public ProfileAttributesStorage::Observer {
@synthesize startupComplete = startupComplete_;
-+ (void)updateSigninItem:(id)signinItem
- shouldShow:(BOOL)showSigninMenuItem
- currentProfile:(Profile*)profile {
- DCHECK([signinItem isKindOfClass:[NSMenuItem class]]);
- NSMenuItem* signinMenuItem = static_cast<NSMenuItem*>(signinItem);
-
- // Look for a separator immediately after the menu item so it can be hidden
- // or shown appropriately along with the signin menu item.
- NSMenuItem* followingSeparator = nil;
- NSMenu* menu = [signinItem menu];
- if (menu) {
- NSInteger signinItemIndex = [menu indexOfItem:signinMenuItem];
- DCHECK_NE(signinItemIndex, -1);
- if ((signinItemIndex + 1) < [menu numberOfItems]) {
- NSMenuItem* menuItem = [menu itemAtIndex:(signinItemIndex + 1)];
- if ([menuItem isSeparatorItem]) {
- followingSeparator = menuItem;
- }
- }
- }
-
- base::string16 label = signin_ui_util::GetSigninMenuLabel(profile);
- [signinMenuItem setTitle:l10n_util::FixUpWindowsStyleLabel(label)];
- [signinMenuItem setHidden:!showSigninMenuItem];
- [followingSeparator setHidden:!showSigninMenuItem];
-}
-
- (void)dealloc {
[[closeTabMenuItem_ menu] setDelegate:nil];
[super dealloc];
@@ -922,27 +895,6 @@ class AppControllerProfileObserver : public ProfileAttributesStorage::Observer {
// dialog.
enable = ![self keyWindowIsModal];
break;
- case IDC_SHOW_SYNC_SETUP: {
- Profile* lastProfile = [self lastProfile];
- // The profile may be NULL during shutdown -- see
- // http://code.google.com/p/chromium/issues/detail?id=43048 .
- //
- // TODO(akalin,viettrungluu): Figure out whether this method
- // can be prevented from being called if lastProfile is
- // NULL.
- if (!lastProfile) {
- LOG(WARNING)
- << "NULL lastProfile detected -- not doing anything";
- break;
- }
- SigninManager* signin = SigninManagerFactory::GetForProfile(
- lastProfile->GetOriginalProfile());
- enable = signin->IsSigninAllowed() && ![self keyWindowIsModal];
- [AppController updateSigninItem:item
- shouldShow:enable
- currentProfile:lastProfile];
- break;
- }
default:
enable = menuState_->IsCommandEnabled(tag) ?
![self keyWindowIsModal] : NO;
@@ -1088,15 +1040,6 @@ class AppControllerProfileObserver : public ProfileAttributesStorage::Observer {
else
chrome::OpenHelpWindow(lastProfile, chrome::HELP_SOURCE_MENU);
break;
- case IDC_SHOW_SYNC_SETUP:
- if (Browser* browser = ActivateBrowser(lastProfile)) {
- chrome::ShowBrowserSigninOrSettings(
- browser, signin_metrics::AccessPoint::ACCESS_POINT_MENU);
- } else {
- chrome::OpenSyncSetupWindow(
- lastProfile, signin_metrics::AccessPoint::ACCESS_POINT_MENU);
- }
- break;
case IDC_TASK_MANAGER:
chrome::OpenTaskManager(NULL);
break;
@@ -1249,7 +1192,6 @@ class AppControllerProfileObserver : public ProfileAttributesStorage::Observer {
#if defined(GOOGLE_CHROME_BUILD)
menuState_->UpdateCommandEnabled(IDC_FEEDBACK, true);
#endif
- menuState_->UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, true);
menuState_->UpdateCommandEnabled(IDC_TASK_MANAGER, true);
}
« no previous file with comments | « chrome/browser/app_controller_mac.h ('k') | chrome/browser/app_controller_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698