Chromium Code Reviews| Index: chrome/browser/chromeos/policy/bluetooth_policy_handler.h |
| diff --git a/chrome/browser/chromeos/policy/bluetooth_policy_handler.h b/chrome/browser/chromeos/policy/bluetooth_policy_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..478e8677644f71e13c789560a3bf0e925155bf85 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/policy/bluetooth_policy_handler.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_POLICY_BLUETOOTH_POLICY_HANDLER_H_ |
| +#define CHROME_BROWSER_CHROMEOS_POLICY_BLUETOOTH_POLICY_HANDLER_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#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.
|
| +#include "base/memory/weak_ptr.h" |
| +#include "chrome/browser/chromeos/settings/cros_settings.h" |
| +#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.
|
| + |
| +namespace chromeos { |
| +// 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.
|
| +// BluetoothAdapter::SetDisabled() appropriately based on the value of that |
| +// setting. |
| +class BluetoothPolicyHandler { |
| + public: |
| + explicit BluetoothPolicyHandler(CrosSettings* cros_settings); |
| + ~BluetoothPolicyHandler(); |
| + |
| + private: |
| + // Once a trusted set of policies is established, this function calls |
| + // |SetDisabled| with the trusted state of the |DeviceAllowBluetooth| policy |
| + // through helper function |SetBluetoothPolicy|. |
| + void OnBluetoothPolicyChanged(); |
| + |
| + CrosSettings* cros_settings_; |
| + std::unique_ptr<CrosSettings::ObserverSubscription> |
| + bluetooth_policy_subscription_; |
| + // 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.
|
| + base::WeakPtrFactory<BluetoothPolicyHandler> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BluetoothPolicyHandler); |
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_POLICY_BLUETOOTH_POLICY_HANDLER_H_ |