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

Unified Diff: chrome/browser/ui/browser_command_controller.cc

Issue 12077030: Allow signin to continue even if sync is disabled by policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows sync integration test failure Created 7 years, 11 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/ui/browser_command_controller.h ('k') | chrome/browser/ui/browser_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_command_controller.cc
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 41abedb63356b63db77fe65c1f9121c85db37bf6..546d80dc43c5cfe40bd5e513c92bbf90cee04e1f 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -210,19 +210,9 @@ BrowserCommandController::BrowserCommandController(
tab_restore_service->AddObserver(this);
TabRestoreServiceChanged(tab_restore_service);
}
-
- ProfileSyncService* service =
- ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile());
- if (service)
- service->AddObserver(this);
}
BrowserCommandController::~BrowserCommandController() {
- ProfileSyncService* service =
- ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile());
- if (service)
- service->RemoveObserver(this);
-
// TabRestoreService may have been shutdown by the time we get here. Don't
// trigger creating it.
TabRestoreService* tab_restore_service =
@@ -690,8 +680,8 @@ void BrowserCommandController::ExecuteCommandWithDisposition(
case IDC_HELP_PAGE_VIA_MENU:
ShowHelp(browser_, HELP_SOURCE_MENU);
break;
- case IDC_SHOW_SYNC_SETUP:
- ShowSyncSetup(browser_, SyncPromoUI::SOURCE_MENU);
+ case IDC_SHOW_SIGNIN:
+ ShowBrowserSignin(browser_, SyncPromoUI::SOURCE_MENU);
break;
case IDC_TOGGLE_SPEECH_INPUT:
ToggleSpeechInput(browser_);
@@ -752,20 +742,6 @@ void BrowserCommandController::OnProfileAvatarChanged(
}
////////////////////////////////////////////////////////////////////////////////
-// BrowserCommandController, ProfileSyncServiceObserver implementation:
-
-void BrowserCommandController::OnStateChanged() {
- DCHECK(ProfileSyncServiceFactory::GetInstance()->HasProfileSyncService(
- profile()));
- // For unit tests, we don't have a window.
- if (!window())
- return;
- const bool show_main_ui = IsShowingMainUI(window()->IsFullscreen());
- command_updater_.UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP,
- show_main_ui && profile()->GetOriginalProfile()->IsSyncAccessible());
-}
-
-////////////////////////////////////////////////////////////////////////////////
// BrowserCommandController, TabStripModelObserver implementation:
void BrowserCommandController::TabInsertedAt(WebContents* contents,
@@ -905,8 +881,7 @@ void BrowserCommandController::InitCommandState() {
!profile()->IsGuestSession() &&
!profile()->IsOffTheRecord());
- command_updater_.UpdateCommandEnabled(
- IDC_SHOW_SYNC_SETUP, profile()->GetOriginalProfile()->IsSyncAccessible());
+ command_updater_.UpdateCommandEnabled(IDC_SHOW_SIGNIN, true);
// Initialize other commands based on the window type.
bool normal_window = browser_->is_type_tabbed();
@@ -1141,8 +1116,6 @@ void BrowserCommandController::UpdateCommandsForFullscreenMode(
// Show various bits of UI
command_updater_.UpdateCommandEnabled(IDC_DEVELOPER_MENU, show_main_ui);
command_updater_.UpdateCommandEnabled(IDC_FEEDBACK, show_main_ui);
- command_updater_.UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP,
- show_main_ui && profile()->GetOriginalProfile()->IsSyncAccessible());
// Settings page/subpages are forced to open in normal mode. We disable these
// commands when incognito is forced.
« no previous file with comments | « chrome/browser/ui/browser_command_controller.h ('k') | chrome/browser/ui/browser_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698