Sync Promo: Add "Setup Chrome Sync" menu item to the wrench menu
To better promote Sync we want to add a new "Setup Chrome Sync" menu item to the wrench menu. Clicking on the menu item shows the "sync sign in" dialog.
If the user is already signed into sync then clicking on the menu item shows the "configure sync" dialog.
BUG=None
TEST=Ran and verified that the menu item works.
Review URL: http://codereview.chromium.org/7324038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92245 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index ecc9e9ba..cbf6b6a2 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2463,6 +2463,7 @@
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;
@@ -3862,6 +3863,7 @@
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 =
@@ -4754,3 +4756,11 @@
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();
+}