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

Side by Side Diff: chrome/browser/signin/signin_manager.cc

Issue 9956097: suppress user/password dialog when re-enabling sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 8 years, 8 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 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/signin/signin_manager.h" 5 #include "chrome/browser/signin/signin_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // Users must always sign out before they sign in again. 118 // Users must always sign out before they sign in again.
119 void SigninManager::StartSignIn(const std::string& username, 119 void SigninManager::StartSignIn(const std::string& username,
120 const std::string& password, 120 const std::string& password,
121 const std::string& login_token, 121 const std::string& login_token,
122 const std::string& login_captcha) { 122 const std::string& login_captcha) {
123 DCHECK(authenticated_username_.empty() || 123 DCHECK(authenticated_username_.empty() ||
124 username == authenticated_username_); 124 username == authenticated_username_);
125 PrepareForSignin(); 125 PrepareForSignin();
126 possibly_invalid_username_.assign(username); 126 possibly_invalid_username_.assign(username);
127 password_.assign(password); 127 password_.assign(password);
128 convenient_password_.assign(password);
128 129
129 client_login_.reset(new GaiaAuthFetcher(this, 130 client_login_.reset(new GaiaAuthFetcher(this,
130 GaiaConstants::kChromeSource, 131 GaiaConstants::kChromeSource,
131 profile_->GetRequestContext())); 132 profile_->GetRequestContext()));
132 client_login_->StartClientLogin(username, 133 client_login_->StartClientLogin(username,
133 password, 134 password,
134 "", 135 "",
135 login_token, 136 login_token,
136 login_captcha, 137 login_captcha,
137 GaiaAuthFetcher::HostedAccountsNotAllowed); 138 GaiaAuthFetcher::HostedAccountsNotAllowed);
(...skipping 28 matching lines...) Expand all
166 GaiaAuthFetcher::HostedAccountsNotAllowed); 167 GaiaAuthFetcher::HostedAccountsNotAllowed);
167 } 168 }
168 169
169 void SigninManager::StartSignInWithCredentials(const std::string& session_index, 170 void SigninManager::StartSignInWithCredentials(const std::string& session_index,
170 const std::string& username, 171 const std::string& username,
171 const std::string& password) { 172 const std::string& password) {
172 DCHECK(authenticated_username_.empty()); 173 DCHECK(authenticated_username_.empty());
173 PrepareForSignin(); 174 PrepareForSignin();
174 possibly_invalid_username_.assign(username); 175 possibly_invalid_username_.assign(username);
175 password_.assign(password); 176 password_.assign(password);
177 convenient_password_.assign(password);
176 178
177 client_login_.reset(new GaiaAuthFetcher(this, 179 client_login_.reset(new GaiaAuthFetcher(this,
178 GaiaConstants::kChromeSource, 180 GaiaConstants::kChromeSource,
179 profile_->GetRequestContext())); 181 profile_->GetRequestContext()));
180 182
181 // This function starts with the current state of the web session's cookie 183 // This function starts with the current state of the web session's cookie
182 // jar and mints a new ClientLogin-style SID/LSID pair. This involves going 184 // jar and mints a new ClientLogin-style SID/LSID pair. This involves going
183 // throug the follow process or requests to GAIA and LSO: 185 // throug the follow process or requests to GAIA and LSO:
184 // 186 //
185 // - call /o/oauth2/programmatic_auth with the returned token to get oauth2 187 // - call /o/oauth2/programmatic_auth with the returned token to get oauth2
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 profile_->GetRequestContext())); 400 profile_->GetRequestContext()));
399 } 401 }
400 402
401 client_login_->StartMergeSession(tok_details->token()); 403 client_login_->StartMergeSession(tok_details->token());
402 404
403 // We only want to do this once per sign-in. 405 // We only want to do this once per sign-in.
404 CleanupNotificationRegistration(); 406 CleanupNotificationRegistration();
405 } 407 }
406 #endif 408 #endif
407 } 409 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698