| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // logged in and his profile is initialized. | 57 // logged in and his profile is initialized. |
| 58 static EasyUnlockService* GetForUser(const user_manager::User& user); | 58 static EasyUnlockService* GetForUser(const user_manager::User& user); |
| 59 | 59 |
| 60 // Registers Easy Unlock profile preferences. | 60 // Registers Easy Unlock profile preferences. |
| 61 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 61 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 62 | 62 |
| 63 // Registers Easy Unlock local state entries. | 63 // Registers Easy Unlock local state entries. |
| 64 static void RegisterPrefs(PrefRegistrySimple* registry); | 64 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 65 | 65 |
| 66 // Removes the hardlock state for the given user. | 66 // Removes the hardlock state for the given user. |
| 67 static void RemoveHardlockStateForUser(const std::string& user_id); | 67 static void ResetLocalStateForUser(const std::string& user_id); |
| 68 | 68 |
| 69 // Returns the EasyUnlockService type. | 69 // Returns the EasyUnlockService type. |
| 70 virtual Type GetType() const = 0; | 70 virtual Type GetType() const = 0; |
| 71 | 71 |
| 72 // Returns the user currently associated with the service. | 72 // Returns the user currently associated with the service. |
| 73 virtual std::string GetUserEmail() const = 0; | 73 virtual std::string GetUserEmail() const = 0; |
| 74 | 74 |
| 75 // Launches Easy Unlock Setup app. | 75 // Launches Easy Unlock Setup app. |
| 76 virtual void LaunchSetup() = 0; | 76 virtual void LaunchSetup() = 0; |
| 77 | 77 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 // Finalizes previously started auth attempt for easy signin. If called on | 135 // Finalizes previously started auth attempt for easy signin. If called on |
| 136 // regular profile service, it will cancel the current auth attempt if one | 136 // regular profile service, it will cancel the current auth attempt if one |
| 137 // exists. | 137 // exists. |
| 138 void FinalizeSignin(const std::string& secret); | 138 void FinalizeSignin(const std::string& secret); |
| 139 | 139 |
| 140 // Checks the consistency between pairing data and cryptohome keys. Set | 140 // Checks the consistency between pairing data and cryptohome keys. Set |
| 141 // hardlock state if the two do not match. | 141 // hardlock state if the two do not match. |
| 142 void CheckCryptohomeKeysAndMaybeHardlock(); | 142 void CheckCryptohomeKeysAndMaybeHardlock(); |
| 143 | 143 |
| 144 // Marks the Easy Unlock screen lock state as the one associated with the |
| 145 // trial run initiated by Easy Unlock app. |
| 146 void SetTrialRun(); |
| 147 |
| 144 void AddObserver(EasyUnlockServiceObserver* observer); | 148 void AddObserver(EasyUnlockServiceObserver* observer); |
| 145 void RemoveObserver(EasyUnlockServiceObserver* observer); | 149 void RemoveObserver(EasyUnlockServiceObserver* observer); |
| 146 | 150 |
| 147 protected: | 151 protected: |
| 148 explicit EasyUnlockService(Profile* profile); | 152 explicit EasyUnlockService(Profile* profile); |
| 149 virtual ~EasyUnlockService(); | 153 virtual ~EasyUnlockService(); |
| 150 | 154 |
| 151 // Does a service type specific initialization. | 155 // Does a service type specific initialization. |
| 152 virtual void InitializeInternal() = 0; | 156 virtual void InitializeInternal() = 0; |
| 153 | 157 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 bool shut_down_; | 250 bool shut_down_; |
| 247 | 251 |
| 248 ObserverList<EasyUnlockServiceObserver> observers_; | 252 ObserverList<EasyUnlockServiceObserver> observers_; |
| 249 | 253 |
| 250 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; | 254 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
| 251 | 255 |
| 252 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); | 256 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |
| 253 }; | 257 }; |
| 254 | 258 |
| 255 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 259 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
| OLD | NEW |