Index: chrome/browser/extensions/api/native_message/native_message_api.h |
diff --git a/chrome/browser/extensions/api/native_message/native_message_api.h b/chrome/browser/extensions/api/native_message/native_message_api.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7251d6cbe46e61f3d27a10b2d5db96d0841eeca4 |
--- /dev/null |
+++ b/chrome/browser/extensions/api/native_message/native_message_api.h |
@@ -0,0 +1,39 @@ |
+// 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_NATIVE_MESSAGE_NATIVE_MESSAGE_API_H_ |
+#define CHROME_BROWSER_EXTENSIONS_API_NATIVE_MESSAGE_NATIVE_MESSAGE_API_H_ |
+ |
+#include "chrome/browser/extensions/extension_function.h" |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "base/memory/weak_ptr.h" |
+ |
+class NativeThreadDelegate; |
+ |
+namespace base { |
+class DelegateSimpleThread; |
+class DictionaryValue; |
+} // namespace base |
+ |
+class SendNativeMessageFunction : public AsyncExtensionFunction { |
Matt Perry
2012/07/23 23:47:03
put this in the extensions namespace
|
+ public: |
+ SendNativeMessageFunction(); |
+ void SendResponseOnUIThread(bool success, scoped_ptr<std::string> error, |
+ scoped_ptr<DictionaryValue> result); |
+ |
+ protected: |
+ virtual bool RunImpl() OVERRIDE; |
+ |
+ private: |
+ virtual ~SendNativeMessageFunction(); |
+ void JoinThreadOnBackgroundThread(); |
+ |
+ scoped_ptr<base::DelegateSimpleThread> thread_; |
+ scoped_ptr<NativeThreadDelegate> thread_delegate_; |
+ |
+ DECLARE_EXTENSION_FUNCTION_NAME("extension.sendNativeMessage") |
+}; |
+ |
+#endif // CHROME_BROWSER_EXTENSIONS_API_NATIVE_MESSAGE_NATIVE_MESSAGE_API_H_ |