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

Side by Side Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.cc

Issue 11418200: Setup from settings should allow configuration first (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" 5 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/signin/signin_manager.h" 8 #include "chrome/browser/signin/signin_manager.h"
9 #include "chrome/browser/signin/signin_manager_factory.h" 9 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "chrome/browser/sync/profile_sync_service.h" 10 #include "chrome/browser/sync/profile_sync_service.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 ProfileSyncService* profile_sync_service = 52 ProfileSyncService* profile_sync_service =
53 ProfileSyncServiceFactory::GetForProfile(browser_->profile()); 53 ProfileSyncServiceFactory::GetForProfile(browser_->profile());
54 profile_sync_service->SetSetupInProgress(false); 54 profile_sync_service->SetSetupInProgress(false);
55 delete this; 55 delete this;
56 } 56 }
57 57
58 void OneClickSigninSyncStarter::SigninSuccess() { 58 void OneClickSigninSyncStarter::SigninSuccess() {
59 ProfileSyncService* profile_sync_service = 59 ProfileSyncService* profile_sync_service =
60 ProfileSyncServiceFactory::GetForProfile(browser_->profile()); 60 ProfileSyncServiceFactory::GetForProfile(browser_->profile());
61 61
62 if (start_mode_ == SYNC_WITH_DEFAULT_SETTINGS) { 62 switch (start_mode_) {
63 // Just kick off the sync machine, no need to configure it first. 63 case SYNC_WITH_DEFAULT_SETTINGS:
64 profile_sync_service->OnUserChoseDatatypes(true, syncer::ModelTypeSet()); 64 // Just kick off the sync machine, no need to configure it first.
65 profile_sync_service->SetSyncSetupCompleted(); 65 profile_sync_service->OnUserChoseDatatypes(true, syncer::ModelTypeSet());
66 profile_sync_service->SetSetupInProgress(false); 66 profile_sync_service->SetSyncSetupCompleted();
67 } else { 67 profile_sync_service->SetSetupInProgress(false);
68 // Give the user a chance to configure things. We don't clear the 68 break;
69 // ProfileSyncService::setup_in_progress flag because we don't want sync 69 case CONFIGURE_SYNC_FIRST:
70 // to start up until after the configure UI is displayed (the configure UI 70 // Give the user a chance to configure things. We don't clear the
71 // will clear the flag when the user is done setting up sync). 71 // ProfileSyncService::setup_in_progress flag because we don't want sync
72 LoginUIServiceFactory::GetForProfile(browser_->profile())->ShowLoginUI( 72 // to start up until after the configure UI is displayed (the configure UI
73 browser_); 73 // will clear the flag when the user is done setting up sync).
74 LoginUIServiceFactory::GetForProfile(browser_->profile())->ShowLoginUI(
75 browser_);
76 break;
77 default:
78 NOTREACHED() << "Invalid start_mode=" << start_mode_;
74 } 79 }
75 80
76 delete this; 81 delete this;
77 } 82 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_sync_starter.h ('k') | chrome/browser/ui/webui/sync_setup_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698