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 DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_ | 5 #ifndef DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_ |
6 #define DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_ | 6 #define DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "device/serial/serial.mojom.h" | 10 #include "device/serial/serial.mojom.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 scoped_refptr<base::MessageLoopProxy> io_message_loop, | 29 scoped_refptr<base::MessageLoopProxy> io_message_loop, |
30 mojo::InterfaceRequest<serial::SerialService> request); | 30 mojo::InterfaceRequest<serial::SerialService> request); |
31 | 31 |
32 // mojo::InterfaceImpl<SerialService> overrides. | 32 // mojo::InterfaceImpl<SerialService> overrides. |
33 virtual void GetDevices(const mojo::Callback< | 33 virtual void GetDevices(const mojo::Callback< |
34 void(mojo::Array<serial::DeviceInfoPtr>)>& callback) OVERRIDE; | 34 void(mojo::Array<serial::DeviceInfoPtr>)>& callback) OVERRIDE; |
35 virtual void Connect( | 35 virtual void Connect( |
36 const mojo::String& path, | 36 const mojo::String& path, |
37 serial::ConnectionOptionsPtr options, | 37 serial::ConnectionOptionsPtr options, |
38 mojo::InterfaceRequest<serial::Connection> connection_request) OVERRIDE; | 38 mojo::InterfaceRequest<serial::Connection> connection_request) OVERRIDE; |
39 virtual void OnConnectionError() OVERRIDE; | |
40 | 39 |
41 private: | 40 private: |
42 SerialDeviceEnumerator* GetDeviceEnumerator(); | 41 SerialDeviceEnumerator* GetDeviceEnumerator(); |
43 bool IsValidPath(const mojo::String& path); | 42 bool IsValidPath(const mojo::String& path); |
44 void OnConnected( | 43 void OnConnected( |
45 const mojo::Callback<void(serial::ConnectionInfoPtr)>& callback, | 44 const mojo::Callback<void(serial::ConnectionInfoPtr)>& callback, |
46 serial::ConnectionInfoPtr result); | 45 serial::ConnectionInfoPtr result); |
47 | 46 |
48 scoped_ptr<SerialDeviceEnumerator> device_enumerator_; | 47 scoped_ptr<SerialDeviceEnumerator> device_enumerator_; |
49 scoped_refptr<SerialConnectionFactory> connection_factory_; | 48 scoped_refptr<SerialConnectionFactory> connection_factory_; |
50 | 49 |
51 DISALLOW_COPY_AND_ASSIGN(SerialServiceImpl); | 50 DISALLOW_COPY_AND_ASSIGN(SerialServiceImpl); |
52 }; | 51 }; |
53 | 52 |
54 } // namespace device | 53 } // namespace device |
55 | 54 |
56 #endif // DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_ | 55 #endif // DEVICE_SERIAL_SERIAL_SERVICE_IMPL_H_ |
OLD | NEW |