Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: chrome/browser/chromeos/policy/bluetooth_policy_handler.h

Issue 1784333002: Add Device Policy Handler for Bluetooth, and allow disabling the Bluetooth adapter on Chrome OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bartfab's nits Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/weak_ptr.h"
12 #include "chrome/browser/chromeos/settings/cros_settings.h"
13
14 namespace policy {
15
16 // This class observes the device setting |DeviceAllowBluetooth|, and calls
17 // BluetoothAdapter::SetDisabled() appropriately based on the value of that
18 // setting.
19 class BluetoothPolicyHandler {
20 public:
21 explicit BluetoothPolicyHandler(chromeos::CrosSettings* cros_settings);
22 ~BluetoothPolicyHandler();
23
24 private:
25 // Once a trusted set of policies is established, this function calls
26 // |SetDisabled| with the trusted state of the |DeviceAllowBluetooth| policy
27 // through helper function |SetBluetoothPolicy|.
28 void OnBluetoothPolicyChanged();
29
30 chromeos::CrosSettings* cros_settings_;
31 std::unique_ptr<chromeos::CrosSettings::ObserverSubscription>
32 bluetooth_policy_subscription_;
33 base::WeakPtrFactory<BluetoothPolicyHandler> weak_factory_;
34
35 DISALLOW_COPY_AND_ASSIGN(BluetoothPolicyHandler);
36 };
37
38 } // namespace policy
39
40 #endif // CHROME_BROWSER_CHROMEOS_POLICY_BLUETOOTH_POLICY_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698