OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "chrome/browser/extensions/extension_function.h" |
| 12 |
| 13 namespace extensions { |
| 14 |
| 15 extern const char kConnectionIdKey[]; |
| 16 |
| 17 class SerialOpenFunction : public AsyncExtensionFunction { |
| 18 public: |
| 19 SerialOpenFunction(); |
| 20 virtual ~SerialOpenFunction(); |
| 21 |
| 22 virtual bool RunImpl() OVERRIDE; |
| 23 |
| 24 protected: |
| 25 void WorkOnIOThread(); |
| 26 void RespondOnUIThread(); |
| 27 |
| 28 private: |
| 29 std::string port_; |
| 30 |
| 31 DECLARE_EXTENSION_FUNCTION_NAME("experimental.serial.open") |
| 32 }; |
| 33 |
| 34 class SerialCloseFunction : public AsyncExtensionFunction { |
| 35 public: |
| 36 SerialCloseFunction(); |
| 37 virtual ~SerialCloseFunction(); |
| 38 |
| 39 virtual bool RunImpl() OVERRIDE; |
| 40 |
| 41 protected: |
| 42 void WorkOnIOThread(); |
| 43 void RespondOnUIThread(); |
| 44 |
| 45 private: |
| 46 int connection_id_; |
| 47 |
| 48 DECLARE_EXTENSION_FUNCTION_NAME("experimental.serial.close") |
| 49 }; |
| 50 |
| 51 } // namespace extensions |
| 52 |
| 53 #endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_ |
OLD | NEW |