| 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::DeviceControlSignalsPtr GetControlSignals() const OVERRIDE; |
| 24 api::serial::DeviceControlSignals* control_signals) const OVERRIDE; | |
| 25 virtual bool SetControlSignals( | 24 virtual bool SetControlSignals( |
| 26 const api::serial::HostControlSignals& control_signals) OVERRIDE; | 25 const device::HostControlSignals& control_signals) OVERRIDE; |
| 27 virtual bool ConfigurePort( | 26 virtual bool ConfigurePort(const device::ConnectionOptions& options) OVERRIDE; |
| 28 const api::serial::ConnectionOptions& options) OVERRIDE; | 27 virtual device::ConnectionInfoPtr GetPortInfo() const OVERRIDE; |
| 29 virtual bool GetPortInfo(api::serial::ConnectionInfo* info) const OVERRIDE; | |
| 30 virtual bool PostOpen() OVERRIDE; | 28 virtual bool PostOpen() OVERRIDE; |
| 31 | 29 |
| 32 private: | 30 private: |
| 33 friend class SerialIoHandler; | 31 friend class SerialIoHandler; |
| 34 | 32 |
| 35 SerialIoHandlerWin(); | 33 SerialIoHandlerWin(); |
| 36 virtual ~SerialIoHandlerWin(); | 34 virtual ~SerialIoHandlerWin(); |
| 37 | 35 |
| 38 // base::MessageLoopForIO::IOHandler implementation. | 36 // base::MessageLoopForIO::IOHandler implementation. |
| 39 virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context, | 37 virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 57 // after a corresponding WaitCommEvent has completed. | 55 // after a corresponding WaitCommEvent has completed. |
| 58 bool is_comm_pending_; | 56 bool is_comm_pending_; |
| 59 | 57 |
| 60 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerWin); | 58 DISALLOW_COPY_AND_ASSIGN(SerialIoHandlerWin); |
| 61 }; | 59 }; |
| 62 | 60 |
| 63 } // namespace extensions | 61 } // namespace extensions |
| 64 | 62 |
| 65 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_IO_HANDLER_WIN_H_ | 63 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_IO_HANDLER_WIN_H_ |
| 66 | 64 |
| OLD | NEW |