| 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 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ | 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/time/time.h" |
| 14 #include "base/values.h" | 15 #include "base/values.h" |
| 15 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" | 16 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_types.h" |
| 16 #include "chrome/browser/signin/easy_unlock_service.h" | 17 #include "chrome/browser/signin/easy_unlock_service.h" |
| 17 #include "chrome/browser/signin/screenlock_bridge.h" | 18 #include "chrome/browser/signin/screenlock_bridge.h" |
| 18 #include "chromeos/login/login_state.h" | 19 #include "chromeos/login/login_state.h" |
| 19 | 20 |
| 20 // EasyUnlockService instance that should be used for signin profile. | 21 // EasyUnlockService instance that should be used for signin profile. |
| 21 class EasyUnlockServiceSignin : public EasyUnlockService, | 22 class EasyUnlockServiceSignin : public EasyUnlockService, |
| 22 public ScreenlockBridge::Observer, | 23 public ScreenlockBridge::Observer, |
| 23 public chromeos::LoginState::Observer { | 24 public chromeos::LoginState::Observer { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 std::string GetWrappedSecret() const override; | 76 std::string GetWrappedSecret() const override; |
| 76 void RecordEasySignInOutcome(const std::string& user_id, | 77 void RecordEasySignInOutcome(const std::string& user_id, |
| 77 bool success) const override; | 78 bool success) const override; |
| 78 void RecordPasswordLoginEvent(const std::string& user_id) const override; | 79 void RecordPasswordLoginEvent(const std::string& user_id) const override; |
| 79 void StartAutoPairing(const AutoPairingResultCallback& callback) override; | 80 void StartAutoPairing(const AutoPairingResultCallback& callback) override; |
| 80 void SetAutoPairingResult(bool success, const std::string& error) override; | 81 void SetAutoPairingResult(bool success, const std::string& error) override; |
| 81 void InitializeInternal() override; | 82 void InitializeInternal() override; |
| 82 void ShutdownInternal() override; | 83 void ShutdownInternal() override; |
| 83 bool IsAllowedInternal() const override; | 84 bool IsAllowedInternal() const override; |
| 84 void OnWillFinalizeUnlock(bool success) override; | 85 void OnWillFinalizeUnlock(bool success) override; |
| 86 void OnSuspendDone() override; |
| 85 | 87 |
| 86 // ScreenlockBridge::Observer implementation: | 88 // ScreenlockBridge::Observer implementation: |
| 87 void OnScreenDidLock( | 89 void OnScreenDidLock( |
| 88 ScreenlockBridge::LockHandler::ScreenType screen_type) override; | 90 ScreenlockBridge::LockHandler::ScreenType screen_type) override; |
| 89 void OnScreenDidUnlock( | 91 void OnScreenDidUnlock( |
| 90 ScreenlockBridge::LockHandler::ScreenType screen_type) override; | 92 ScreenlockBridge::LockHandler::ScreenType screen_type) override; |
| 91 void OnFocusedUserChanged(const std::string& user_id) override; | 93 void OnFocusedUserChanged(const std::string& user_id) override; |
| 92 | 94 |
| 93 // chromeos::LoginState::Observer implementation: | 95 // chromeos::LoginState::Observer implementation: |
| 94 void LoggedInStateChanged() override; | 96 void LoggedInStateChanged() override; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 116 // Whether failed attempts to load user data should be retried. | 118 // Whether failed attempts to load user data should be retried. |
| 117 // This is to handle case where cryptohome daemon is not started in time the | 119 // This is to handle case where cryptohome daemon is not started in time the |
| 118 // service attempts to load some data. Retries will be allowed only until the | 120 // service attempts to load some data. Retries will be allowed only until the |
| 119 // first data load finishes (even if it fails). | 121 // first data load finishes (even if it fails). |
| 120 bool allow_cryptohome_backoff_; | 122 bool allow_cryptohome_backoff_; |
| 121 | 123 |
| 122 // Whether the service has been successfully initialized, and has not been | 124 // Whether the service has been successfully initialized, and has not been |
| 123 // shut down. | 125 // shut down. |
| 124 bool service_active_; | 126 bool service_active_; |
| 125 | 127 |
| 128 // The timestamp for the most recent time when a user pod was focused. |
| 129 base::TimeTicks user_pod_last_focused_timestamp_; |
| 130 |
| 126 base::WeakPtrFactory<EasyUnlockServiceSignin> weak_ptr_factory_; | 131 base::WeakPtrFactory<EasyUnlockServiceSignin> weak_ptr_factory_; |
| 127 | 132 |
| 128 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceSignin); | 133 DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceSignin); |
| 129 }; | 134 }; |
| 130 | 135 |
| 131 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ | 136 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_SIGNIN_CHROMEOS_H_ |
| OLD | NEW |