| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 bool BluetoothLowEnergyWriteDescriptorValueFunction::DoWork() { | 226 bool BluetoothLowEnergyWriteDescriptorValueFunction::DoWork() { |
| 227 // TODO(armansito): Implement. | 227 // TODO(armansito): Implement. |
| 228 SetError("Call not supported."); | 228 SetError("Call not supported."); |
| 229 SendResponse(false); | 229 SendResponse(false); |
| 230 return false; | 230 return false; |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace api | 233 } // namespace api |
| 234 } // namespace extensions | 234 } // namespace extensions |
| OLD | NEW |