OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
13 #include "base/timer.h" | 13 #include "base/timer.h" |
14 #include "content/public/renderer/render_process_observer.h" | 14 #include "content/public/renderer/render_process_observer.h" |
15 #include "chrome/common/extensions/extension_set.h" | 15 #include "chrome/common/extensions/extension_set.h" |
16 #include "chrome/common/extensions/features/feature.h" | 16 #include "chrome/common/extensions/features/feature.h" |
17 #include "chrome/renderer/extensions/chrome_v8_context.h" | 17 #include "chrome/renderer/extensions/chrome_v8_context.h" |
18 #include "chrome/renderer/extensions/chrome_v8_context_set.h" | 18 #include "chrome/renderer/extensions/chrome_v8_context_set.h" |
19 #include "chrome/renderer/extensions/v8_schema_registry.h" | 19 #include "chrome/renderer/extensions/v8_schema_registry.h" |
20 #include "chrome/renderer/resource_bundle_source_map.h" | 20 #include "chrome/renderer/resource_bundle_source_map.h" |
21 #include "extensions/common/event_filter.h" | 21 #include "extensions/common/event_filter.h" |
22 #include "v8/include/v8.h" | 22 #include "v8/include/v8.h" |
23 | 23 |
24 class GURL; | 24 class GURL; |
25 class ModuleSystem; | 25 class ModuleSystem; |
26 class URLPattern; | 26 class URLPattern; |
| 27 struct ExtensionMsg_ExternalConnectionInfo; |
27 struct ExtensionMsg_Loaded_Params; | 28 struct ExtensionMsg_Loaded_Params; |
28 | 29 |
29 namespace WebKit { | 30 namespace WebKit { |
30 class WebFrame; | 31 class WebFrame; |
31 } | 32 } |
32 | 33 |
33 namespace base { | 34 namespace base { |
| 35 class DictionaryValue; |
34 class ListValue; | 36 class ListValue; |
35 } | 37 } |
36 | 38 |
37 namespace content { | 39 namespace content { |
38 class RenderThread; | 40 class RenderThread; |
39 } | 41 } |
40 | 42 |
41 namespace extensions { | 43 namespace extensions { |
42 class ContentWatcher; | 44 class ContentWatcher; |
43 class Extension; | 45 class Extension; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 virtual void IdleNotification() OVERRIDE; | 140 virtual void IdleNotification() OVERRIDE; |
139 | 141 |
140 void OnSetChannel(int channel); | 142 void OnSetChannel(int channel); |
141 void OnMessageInvoke(const std::string& extension_id, | 143 void OnMessageInvoke(const std::string& extension_id, |
142 const std::string& function_name, | 144 const std::string& function_name, |
143 const base::ListValue& args, | 145 const base::ListValue& args, |
144 const GURL& event_url, | 146 const GURL& event_url, |
145 bool user_gesture); | 147 bool user_gesture); |
146 void OnDispatchOnConnect(int target_port_id, | 148 void OnDispatchOnConnect(int target_port_id, |
147 const std::string& channel_name, | 149 const std::string& channel_name, |
148 const std::string& tab_json, | 150 const base::DictionaryValue& source_tab, |
149 const std::string& source_extension_id, | 151 const ExtensionMsg_ExternalConnectionInfo& info); |
150 const std::string& target_extension_id); | |
151 void OnDeliverMessage(int target_port_id, const std::string& message); | 152 void OnDeliverMessage(int target_port_id, const std::string& message); |
152 void OnDispatchOnDisconnect(int port_id, const std::string& error_message); | 153 void OnDispatchOnDisconnect(int port_id, const std::string& error_message); |
153 void OnSetFunctionNames(const std::vector<std::string>& names); | 154 void OnSetFunctionNames(const std::vector<std::string>& names); |
154 void OnLoaded( | 155 void OnLoaded( |
155 const std::vector<ExtensionMsg_Loaded_Params>& loaded_extensions); | 156 const std::vector<ExtensionMsg_Loaded_Params>& loaded_extensions); |
156 void OnUnloaded(const std::string& id); | 157 void OnUnloaded(const std::string& id); |
157 void OnSetScriptingWhitelist( | 158 void OnSetScriptingWhitelist( |
158 const Extension::ScriptingWhitelist& extension_ids); | 159 const Extension::ScriptingWhitelist& extension_ids); |
159 void OnPageActionsUpdated(const std::string& extension_id, | 160 void OnPageActionsUpdated(const std::string& extension_id, |
160 const std::vector<std::string>& page_actions); | 161 const std::vector<std::string>& page_actions); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 269 |
269 // Sends API requests to the extension host. | 270 // Sends API requests to the extension host. |
270 scoped_ptr<RequestSender> request_sender_; | 271 scoped_ptr<RequestSender> request_sender_; |
271 | 272 |
272 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 273 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
273 }; | 274 }; |
274 | 275 |
275 } // namespace extensions | 276 } // namespace extensions |
276 | 277 |
277 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 278 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
OLD | NEW |