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

Side by Side Diff: device/bluetooth/bluetooth_adapter_bluez.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: code fix 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 // BluetoothAdapter: 80 // BluetoothAdapter:
81 void Shutdown() override; 81 void Shutdown() override;
82 std::string GetAddress() const override; 82 std::string GetAddress() const override;
83 std::string GetName() const override; 83 std::string GetName() const override;
84 void SetName(const std::string& name, 84 void SetName(const std::string& name,
85 const base::Closure& callback, 85 const base::Closure& callback,
86 const ErrorCallback& error_callback) override; 86 const ErrorCallback& error_callback) override;
87 bool IsInitialized() const override; 87 bool IsInitialized() const override;
88 bool IsPresent() const override; 88 bool IsPresent() const override;
89 void SetDisabled(bool disabled) override;
89 bool IsPowered() const override; 90 bool IsPowered() const override;
90 void SetPowered(bool powered, 91 void SetPowered(bool powered,
91 const base::Closure& callback, 92 const base::Closure& callback,
92 const ErrorCallback& error_callback) override; 93 const ErrorCallback& error_callback) override;
93 bool IsDiscoverable() const override; 94 bool IsDiscoverable() const override;
94 void SetDiscoverable(bool discoverable, 95 void SetDiscoverable(bool discoverable,
95 const base::Closure& callback, 96 const base::Closure& callback,
96 const ErrorCallback& error_callback) override; 97 const ErrorCallback& error_callback) override;
97 bool IsDiscovering() const override; 98 bool IsDiscovering() const override;
98 void CreateRfcommService( 99 void CreateRfcommService(
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 // ended (with either success or failure). 340 // ended (with either success or failure).
340 void ProcessQueuedDiscoveryRequests(); 341 void ProcessQueuedDiscoveryRequests();
341 342
342 InitCallback init_callback_; 343 InitCallback init_callback_;
343 344
344 bool initialized_; 345 bool initialized_;
345 346
346 // Set in |Shutdown()|, makes IsPresent()| return false. 347 // Set in |Shutdown()|, makes IsPresent()| return false.
347 bool dbus_is_shutdown_; 348 bool dbus_is_shutdown_;
348 349
350 // Set in |SetDisabled()|, makes |IsPresent()| return false
351 // (just disables the interface, doesn't actually shut it down).
352 bool is_disabled_;
ortuno 2016/04/13 21:12:21 I don't think this is the right place to store thi
Ivan Šandrk 2016/04/14 18:08:48 In my code, I call SetDisabled through device::Blu
scheib 2016/04/14 21:41:10 You'll need to hold a reference to keep it disable
Ivan Šandrk 2016/04/15 17:32:06 Done.
353
349 // Number of discovery sessions that have been added. 354 // Number of discovery sessions that have been added.
350 int num_discovery_sessions_; 355 int num_discovery_sessions_;
351 356
352 // True, if there is a pending request to start or stop discovery. 357 // True, if there is a pending request to start or stop discovery.
353 bool discovery_request_pending_; 358 bool discovery_request_pending_;
354 359
355 // List of queued requests to add new discovery sessions. While there is a 360 // List of queued requests to add new discovery sessions. While there is a
356 // pending request to BlueZ to start or stop discovery, many requests from 361 // pending request to BlueZ to start or stop discovery, many requests from
357 // within Chrome to start or stop discovery sessions may occur. We only 362 // within Chrome to start or stop discovery sessions may occur. We only
358 // queue requests to add new sessions to be processed later. All requests to 363 // queue requests to add new sessions to be processed later. All requests to
(...skipping 27 matching lines...) Expand all
386 // Note: This should remain the last member so it'll be destroyed and 391 // Note: This should remain the last member so it'll be destroyed and
387 // invalidate its weak pointers before any other members are destroyed. 392 // invalidate its weak pointers before any other members are destroyed.
388 base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_; 393 base::WeakPtrFactory<BluetoothAdapterBlueZ> weak_ptr_factory_;
389 394
390 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterBlueZ); 395 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterBlueZ);
391 }; 396 };
392 397
393 } // namespace bluez 398 } // namespace bluez
394 399
395 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_ 400 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_BLUEZ_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698