Index: chrome/browser/ui/browser.cc |
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
index c5385b724b9579b619062aec9e0e29ed971acdbb..a876ec235cd69413875b5abe84182cbe5c095dff 100644 |
--- a/chrome/browser/ui/browser.cc |
+++ b/chrome/browser/ui/browser.cc |
@@ -2461,6 +2461,7 @@ void Browser::ExecuteCommandWithDisposition( |
case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; |
case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; |
#endif |
+ case IDC_SHOW_SYNC_SETUP: ShowSyncSetup(); break; |
default: |
LOG(WARNING) << "Received Unimplemented Command: " << id; |
@@ -3860,6 +3861,7 @@ void Browser::InitCommandState() { |
command_updater_.UpdateCommandEnabled(IDC_SYSTEM_OPTIONS, true); |
command_updater_.UpdateCommandEnabled(IDC_INTERNET_OPTIONS, true); |
#endif |
+ command_updater_.UpdateCommandEnabled(IDC_SHOW_SYNC_SETUP, true); |
ExtensionService* extension_service = profile()->GetExtensionService(); |
bool enable_extensions = |
@@ -4752,3 +4754,11 @@ void Browser::UpdateBookmarkBarState(BookmarkBarStateChangeReason reason) { |
BookmarkBar::DONT_ANIMATE_STATE_CHANGE; |
window_->BookmarkBarStateChanged(animate_type); |
} |
+ |
+void Browser::ShowSyncSetup() { |
+ ProfileSyncService* service = profile()->GetProfileSyncService(); |
+ if (service->HasSyncSetupCompleted()) |
+ ShowOptionsTab(chrome::kSyncSetupSubPage); |
+ else |
+ profile()->GetProfileSyncService()->ShowLoginDialog(); |
+} |