| 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 "extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h" | 5 #include "extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 198 bluetooth_socket::SocketProperties* properties = | 198 bluetooth_socket::SocketProperties* properties = |
| 199 params_.get()->properties.get(); | 199 params_.get()->properties.get(); |
| 200 if (properties) { | 200 if (properties) { |
| 201 SetSocketProperties(socket, properties); | 201 SetSocketProperties(socket, properties); |
| 202 } | 202 } |
| 203 | 203 |
| 204 bluetooth_socket::CreateInfo create_info; | 204 bluetooth_socket::CreateInfo create_info; |
| 205 create_info.socket_id = AddSocket(socket); | 205 create_info.socket_id = AddSocket(socket); |
| 206 results_ = bluetooth_socket::Create::Results::Create(create_info); | 206 results_ = bluetooth_socket::Create::Results::Create(create_info); |
| 207 AsyncWorkCompleted(); | 207 // AsyncWorkCompleted is called by AsyncWorkStart(). |
| 208 } | 208 } |
| 209 | 209 |
| 210 BluetoothSocketUpdateFunction::BluetoothSocketUpdateFunction() {} | 210 BluetoothSocketUpdateFunction::BluetoothSocketUpdateFunction() {} |
| 211 | 211 |
| 212 BluetoothSocketUpdateFunction::~BluetoothSocketUpdateFunction() {} | 212 BluetoothSocketUpdateFunction::~BluetoothSocketUpdateFunction() {} |
| 213 | 213 |
| 214 bool BluetoothSocketUpdateFunction::Prepare() { | 214 bool BluetoothSocketUpdateFunction::Prepare() { |
| 215 params_ = bluetooth_socket::Update::Params::Create(*args_); | 215 params_ = bluetooth_socket::Update::Params::Create(*args_); |
| 216 EXTENSION_FUNCTION_VALIDATE(params_.get()); | 216 EXTENSION_FUNCTION_VALIDATE(params_.get()); |
| 217 return true; | 217 return true; |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 if (socket) { | 663 if (socket) { |
| 664 socket_infos.push_back(CreateSocketInfo(socket_id, socket)); | 664 socket_infos.push_back(CreateSocketInfo(socket_id, socket)); |
| 665 } | 665 } |
| 666 } | 666 } |
| 667 } | 667 } |
| 668 results_ = bluetooth_socket::GetSockets::Results::Create(socket_infos); | 668 results_ = bluetooth_socket::GetSockets::Results::Create(socket_infos); |
| 669 } | 669 } |
| 670 | 670 |
| 671 } // namespace api | 671 } // namespace api |
| 672 } // namespace extensions | 672 } // namespace extensions |
| OLD | NEW |