OLD | NEW |
---|---|
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/chromeos/login/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 // main |g_browser_process| request context (see bug | 268 // main |g_browser_process| request context (see bug |
269 // http://crosbug.com/24861). So we transfer any credentials to the global | 269 // http://crosbug.com/24861). So we transfer any credentials to the global |
270 // request context here. | 270 // request context here. |
271 // The issue we have here is that the NOTIFICATION_AUTH_SUPPLIED is sent | 271 // The issue we have here is that the NOTIFICATION_AUTH_SUPPLIED is sent |
272 // just after the UI is closed but before the new credentials were stored | 272 // just after the UI is closed but before the new credentials were stored |
273 // in the profile. Therefore we have to give it some time to make sure it | 273 // in the profile. Therefore we have to give it some time to make sure it |
274 // has been updated before we copy it. | 274 // has been updated before we copy it. |
275 LOG(INFO) << "Authentication was entered manually, possibly for proxyauth."; | 275 LOG(INFO) << "Authentication was entered manually, possibly for proxyauth."; |
276 scoped_refptr<net::URLRequestContextGetter> browser_process_context_getter = | 276 scoped_refptr<net::URLRequestContextGetter> browser_process_context_getter = |
277 g_browser_process->system_request_context(); | 277 g_browser_process->system_request_context(); |
278 Profile* default_profile = ProfileManager::GetDefaultProfile(); | 278 Profile* signing_profile = ProfileManager::GetSigninProfile(); |
Nikita (slow)
2013/04/04 12:59:13
nit: signing_profile > signin_profile
| |
279 scoped_refptr<net::URLRequestContextGetter> default_profile_context_getter = | 279 scoped_refptr<net::URLRequestContextGetter> signing_profile_context_getter = |
280 default_profile->GetRequestContext(); | 280 signing_profile->GetRequestContext(); |
281 DCHECK(browser_process_context_getter.get()); | 281 DCHECK(browser_process_context_getter.get()); |
282 DCHECK(default_profile_context_getter.get()); | 282 DCHECK(signing_profile_context_getter.get()); |
283 content::BrowserThread::PostDelayedTask( | 283 content::BrowserThread::PostDelayedTask( |
284 content::BrowserThread::IO, FROM_HERE, | 284 content::BrowserThread::IO, FROM_HERE, |
285 base::Bind(&TransferContextAuthenticationsOnIOThread, | 285 base::Bind(&TransferContextAuthenticationsOnIOThread, |
286 default_profile_context_getter, | 286 signing_profile_context_getter, |
287 browser_process_context_getter), | 287 browser_process_context_getter), |
288 base::TimeDelta::FromMilliseconds(kAuthCacheTransferDelayMs)); | 288 base::TimeDelta::FromMilliseconds(kAuthCacheTransferDelayMs)); |
289 } | 289 } |
290 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED) | 290 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED) |
291 return; | 291 return; |
292 login_display_->OnUserImageChanged(*content::Details<User>(details).ptr()); | 292 login_display_->OnUserImageChanged(*content::Details<User>(details).ptr()); |
293 } | 293 } |
294 | 294 |
295 //////////////////////////////////////////////////////////////////////////////// | 295 //////////////////////////////////////////////////////////////////////////////// |
296 // ExistingUserController, private: | 296 // ExistingUserController, private: |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1101 // changed. | 1101 // changed. |
1102 UserManager::Get()->SaveUserOAuthStatus( | 1102 UserManager::Get()->SaveUserOAuthStatus( |
1103 username, | 1103 username, |
1104 User::OAUTH2_TOKEN_STATUS_INVALID); | 1104 User::OAUTH2_TOKEN_STATUS_INVALID); |
1105 | 1105 |
1106 login_display_->SetUIEnabled(true); | 1106 login_display_->SetUIEnabled(true); |
1107 login_display_->ShowGaiaPasswordChanged(username); | 1107 login_display_->ShowGaiaPasswordChanged(username); |
1108 } | 1108 } |
1109 | 1109 |
1110 } // namespace chromeos | 1110 } // namespace chromeos |
OLD | NEW |