| 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_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 6 #define CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 bool success) const = 0; | 124 bool success) const = 0; |
| 125 | 125 |
| 126 // Records metrics for password based flow for the given user. | 126 // Records metrics for password based flow for the given user. |
| 127 virtual void RecordPasswordLoginEvent(const std::string& user_id) const = 0; | 127 virtual void RecordPasswordLoginEvent(const std::string& user_id) const = 0; |
| 128 | 128 |
| 129 // Whether easy unlock is allowed to be used. If the controlling preference | 129 // Whether easy unlock is allowed to be used. If the controlling preference |
| 130 // is set (from policy), this returns the preference value. Otherwise, it is | 130 // is set (from policy), this returns the preference value. Otherwise, it is |
| 131 // permitted either the flag is enabled or its field trial is enabled. | 131 // permitted either the flag is enabled or its field trial is enabled. |
| 132 bool IsAllowed(); | 132 bool IsAllowed(); |
| 133 | 133 |
| 134 // Whether Easy Unlock is currently enabled for this user. |
| 135 bool IsEnabled() const; |
| 136 |
| 134 // Sets the hardlock state for the associated user. | 137 // Sets the hardlock state for the associated user. |
| 135 void SetHardlockState(EasyUnlockScreenlockStateHandler::HardlockState state); | 138 void SetHardlockState(EasyUnlockScreenlockStateHandler::HardlockState state); |
| 136 | 139 |
| 137 // Returns the hardlock state for the associated user. | 140 // Returns the hardlock state for the associated user. |
| 138 EasyUnlockScreenlockStateHandler::HardlockState GetHardlockState() const; | 141 EasyUnlockScreenlockStateHandler::HardlockState GetHardlockState() const; |
| 139 | 142 |
| 140 // Gets the persisted hardlock state. Return true if there is persisted | 143 // Gets the persisted hardlock state. Return true if there is persisted |
| 141 // hardlock state and the value would be set to |state|. Otherwise, | 144 // hardlock state and the value would be set to |state|. Otherwise, |
| 142 // returns false and |state| is unchanged. | 145 // returns false and |state| is unchanged. |
| 143 bool GetPersistedHardlockState( | 146 bool GetPersistedHardlockState( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 188 |
| 186 // Does a service type specific initialization. | 189 // Does a service type specific initialization. |
| 187 virtual void InitializeInternal() = 0; | 190 virtual void InitializeInternal() = 0; |
| 188 | 191 |
| 189 // Does a service type specific shutdown. Called from |Shutdown|. | 192 // Does a service type specific shutdown. Called from |Shutdown|. |
| 190 virtual void ShutdownInternal() = 0; | 193 virtual void ShutdownInternal() = 0; |
| 191 | 194 |
| 192 // Service type specific tests for whether the service is allowed. Returns | 195 // Service type specific tests for whether the service is allowed. Returns |
| 193 // false if service is not allowed. If true is returned, the service may still | 196 // false if service is not allowed. If true is returned, the service may still |
| 194 // not be allowed if common tests fail (e.g. if Bluetooth is not available). | 197 // not be allowed if common tests fail (e.g. if Bluetooth is not available). |
| 195 virtual bool IsAllowedInternal() = 0; | 198 virtual bool IsAllowedInternal() const = 0; |
| 196 | 199 |
| 197 // KeyedService override: | 200 // KeyedService override: |
| 198 void Shutdown() override; | 201 void Shutdown() override; |
| 199 | 202 |
| 200 // Exposes the profile to which the service is attached to subclasses. | 203 // Exposes the profile to which the service is attached to subclasses. |
| 201 Profile* profile() const { return profile_; } | 204 Profile* profile() const { return profile_; } |
| 202 | 205 |
| 203 // Installs the Easy unlock component app if it isn't installed and enables | 206 // Installs the Easy unlock component app if it isn't installed and enables |
| 204 // the app if it is disabled. | 207 // the app if it is disabled. |
| 205 void LoadApp(); | 208 void LoadApp(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 bool tpm_key_checked_; | 295 bool tpm_key_checked_; |
| 293 | 296 |
| 294 ObserverList<EasyUnlockServiceObserver> observers_; | 297 ObserverList<EasyUnlockServiceObserver> observers_; |
| 295 | 298 |
| 296 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; | 299 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
| 297 | 300 |
| 298 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); | 301 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |
| 299 }; | 302 }; |
| 300 | 303 |
| 301 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 304 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
| OLD | NEW |