Index: chrome/browser/ui/sync/one_click_signin_sync_starter.cc |
=================================================================== |
--- chrome/browser/ui/sync/one_click_signin_sync_starter.cc (revision 144404) |
+++ chrome/browser/ui/sync/one_click_signin_sync_starter.cc (working copy) |
@@ -10,20 +10,21 @@ |
#include "chrome/browser/signin/signin_manager_factory.h" |
#include "chrome/browser/sync/profile_sync_service.h" |
#include "chrome/browser/sync/profile_sync_service_factory.h" |
+#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/sync/one_click_signin_histogram.h" |
#include "chrome/browser/ui/webui/signin/login_ui_service.h" |
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.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), |
- signin_tracker_(profile, this), |
+ : browser_(browser), |
+ signin_tracker_(browser_->profile(), this), |
start_mode_(start_mode) { |
- DCHECK(profile_); |
+ DCHECK(browser_); |
int action = start_mode_ == SYNC_WITH_DEFAULT_SETTINGS ? |
one_click_signin::HISTOGRAM_WITH_DEFAULTS : |
@@ -32,11 +33,12 @@ |
one_click_signin::HISTOGRAM_MAX); |
ProfileSyncService* profile_sync_service = |
- ProfileSyncServiceFactory::GetForProfile(profile_); |
+ ProfileSyncServiceFactory::GetForProfile(browser_->profile()); |
// Let the sync service know that setup is in progress so it doesn't start |
// syncing until the user has finished any configuration. |
profile_sync_service->SetSetupInProgress(true); |
- SigninManager* manager = SigninManagerFactory::GetForProfile(profile_); |
+ SigninManager* manager = SigninManagerFactory::GetForProfile( |
+ browser_->profile()); |
manager->StartSignInWithCredentials(session_index, email, password); |
} |
@@ -49,14 +51,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()); |
if (start_mode_ == SYNC_WITH_DEFAULT_SETTINGS) { |
// Just kick off the sync machine, no need to configure it first. |
@@ -68,7 +70,8 @@ |
// 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). |
- LoginUIServiceFactory::GetForProfile(profile_)->ShowLoginUI(); |
+ LoginUIServiceFactory::GetForProfile(browser_->profile())->ShowLoginUI( |
+ browser_); |
} |
delete this; |