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

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

Issue 12088037: Revert 179302 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
===================================================================
--- 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);
}
« 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