| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 // Marks the Easy Unlock screen lock state as the one associated with the | 147 // Marks the Easy Unlock screen lock state as the one associated with the |
| 148 // trial run initiated by Easy Unlock app. | 148 // trial run initiated by Easy Unlock app. |
| 149 void SetTrialRun(); | 149 void SetTrialRun(); |
| 150 | 150 |
| 151 void AddObserver(EasyUnlockServiceObserver* observer); | 151 void AddObserver(EasyUnlockServiceObserver* observer); |
| 152 void RemoveObserver(EasyUnlockServiceObserver* observer); | 152 void RemoveObserver(EasyUnlockServiceObserver* observer); |
| 153 | 153 |
| 154 protected: | 154 protected: |
| 155 explicit EasyUnlockService(Profile* profile); | 155 explicit EasyUnlockService(Profile* profile); |
| 156 virtual ~EasyUnlockService(); | 156 ~EasyUnlockService() override; |
| 157 | 157 |
| 158 // Does a service type specific initialization. | 158 // Does a service type specific initialization. |
| 159 virtual void InitializeInternal() = 0; | 159 virtual void InitializeInternal() = 0; |
| 160 | 160 |
| 161 // Does a service type specific shutdown. Called from |Shutdown|. | 161 // Does a service type specific shutdown. Called from |Shutdown|. |
| 162 virtual void ShutdownInternal() = 0; | 162 virtual void ShutdownInternal() = 0; |
| 163 | 163 |
| 164 // Service type specific tests for whether the service is allowed. Returns | 164 // Service type specific tests for whether the service is allowed. Returns |
| 165 // false if service is not allowed. If true is returned, the service may still | 165 // false if service is not allowed. If true is returned, the service may still |
| 166 // not be allowed if common tests fail (e.g. if Bluetooth is not available). | 166 // not be allowed if common tests fail (e.g. if Bluetooth is not available). |
| 167 virtual bool IsAllowedInternal() = 0; | 167 virtual bool IsAllowedInternal() = 0; |
| 168 | 168 |
| 169 // KeyedService override: | 169 // KeyedService override: |
| 170 virtual void Shutdown() override; | 170 void Shutdown() override; |
| 171 | 171 |
| 172 // Exposes the profile to which the service is attached to subclasses. | 172 // Exposes the profile to which the service is attached to subclasses. |
| 173 Profile* profile() const { return profile_; } | 173 Profile* profile() const { return profile_; } |
| 174 | 174 |
| 175 // Installs the Easy unlock component app if it isn't installed and enables | 175 // Installs the Easy unlock component app if it isn't installed and enables |
| 176 // the app if it is disabled. | 176 // the app if it is disabled. |
| 177 void LoadApp(); | 177 void LoadApp(); |
| 178 | 178 |
| 179 // Disables the Easy unlock component app if it's loaded. | 179 // Disables the Easy unlock component app if it's loaded. |
| 180 void DisableAppIfLoaded(); | 180 void DisableAppIfLoaded(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 bool shut_down_; | 256 bool shut_down_; |
| 257 | 257 |
| 258 ObserverList<EasyUnlockServiceObserver> observers_; | 258 ObserverList<EasyUnlockServiceObserver> observers_; |
| 259 | 259 |
| 260 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; | 260 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
| 261 | 261 |
| 262 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); | 262 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |
| 263 }; | 263 }; |
| 264 | 264 |
| 265 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 265 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
| OLD | NEW |