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

Unified Diff: chrome/browser/extensions/api/native_message/native_message_api.h

Issue 10818013: Native Messaging! (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
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_

Powered by Google App Engine
This is Rietveld 408576698