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 #include "chrome/renderer/extensions/extension_helper.h" | 5 #include "chrome/renderer/extensions/extension_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // gets called for navigations within the document. | 248 // gets called for navigations within the document. |
249 if (g_schedulers.Get().count(frame)) | 249 if (g_schedulers.Get().count(frame)) |
250 return; | 250 return; |
251 | 251 |
252 g_schedulers.Get()[frame] = new UserScriptScheduler(frame, dispatcher_); | 252 g_schedulers.Get()[frame] = new UserScriptScheduler(frame, dispatcher_); |
253 } | 253 } |
254 | 254 |
255 void ExtensionHelper::OnExtensionResponse(int request_id, | 255 void ExtensionHelper::OnExtensionResponse(int request_id, |
256 bool success, | 256 bool success, |
257 const base::ListValue& response, | 257 const base::ListValue& response, |
258 const std::string& error) { | 258 const std::string& error, |
| 259 bool user_gesture) { |
259 dispatcher_->OnExtensionResponse(request_id, | 260 dispatcher_->OnExtensionResponse(request_id, |
260 success, | 261 success, |
261 response, | 262 response, |
262 error); | 263 error, |
| 264 user_gesture); |
263 } | 265 } |
264 | 266 |
265 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id, | 267 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id, |
266 const std::string& module_name, | 268 const std::string& module_name, |
267 const std::string& function_name, | 269 const std::string& function_name, |
268 const base::ListValue& args, | 270 const base::ListValue& args, |
269 bool user_gesture) { | 271 bool user_gesture) { |
270 dispatcher_->InvokeModuleSystemMethod( | 272 dispatcher_->InvokeModuleSystemMethod( |
271 render_view(), extension_id, module_name, function_name, args, | 273 render_view(), extension_id, module_name, function_name, args, |
272 user_gesture); | 274 user_gesture); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); | 374 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); |
373 ChromeV8Context* chrome_v8_context = | 375 ChromeV8Context* chrome_v8_context = |
374 dispatcher_->v8_context_set().GetByV8Context(script_context); | 376 dispatcher_->v8_context_set().GetByV8Context(script_context); |
375 if (!chrome_v8_context) | 377 if (!chrome_v8_context) |
376 return; | 378 return; |
377 chrome_v8_context->module_system()->CallModuleMethod( | 379 chrome_v8_context->module_system()->CallModuleMethod( |
378 "app.window", "onAppWindowClosed"); | 380 "app.window", "onAppWindowClosed"); |
379 } | 381 } |
380 | 382 |
381 } // namespace extensions | 383 } // namespace extensions |
OLD | NEW |