Index: chrome/browser/ui/sync/one_click_signin_sync_starter.cc |
=================================================================== |
--- chrome/browser/ui/sync/one_click_signin_sync_starter.cc (revision 179305) |
+++ chrome/browser/ui/sync/one_click_signin_sync_starter.cc (working copy) |
@@ -18,30 +18,29 @@ |
#include "chrome/common/url_constants.h" |
OneClickSigninSyncStarter::OneClickSigninSyncStarter( |
- Profile* profile, |
Browser* browser, |
const std::string& session_index, |
const std::string& email, |
const std::string& password, |
StartSyncMode start_mode) |
- : profile_(profile), |
- browser_(browser), |
- signin_tracker_(profile_, this), |
+ : browser_(browser), |
+ signin_tracker_(browser_->profile(), this), |
start_mode_(start_mode) { |
- DCHECK(profile_); |
+ DCHECK(browser_); |
// Let the sync service know that setup is in progress so it doesn't start |
// syncing until the user has finished any configuration. |
ProfileSyncService* profile_sync_service = |
- ProfileSyncServiceFactory::GetForProfile(profile_); |
+ ProfileSyncServiceFactory::GetForProfile(browser_->profile()); |
profile_sync_service->SetSetupInProgress(true); |
// Make sure the syncing is not suppressed, otherwise the SigninManager |
// will not be able to compelte sucessfully. |
- browser_sync::SyncPrefs sync_prefs(profile_->GetPrefs()); |
+ browser_sync::SyncPrefs sync_prefs(browser_->profile()->GetPrefs()); |
sync_prefs.SetStartSuppressed(false); |
- SigninManager* manager = SigninManagerFactory::GetForProfile(profile_); |
+ SigninManager* manager = SigninManagerFactory::GetForProfile( |
+ browser_->profile()); |
manager->StartSignInWithCredentials(session_index, email, password); |
} |
@@ -54,14 +53,14 @@ |
void OneClickSigninSyncStarter::SigninFailed( |
const GoogleServiceAuthError& error) { |
ProfileSyncService* profile_sync_service = |
- ProfileSyncServiceFactory::GetForProfile(profile_); |
+ ProfileSyncServiceFactory::GetForProfile(browser_->profile()); |
profile_sync_service->SetSetupInProgress(false); |
delete this; |
} |
void OneClickSigninSyncStarter::SigninSuccess() { |
ProfileSyncService* profile_sync_service = |
- ProfileSyncServiceFactory::GetForProfile(profile_); |
+ ProfileSyncServiceFactory::GetForProfile(browser_->profile()); |
switch (start_mode_) { |
case SYNC_WITH_DEFAULT_SETTINGS: |
@@ -75,10 +74,11 @@ |
// ProfileSyncService::setup_in_progress flag because we don't want sync |
// to start up until after the configure UI is displayed (the configure UI |
// will clear the flag when the user is done setting up sync). |
- LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_); |
+ LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile( |
+ browser_->profile()); |
if (login_ui->current_login_ui()) { |
login_ui->current_login_ui()->FocusUI(); |
- } else if (browser_) { |
+ } else { |
// Need to navigate to the settings page and display the UI. |
chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage); |
} |