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 22 matching lines...) Expand all Loading... |
33 "https://www.googleapis.com/auth/userinfo.email"; | 33 "https://www.googleapis.com/auth/userinfo.email"; |
34 static const int kMaxRetries = 5; | 34 static const int kMaxRetries = 5; |
35 | 35 |
36 } // namespace | 36 } // namespace |
37 | 37 |
38 OAuth2LoginManager::OAuth2LoginManager(Profile* user_profile) | 38 OAuth2LoginManager::OAuth2LoginManager(Profile* user_profile) |
39 : user_profile_(user_profile), | 39 : user_profile_(user_profile), |
40 restore_strategy_(RESTORE_FROM_COOKIE_JAR), | 40 restore_strategy_(RESTORE_FROM_COOKIE_JAR), |
41 state_(SESSION_RESTORE_NOT_STARTED) { | 41 state_(SESSION_RESTORE_NOT_STARTED) { |
42 GetTokenService()->AddObserver(this); | 42 GetTokenService()->AddObserver(this); |
| 43 |
| 44 // For telemetry, we mark session restore completed to avoid warnings from |
| 45 // MergeSessionThrottle. |
43 if (CommandLine::ForCurrentProcess()-> | 46 if (CommandLine::ForCurrentProcess()-> |
44 HasSwitch(chromeos::switches::kOobeSkipPostLogin)) { | 47 HasSwitch(chromeos::switches::kDisableGaiaServices)) { |
45 // For telemetry we should mark session restore completed to avoid | |
46 // warnings from MergeSessionThrottle. | |
47 SetSessionRestoreState(SESSION_RESTORE_DONE); | 48 SetSessionRestoreState(SESSION_RESTORE_DONE); |
48 } | 49 } |
49 } | 50 } |
50 | 51 |
51 OAuth2LoginManager::~OAuth2LoginManager() { | 52 OAuth2LoginManager::~OAuth2LoginManager() { |
52 } | 53 } |
53 | 54 |
54 void OAuth2LoginManager::AddObserver(OAuth2LoginManager::Observer* observer) { | 55 void OAuth2LoginManager::AddObserver(OAuth2LoginManager::Observer* observer) { |
55 observer_list_.AddObserver(observer); | 56 observer_list_.AddObserver(observer); |
56 } | 57 } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 FOR_EACH_OBSERVER(Observer, observer_list_, | 395 FOR_EACH_OBSERVER(Observer, observer_list_, |
395 OnSessionRestoreStateChanged(user_profile_, state_)); | 396 OnSessionRestoreStateChanged(user_profile_, state_)); |
396 } | 397 } |
397 | 398 |
398 void OAuth2LoginManager::SetSessionRestoreStartForTesting( | 399 void OAuth2LoginManager::SetSessionRestoreStartForTesting( |
399 const base::Time& time) { | 400 const base::Time& time) { |
400 session_restore_start_ = time; | 401 session_restore_start_ = time; |
401 } | 402 } |
402 | 403 |
403 } // namespace chromeos | 404 } // namespace chromeos |
OLD | NEW |