| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/signin/oauth2_login_manager.h" | 5 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } // namespace | 40 } // namespace |
| 41 | 41 |
| 42 OAuth2LoginManager::OAuth2LoginManager(Profile* user_profile) | 42 OAuth2LoginManager::OAuth2LoginManager(Profile* user_profile) |
| 43 : user_profile_(user_profile), | 43 : user_profile_(user_profile), |
| 44 restore_strategy_(RESTORE_FROM_COOKIE_JAR), | 44 restore_strategy_(RESTORE_FROM_COOKIE_JAR), |
| 45 state_(SESSION_RESTORE_NOT_STARTED) { | 45 state_(SESSION_RESTORE_NOT_STARTED) { |
| 46 GetTokenService()->AddObserver(this); | 46 GetTokenService()->AddObserver(this); |
| 47 | 47 |
| 48 // For telemetry, we mark session restore completed to avoid warnings from | 48 // For telemetry, we mark session restore completed to avoid warnings from |
| 49 // MergeSessionThrottle. | 49 // MergeSessionThrottle. |
| 50 if (CommandLine::ForCurrentProcess()-> | 50 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 51 HasSwitch(chromeos::switches::kDisableGaiaServices)) { | 51 chromeos::switches::kDisableGaiaServices)) { |
| 52 SetSessionRestoreState(SESSION_RESTORE_DONE); | 52 SetSessionRestoreState(SESSION_RESTORE_DONE); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 | 55 |
| 56 OAuth2LoginManager::~OAuth2LoginManager() { | 56 OAuth2LoginManager::~OAuth2LoginManager() { |
| 57 } | 57 } |
| 58 | 58 |
| 59 void OAuth2LoginManager::AddObserver(OAuth2LoginManager::Observer* observer) { | 59 void OAuth2LoginManager::AddObserver(OAuth2LoginManager::Observer* observer) { |
| 60 observer_list_.AddObserver(observer); | 60 observer_list_.AddObserver(observer); |
| 61 } | 61 } |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 FOR_EACH_OBSERVER(Observer, observer_list_, | 419 FOR_EACH_OBSERVER(Observer, observer_list_, |
| 420 OnSessionRestoreStateChanged(user_profile_, state_)); | 420 OnSessionRestoreStateChanged(user_profile_, state_)); |
| 421 } | 421 } |
| 422 | 422 |
| 423 void OAuth2LoginManager::SetSessionRestoreStartForTesting( | 423 void OAuth2LoginManager::SetSessionRestoreStartForTesting( |
| 424 const base::Time& time) { | 424 const base::Time& time) { |
| 425 session_restore_start_ = time; | 425 session_restore_start_ = time; |
| 426 } | 426 } |
| 427 | 427 |
| 428 } // namespace chromeos | 428 } // namespace chromeos |
| OLD | NEW |