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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 7477021: Pass Setup Chrome Sync to main profile from Incognito. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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 | « no previous file | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index e9625e600b6181c229db3e230f15b0aaf6de9330..5349f7eb9c5b6eabd35f177c859cc1c5ea4b99da 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -38,6 +38,7 @@
#include "chrome/browser/sync/signin_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
@@ -858,8 +859,14 @@ void ProfileSyncService::ShowConfigure(bool sync_everything) {
void ProfileSyncService::ShowSyncSetup(SyncSetupWizard::State state) {
wizard_.Step(state);
- BrowserList::GetLastActiveWithProfile(profile())->ShowOptionsTab(
- chrome::kSyncSetupSubPage);
+ Browser* browser = BrowserList::GetLastActiveWithProfile(profile());
+ if (!browser) {
+ browser = Browser::Create(profile());
+ browser->ShowOptionsTab(chrome::kSyncSetupSubPage);
+ browser->window()->Show();
+ } else {
+ browser->ShowOptionsTab(chrome::kSyncSetupSubPage);
+ }
}
SyncBackendHost::StatusSummary ProfileSyncService::QuerySyncStatusSummary() {
« no previous file with comments | « no previous file | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698