Pass Setup Chrome Sync to main profile from Incognito.
Incognito mode doesn't have a sync service.
Additionally, if there is no browser window associated with the main
profile, create one.
BUG=90570, 90466
TEST="Set Up Chrome Sync" from Incognito wrench menu doesn't crash (and opens tab in main profile).
TEST=Test also works if all main-profile windows are closed.
TEST=On Mac, close all windows and select "Set Up Sync" from Chrome menu.
Review URL: http://codereview.chromium.org/7477021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95381 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 0187b1df..dd015aa 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -4814,9 +4814,10 @@
}
void Browser::ShowSyncSetup() {
- ProfileSyncService* service = profile()->GetProfileSyncService();
+ ProfileSyncService* service =
+ profile()->GetOriginalProfile()->GetProfileSyncService();
if (service->HasSyncSetupCompleted())
ShowOptionsTab(chrome::kSyncSetupSubPage);
else
- profile()->GetProfileSyncService()->ShowLoginDialog();
+ service->ShowLoginDialog();
}