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_NATIVE_MESSAGE_NATIVE_MESSAGE_API_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_API_NATIVE_MESSAGE_NATIVE_MESSAGE_API_H_ | |
7 | |
8 #include "chrome/browser/extensions/extension_function.h" | |
9 | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/memory/weak_ptr.h" | |
12 | |
13 class NativeThreadDelegate; | |
14 | |
15 namespace base { | |
16 class DelegateSimpleThread; | |
17 class DictionaryValue; | |
18 } // namespace base | |
19 | |
20 class SendNativeMessageFunction : public AsyncExtensionFunction { | |
Matt Perry
2012/07/23 23:47:03
put this in the extensions namespace
| |
21 public: | |
22 SendNativeMessageFunction(); | |
23 void SendResponseOnUIThread(bool success, scoped_ptr<std::string> error, | |
24 scoped_ptr<DictionaryValue> result); | |
25 | |
26 protected: | |
27 virtual bool RunImpl() OVERRIDE; | |
28 | |
29 private: | |
30 virtual ~SendNativeMessageFunction(); | |
31 void JoinThreadOnBackgroundThread(); | |
32 | |
33 scoped_ptr<base::DelegateSimpleThread> thread_; | |
34 scoped_ptr<NativeThreadDelegate> thread_delegate_; | |
35 | |
36 DECLARE_EXTENSION_FUNCTION_NAME("extension.sendNativeMessage") | |
37 }; | |
38 | |
39 #endif // CHROME_BROWSER_EXTENSIONS_API_NATIVE_MESSAGE_NATIVE_MESSAGE_API_H_ | |
OLD | NEW |