| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 // put in place that will ensure that the newly created session is | 491 // put in place that will ensure that the newly created session is |
| 492 // authenticated for the websites that work with the used authentication | 492 // authenticated for the websites that work with the used authentication |
| 493 // schema. | 493 // schema. |
| 494 if (!TransferDefaultCookies(authenticator_->authentication_profile(), | 494 if (!TransferDefaultCookies(authenticator_->authentication_profile(), |
| 495 user_profile)) { | 495 user_profile)) { |
| 496 LOG(WARNING) << "Cookie transfer from the default profile failed!"; | 496 LOG(WARNING) << "Cookie transfer from the default profile failed!"; |
| 497 } | 497 } |
| 498 } | 498 } |
| 499 std::string oauth1_token; | 499 std::string oauth1_token; |
| 500 std::string oauth1_secret; | 500 std::string oauth1_secret; |
| 501 if (!has_cookies_ && | 501 if (ReadOAuth1AccessToken(user_profile, &oauth1_token, &oauth1_secret) || |
| 502 ReadOAuth1AccessToken(user_profile, &oauth1_token, &oauth1_secret)) { | 502 !has_cookies_) { |
| 503 // Verify OAuth access token when we find it in the profile and no cookies | 503 // Verify OAuth access token when we find it in the profile and always if |
| 504 // available because user is not signing in using extension. | 504 // if we don't have cookies. |
| 505 authenticator_->VerifyOAuth1AccessToken(oauth1_token, oauth1_secret); | 505 authenticator_->VerifyOAuth1AccessToken(oauth1_token, oauth1_secret); |
| 506 } else { | 506 } else { |
| 507 // If we don't have it, fetch OAuth1 access token. | 507 // If we don't have it, fetch OAuth1 access token. |
| 508 // Use off-the-record profile that was used for this step. It should | 508 // Use off-the-record profile that was used for this step. It should |
| 509 // already contain all needed cookies that will let us skip GAIA's user | 509 // already contain all needed cookies that will let us skip GAIA's user |
| 510 // authentication UI. | 510 // authentication UI. |
| 511 // | 511 // |
| 512 // TODO(rickcam) We should use an isolated App here. | 512 // TODO(rickcam) We should use an isolated App here. |
| 513 FetchOAuth1AccessToken(authenticator_->authentication_profile()); | 513 FetchOAuth1AccessToken(authenticator_->authentication_profile()); |
| 514 } | 514 } |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 // Mark login host for deletion after browser starts. This | 998 // Mark login host for deletion after browser starts. This |
| 999 // guarantees that the message loop will be referenced by the | 999 // guarantees that the message loop will be referenced by the |
| 1000 // browser before it is dereferenced by the login host. | 1000 // browser before it is dereferenced by the login host. |
| 1001 if (login_host) { | 1001 if (login_host) { |
| 1002 login_host->OnSessionStart(); | 1002 login_host->OnSessionStart(); |
| 1003 login_host = NULL; | 1003 login_host = NULL; |
| 1004 } | 1004 } |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 } // namespace chromeos | 1007 } // namespace chromeos |
| OLD | NEW |