| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 10 #include "base/prefs/pref_change_registrar.h" | 11 #include "base/prefs/pref_change_registrar.h" |
| 11 #include "components/keyed_service/core/keyed_service.h" | 12 #include "components/keyed_service/core/keyed_service.h" |
| 12 | 13 |
| 13 namespace user_prefs { | 14 namespace user_prefs { |
| 14 class PrefRegistrySyncable; | 15 class PrefRegistrySyncable; |
| 15 } | 16 } |
| 16 | 17 |
| 17 class Profile; | 18 class Profile; |
| 18 | 19 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 29 | 30 |
| 30 // Launches Easy Unlock Setup app. | 31 // Launches Easy Unlock Setup app. |
| 31 void LaunchSetup(); | 32 void LaunchSetup(); |
| 32 | 33 |
| 33 // Whether easy unlock is allowed to be used. If the controlling preference | 34 // Whether easy unlock is allowed to be used. If the controlling preference |
| 34 // is set (from policy), this returns the preference value. Otherwise, it is | 35 // is set (from policy), this returns the preference value. Otherwise, it is |
| 35 // permitted either the flag is enabled or its field trial is enabled. | 36 // permitted either the flag is enabled or its field trial is enabled. |
| 36 bool IsAllowed(); | 37 bool IsAllowed(); |
| 37 | 38 |
| 38 private: | 39 private: |
| 40 // A class to detect whether a bluetooth adapter is present. |
| 41 class BluetoothDetector; |
| 42 |
| 43 // Initializes the service after ExtensionService is ready. |
| 39 void Initialize(); | 44 void Initialize(); |
| 45 |
| 46 // Loads the Easy unlock component app. |
| 40 void LoadApp(); | 47 void LoadApp(); |
| 48 |
| 49 // Unloads the Easy unlock component app. |
| 41 void UnloadApp(); | 50 void UnloadApp(); |
| 51 |
| 52 // Checks whether Easy unlock should be running and updates app state. |
| 53 void UpdateAppState(); |
| 54 |
| 55 // Callback when the controlling pref changes. |
| 42 void OnPrefsChanged(); | 56 void OnPrefsChanged(); |
| 43 | 57 |
| 58 // Callback when Bluetooth adapter present state changes. |
| 59 void OnBluetoothAdapterPresentChanged(); |
| 60 |
| 44 Profile* profile_; | 61 Profile* profile_; |
| 45 PrefChangeRegistrar registrar_; | 62 PrefChangeRegistrar registrar_; |
| 63 scoped_ptr<BluetoothDetector> bluetooth_detector_; |
| 46 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; | 64 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
| 47 | 65 |
| 48 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); | 66 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |
| 49 }; | 67 }; |
| 50 | 68 |
| 51 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 69 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
| OLD | NEW |