OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_BLUETOOTH_POLICY_HANDLER_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_BLUETOOTH_POLICY_HANDLER_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/memory/ref_counted.h" | |
bartfab (slow)
2016/04/18 13:43:44
Nit: Not used.
Ivan Šandrk
2016/04/18 15:09:18
Done.
| |
12 #include "base/memory/weak_ptr.h" | |
13 #include "chrome/browser/chromeos/settings/cros_settings.h" | |
14 #include "device/bluetooth/bluetooth_adapter.h" | |
bartfab (slow)
2016/04/18 13:43:44
Nit: Not used.
Ivan Šandrk
2016/04/18 15:09:18
Done.
| |
15 | |
16 namespace chromeos { | |
17 // This class observes the device setting |DeviceAllowBluetooth|, and calls | |
bartfab (slow)
2016/04/18 13:43:44
Nit: Add blank line above.
Ivan Šandrk
2016/04/18 15:09:18
Done.
| |
18 // BluetoothAdapter::SetDisabled() appropriately based on the value of that | |
19 // setting. | |
20 class BluetoothPolicyHandler { | |
21 public: | |
22 explicit BluetoothPolicyHandler(CrosSettings* cros_settings); | |
23 ~BluetoothPolicyHandler(); | |
24 | |
25 private: | |
26 // Once a trusted set of policies is established, this function calls | |
27 // |SetDisabled| with the trusted state of the |DeviceAllowBluetooth| policy | |
28 // through helper function |SetBluetoothPolicy|. | |
29 void OnBluetoothPolicyChanged(); | |
30 | |
31 CrosSettings* cros_settings_; | |
32 std::unique_ptr<CrosSettings::ObserverSubscription> | |
33 bluetooth_policy_subscription_; | |
34 // scoped_refptr<device::BluetoothAdapter> adapter_; | |
bartfab (slow)
2016/04/18 13:43:44
Nit: Remove this dead code.
Ivan Šandrk
2016/04/18 15:09:18
Done.
| |
35 base::WeakPtrFactory<BluetoothPolicyHandler> weak_factory_; | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(BluetoothPolicyHandler); | |
38 }; | |
39 | |
40 } // namespace chromeos | |
41 | |
42 #endif // CHROME_BROWSER_CHROMEOS_POLICY_BLUETOOTH_POLICY_HANDLER_H_ | |
OLD | NEW |