OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "extensions/renderer/extension_helper.h" | 5 #include "extensions/renderer/extension_helper.h" |
6 | 6 |
7 #include "content/public/renderer/render_view.h" | 7 #include "content/public/renderer/render_view.h" |
8 #include "content/public/renderer/render_view_visitor.h" | 8 #include "content/public/renderer/render_view_visitor.h" |
9 #include "extensions/common/api/messaging/message.h" | 9 #include "extensions/common/api/messaging/message.h" |
10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 const base::ListValue& args, | 196 const base::ListValue& args, |
197 bool user_gesture) { | 197 bool user_gesture) { |
198 dispatcher_->InvokeModuleSystemMethod( | 198 dispatcher_->InvokeModuleSystemMethod( |
199 render_view(), extension_id, module_name, function_name, args, | 199 render_view(), extension_id, module_name, function_name, args, |
200 user_gesture); | 200 user_gesture); |
201 } | 201 } |
202 | 202 |
203 void ExtensionHelper::OnExtensionDispatchOnConnect( | 203 void ExtensionHelper::OnExtensionDispatchOnConnect( |
204 int target_port_id, | 204 int target_port_id, |
205 const std::string& channel_name, | 205 const std::string& channel_name, |
206 const base::DictionaryValue& source_tab, | 206 const ExtensionMsg_TabConnectionInfo& source, |
207 const ExtensionMsg_ExternalConnectionInfo& info, | 207 const ExtensionMsg_ExternalConnectionInfo& info, |
208 const std::string& tls_channel_id) { | 208 const std::string& tls_channel_id) { |
209 MessagingBindings::DispatchOnConnect(dispatcher_->script_context_set(), | 209 MessagingBindings::DispatchOnConnect(dispatcher_->script_context_set(), |
210 target_port_id, | 210 target_port_id, |
211 channel_name, | 211 channel_name, |
212 source_tab, | 212 source, |
213 info, | 213 info, |
214 tls_channel_id, | 214 tls_channel_id, |
215 render_view()); | 215 render_view()); |
216 } | 216 } |
217 | 217 |
218 void ExtensionHelper::OnExtensionDeliverMessage(int target_id, | 218 void ExtensionHelper::OnExtensionDeliverMessage(int target_id, |
219 const Message& message) { | 219 const Message& message) { |
220 MessagingBindings::DeliverMessage( | 220 MessagingBindings::DeliverMessage( |
221 dispatcher_->script_context_set(), target_id, message, render_view()); | 221 dispatcher_->script_context_set(), target_id, message, render_view()); |
222 } | 222 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); | 259 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); |
260 ScriptContext* script_context = | 260 ScriptContext* script_context = |
261 dispatcher_->script_context_set().GetByV8Context(v8_context); | 261 dispatcher_->script_context_set().GetByV8Context(v8_context); |
262 if (!script_context) | 262 if (!script_context) |
263 return; | 263 return; |
264 script_context->module_system()->CallModuleMethod("app.window", | 264 script_context->module_system()->CallModuleMethod("app.window", |
265 "onAppWindowClosed"); | 265 "onAppWindowClosed"); |
266 } | 266 } |
267 | 267 |
268 } // namespace extensions | 268 } // namespace extensions |
OLD | NEW |