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

Unified Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.cc

Issue 12095027: [win] Add signin support for the app launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix cros test Created 7 years, 11 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 | « chrome/browser/ui/sync/one_click_signin_sync_starter.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/sync/one_click_signin_sync_starter.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
index 295df44c0f37e40ffe93e4836a0d82d6b217959e..3be7fc576c964ca46d4f5438baeb0ddc1fb4507d 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -18,29 +18,30 @@
#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)
- : browser_(browser),
- signin_tracker_(browser_->profile(), this),
+ : profile_(profile),
+ browser_(browser),
+ signin_tracker_(profile_, this),
start_mode_(start_mode) {
- DCHECK(browser_);
+ DCHECK(profile_);
// 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(browser_->profile());
+ ProfileSyncServiceFactory::GetForProfile(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(browser_->profile()->GetPrefs());
+ browser_sync::SyncPrefs sync_prefs(profile_->GetPrefs());
sync_prefs.SetStartSuppressed(false);
- SigninManager* manager = SigninManagerFactory::GetForProfile(
- browser_->profile());
+ SigninManager* manager = SigninManagerFactory::GetForProfile(profile_);
manager->StartSignInWithCredentials(session_index, email, password);
}
@@ -53,14 +54,14 @@ void OneClickSigninSyncStarter::GaiaCredentialsValid() {
void OneClickSigninSyncStarter::SigninFailed(
const GoogleServiceAuthError& error) {
ProfileSyncService* profile_sync_service =
- ProfileSyncServiceFactory::GetForProfile(browser_->profile());
+ ProfileSyncServiceFactory::GetForProfile(profile_);
profile_sync_service->SetSetupInProgress(false);
delete this;
}
void OneClickSigninSyncStarter::SigninSuccess() {
ProfileSyncService* profile_sync_service =
- ProfileSyncServiceFactory::GetForProfile(browser_->profile());
+ ProfileSyncServiceFactory::GetForProfile(profile_);
switch (start_mode_) {
case SYNC_WITH_DEFAULT_SETTINGS:
@@ -74,11 +75,10 @@ void OneClickSigninSyncStarter::SigninSuccess() {
// 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(
- browser_->profile());
+ LoginUIService* login_ui = LoginUIServiceFactory::GetForProfile(profile_);
if (login_ui->current_login_ui()) {
login_ui->current_login_ui()->FocusUI();
- } else {
+ } else if (browser_) {
// Need to navigate to the settings page and display the UI.
chrome::ShowSettingsSubPage(browser_, chrome::kSyncSetupSubPage);
}
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_sync_starter.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698