Chromium Code Reviews| 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; | |
|
Ilya Sherman
2014/08/14 07:29:41
Do we really need to implement this code here, or
xiyuan
2014/08/14 20:27:44
The Bluetooth settings logic is baked into its web
| |
| 42 | |
| 39 void Initialize(); | 43 void Initialize(); |
| 40 void LoadApp(); | 44 void LoadApp(); |
| 41 void UnloadApp(); | 45 void UnloadApp(); |
| 46 void CheckIsAllowed(); | |
| 42 void OnPrefsChanged(); | 47 void OnPrefsChanged(); |
| 48 void OnBluetoothAdapterPresentChanged(); | |
|
Ilya Sherman
2014/08/14 07:29:42
nit: Please document at least the new methods.
xiyuan
2014/08/14 20:27:44
Done.
| |
| 43 | 49 |
| 44 Profile* profile_; | 50 Profile* profile_; |
| 45 PrefChangeRegistrar registrar_; | 51 PrefChangeRegistrar registrar_; |
| 52 scoped_ptr<BluetoothDetector> bluetooth_detector_; | |
|
Ilya Sherman
2014/08/14 07:29:42
Hmm, is this a scoped_ptr just so that you can kee
xiyuan
2014/08/14 20:27:44
Yep. I prefer to put as little as possible details
| |
| 46 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; | 53 base::WeakPtrFactory<EasyUnlockService> weak_ptr_factory_; |
| 47 | 54 |
| 48 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); | 55 DISALLOW_COPY_AND_ASSIGN(EasyUnlockService); |
| 49 }; | 56 }; |
| 50 | 57 |
| 51 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ | 58 #endif // CHROME_BROWSER_SIGNIN_EASY_UNLOCK_SERVICE_H_ |
| OLD | NEW |