OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_api.h" | 5 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_event_router.h" | 10 #include "chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energ
y_event_router.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 namespace api { | 73 namespace api { |
74 | 74 |
75 BluetoothLowEnergyExtensionFunction::BluetoothLowEnergyExtensionFunction() { | 75 BluetoothLowEnergyExtensionFunction::BluetoothLowEnergyExtensionFunction() { |
76 } | 76 } |
77 | 77 |
78 BluetoothLowEnergyExtensionFunction::~BluetoothLowEnergyExtensionFunction() { | 78 BluetoothLowEnergyExtensionFunction::~BluetoothLowEnergyExtensionFunction() { |
79 } | 79 } |
80 | 80 |
81 bool BluetoothLowEnergyExtensionFunction::RunImpl() { | 81 bool BluetoothLowEnergyExtensionFunction::RunAsync() { |
82 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 82 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
83 | 83 |
84 BluetoothLowEnergyEventRouter* event_router = | 84 BluetoothLowEnergyEventRouter* event_router = |
85 GetEventRouter(browser_context()); | 85 GetEventRouter(browser_context()); |
86 if (!event_router->IsBluetoothSupported()) { | 86 if (!event_router->IsBluetoothSupported()) { |
87 SetError(kErrorPlatformNotSupported); | 87 SetError(kErrorPlatformNotSupported); |
88 return false; | 88 return false; |
89 } | 89 } |
90 | 90 |
91 // It is safe to pass |this| here as ExtensionFunction is refcounted. | 91 // It is safe to pass |this| here as ExtensionFunction is refcounted. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 bool BluetoothLowEnergyWriteDescriptorValueFunction::DoWork() { | 253 bool BluetoothLowEnergyWriteDescriptorValueFunction::DoWork() { |
254 // TODO(armansito): Implement. | 254 // TODO(armansito): Implement. |
255 SetError("Call not supported."); | 255 SetError("Call not supported."); |
256 SendResponse(false); | 256 SendResponse(false); |
257 return false; | 257 return false; |
258 } | 258 } |
259 | 259 |
260 } // namespace api | 260 } // namespace api |
261 } // namespace extensions | 261 } // namespace extensions |
OLD | NEW |