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 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_API_SOCKET_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_API_SOCKET_H_ |
6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_API_SOCKET_H_ | 6 #define EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_API_SOCKET_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "device/bluetooth/bluetooth_device.h" | 10 #include "device/bluetooth/bluetooth_device.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Accepts a client connection from the socket and calls |success_callback| | 82 // Accepts a client connection from the socket and calls |success_callback| |
83 // when one has connected. If an error occurs, calls |error_callback| with a | 83 // when one has connected. If an error occurs, calls |error_callback| with a |
84 // reason and a message. | 84 // reason and a message. |
85 virtual void Accept(const AcceptCompletionCallback& success_callback, | 85 virtual void Accept(const AcceptCompletionCallback& success_callback, |
86 const ErrorCompletionCallback& error_callback); | 86 const ErrorCompletionCallback& error_callback); |
87 | 87 |
88 const std::string& device_address() const { return device_address_; } | 88 const std::string& device_address() const { return device_address_; } |
89 const device::BluetoothUUID& uuid() const { return uuid_; } | 89 const device::BluetoothUUID& uuid() const { return uuid_; } |
90 | 90 |
91 // Overriden from extensions::ApiResource. | 91 // Overriden from extensions::ApiResource. |
92 virtual bool IsPersistent() const OVERRIDE; | 92 virtual bool IsPersistent() const override; |
93 | 93 |
94 const std::string* name() const { return name_.get(); } | 94 const std::string* name() const { return name_.get(); } |
95 void set_name(const std::string& name) { name_.reset(new std::string(name)); } | 95 void set_name(const std::string& name) { name_.reset(new std::string(name)); } |
96 | 96 |
97 bool persistent() const { return persistent_; } | 97 bool persistent() const { return persistent_; } |
98 void set_persistent(bool persistent) { persistent_ = persistent; } | 98 void set_persistent(bool persistent) { persistent_ = persistent; } |
99 | 99 |
100 int buffer_size() const { return buffer_size_; } | 100 int buffer_size() const { return buffer_size_; } |
101 void set_buffer_size(int buffer_size) { buffer_size_ = buffer_size; } | 101 void set_buffer_size(int buffer_size) { buffer_size_ = buffer_size; } |
102 | 102 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 // Flag indicating whether a socket is connected. | 153 // Flag indicating whether a socket is connected. |
154 bool connected_; | 154 bool connected_; |
155 | 155 |
156 DISALLOW_COPY_AND_ASSIGN(BluetoothApiSocket); | 156 DISALLOW_COPY_AND_ASSIGN(BluetoothApiSocket); |
157 }; | 157 }; |
158 | 158 |
159 } // namespace extensions | 159 } // namespace extensions |
160 | 160 |
161 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_API_SOCKET_H_ | 161 #endif // EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_API_SOCKET_H_ |
OLD | NEW |