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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_private_api.cc

Issue 2801403002: MD Settings: Bluetooth: Fix adapter state and discovery (Closed)
Patch Set: Use CHECK instead of early exit Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/bluetooth/bluetooth_private_api.cc
diff --git a/extensions/browser/api/bluetooth/bluetooth_private_api.cc b/extensions/browser/api/bluetooth/bluetooth_private_api.cc
index 41b3f3b0b0541c1408bb08d928ac2d9c72fc7e46..fc32507ed620a2b06c389fd1803553123ab26104 100644
--- a/extensions/browser/api/bluetooth/bluetooth_private_api.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_private_api.cc
@@ -12,6 +12,7 @@
#include "base/lazy_instance.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
+#include "components/device_event_log/device_event_log.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/bluetooth_common.h"
@@ -162,18 +163,21 @@ bool BluetoothPrivateSetAdapterStateFunction::DoWork(
bool* discoverable = new_state.discoverable.get();
if (name && adapter->GetName() != *name) {
+ BLUETOOTH_LOG(USER) << "SetAdapterState: name=" << *name;
pending_properties_.insert(kNameProperty);
adapter->SetName(*name, CreatePropertySetCallback(kNameProperty),
CreatePropertyErrorCallback(kNameProperty));
}
if (powered && adapter->IsPowered() != *powered) {
+ BLUETOOTH_LOG(USER) << "SetAdapterState: powerd=" << *powered;
pending_properties_.insert(kPoweredProperty);
adapter->SetPowered(*powered, CreatePropertySetCallback(kPoweredProperty),
CreatePropertyErrorCallback(kPoweredProperty));
}
if (discoverable && adapter->IsDiscoverable() != *discoverable) {
+ BLUETOOTH_LOG(USER) << "SetAdapterState: discoverable=" << *discoverable;
pending_properties_.insert(kDiscoverableProperty);
adapter->SetDiscoverable(
*discoverable, CreatePropertySetCallback(kDiscoverableProperty),
@@ -190,6 +194,7 @@ bool BluetoothPrivateSetAdapterStateFunction::DoWork(
base::Closure
BluetoothPrivateSetAdapterStateFunction::CreatePropertySetCallback(
const std::string& property_name) {
+ BLUETOOTH_LOG(DEBUG) << "Set property succeeded: " << property_name;
return base::Bind(
&BluetoothPrivateSetAdapterStateFunction::OnAdapterPropertySet, this,
property_name);
@@ -198,6 +203,7 @@ BluetoothPrivateSetAdapterStateFunction::CreatePropertySetCallback(
base::Closure
BluetoothPrivateSetAdapterStateFunction::CreatePropertyErrorCallback(
const std::string& property_name) {
+ BLUETOOTH_LOG(DEBUG) << "Set property failed: " << property_name;
return base::Bind(
&BluetoothPrivateSetAdapterStateFunction::OnAdapterPropertyError, this,
property_name);
« no previous file with comments | « extensions/browser/api/bluetooth/bluetooth_event_router_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698