OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_IO_HANDLER_WIN_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_IO_HANDLER_WIN_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_IO_HANDLER_WIN_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_IO_HANDLER_WIN_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/extensions/api/serial/serial_io_handler.h" | 10 #include "chrome/browser/extensions/api/serial/serial_io_handler.h" |
11 | 11 |
12 namespace extensions { | 12 namespace extensions { |
13 | 13 |
14 class SerialIoHandlerWin : public SerialIoHandler, | 14 class SerialIoHandlerWin : public SerialIoHandler, |
15 public base::MessageLoopForIO::IOHandler { | 15 public base::MessageLoopForIO::IOHandler { |
16 protected: | 16 protected: |
17 // SerialIoHandler implementation. | 17 // SerialIoHandler implementation. |
18 virtual void ReadImpl() OVERRIDE; | 18 virtual void ReadImpl() OVERRIDE; |
19 virtual void WriteImpl() OVERRIDE; | 19 virtual void WriteImpl() OVERRIDE; |
20 virtual void CancelReadImpl() OVERRIDE; | 20 virtual void CancelReadImpl() OVERRIDE; |
21 virtual void CancelWriteImpl() OVERRIDE; | 21 virtual void CancelWriteImpl() OVERRIDE; |
22 virtual bool Flush() const OVERRIDE; | 22 virtual bool Flush() const OVERRIDE; |
23 virtual bool GetControlSignals( | 23 virtual device::serial::DeviceControlSignalsPtr GetControlSignals() |
24 api::serial::DeviceControlSignals* control_signals) const OVERRIDE; | 24 const OVERRIDE; |
25 virtual bool SetControlSignals( | 25 virtual bool SetControlSignals( |
26 const api::serial::HostControlSignals& control_signals) OVERRIDE; | 26 const device::serial::HostControlSignals& control_signals) OVERRIDE; |
27 virtual bool ConfigurePort( | 27 virtual bool ConfigurePort( |
28 const api::serial::ConnectionOptions& options) OVERRIDE; | 28 const device::serial::ConnectionOptions& options) OVERRIDE; |
29 virtual bool GetPortInfo(api::serial::ConnectionInfo* info) const OVERRIDE; | 29 virtual device::serial::ConnectionInfoPtr GetPortInfo() const OVERRIDE; |
30 virtual bool PostOpen() OVERRIDE; | 30 virtual bool PostOpen() OVERRIDE; |
31 | 31 |
32 private: | 32 private: |
33 friend class SerialIoHandler; | 33 friend class SerialIoHandler; |
34 | 34 |
35 SerialIoHandlerWin(); | 35 SerialIoHandlerWin(); |
36 virtual ~SerialIoHandlerWin(); | 36 virtual ~SerialIoHandlerWin(); |
37 | 37 |
38 // base::MessageLoopForIO::IOHandler implementation. | 38 // base::MessageLoopForIO::IOHandler implementation. |
39 virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context, | 39 virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context, |
(...skipping 17 matching lines...) Expand all Loading... |
57 // after a corresponding WaitCommEvent has completed. | 57 // after a corresponding WaitCommEvent has completed. |
58 bool is_comm_pending_; | 58 bool is_comm_pending_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerWin); | 60 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerWin); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace extensions | 63 } // namespace extensions |
64 | 64 |
65 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_IO_HANDLER_WIN_H_ | 65 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_IO_HANDLER_WIN_H_ |
66 | 66 |
OLD | NEW |