Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Unified Diff: chrome/browser/extensions/api/serial/serial_api.h

Issue 9174019: Add skeleton plumbing for serial API. No functionality yet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/serial/serial_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/serial/serial_api.h
diff --git a/chrome/browser/extensions/api/serial/serial_api.h b/chrome/browser/extensions/api/serial/serial_api.h
new file mode 100644
index 0000000000000000000000000000000000000000..df4c3e0256f9f7f90c5803f8cc984745d17605d8
--- /dev/null
+++ b/chrome/browser/extensions/api/serial/serial_api.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_
+#define CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_
+#pragma once
+
+#include <string>
+
+#include "chrome/browser/extensions/extension_function.h"
+
+namespace extensions {
+
+extern const char kConnectionIdKey[];
+
+class SerialOpenFunction : public AsyncExtensionFunction {
+ public:
+ SerialOpenFunction();
+ virtual ~SerialOpenFunction();
+
+ virtual bool RunImpl() OVERRIDE;
+
+ protected:
+ void WorkOnIOThread();
+ void RespondOnUIThread();
+
+ private:
+ std::string port_;
+
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.serial.open")
+};
+
+class SerialCloseFunction : public AsyncExtensionFunction {
+ public:
+ SerialCloseFunction();
+ virtual ~SerialCloseFunction();
+
+ virtual bool RunImpl() OVERRIDE;
+
+ protected:
+ void WorkOnIOThread();
+ void RespondOnUIThread();
+
+ private:
+ int connection_id_;
+
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.serial.close")
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_SERIAL_SERIAL_API_H_
« no previous file with comments | « no previous file | chrome/browser/extensions/api/serial/serial_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698