| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // gets called for navigations within the document. | 246 // gets called for navigations within the document. |
| 247 if (g_schedulers.Get().count(frame)) | 247 if (g_schedulers.Get().count(frame)) |
| 248 return; | 248 return; |
| 249 | 249 |
| 250 g_schedulers.Get()[frame] = new UserScriptScheduler(frame, dispatcher_); | 250 g_schedulers.Get()[frame] = new UserScriptScheduler(frame, dispatcher_); |
| 251 } | 251 } |
| 252 | 252 |
| 253 void ExtensionHelper::OnExtensionResponse(int request_id, | 253 void ExtensionHelper::OnExtensionResponse(int request_id, |
| 254 bool success, | 254 bool success, |
| 255 const base::ListValue& response, | 255 const base::ListValue& response, |
| 256 const std::string& error) { | 256 const std::string& error, |
| 257 const bool response_user_gesture) { |
| 258 scoped_ptr<WebScopedUserGesture> user_gesture; |
| 259 if (response_user_gesture) |
| 260 user_gesture.reset(new WebScopedUserGesture); |
| 261 |
| 257 dispatcher_->OnExtensionResponse(request_id, | 262 dispatcher_->OnExtensionResponse(request_id, |
| 258 success, | 263 success, |
| 259 response, | 264 response, |
| 260 error); | 265 error); |
| 261 } | 266 } |
| 262 | 267 |
| 263 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id, | 268 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id, |
| 264 const std::string& module_name, | 269 const std::string& module_name, |
| 265 const std::string& function_name, | 270 const std::string& function_name, |
| 266 const base::ListValue& args, | 271 const base::ListValue& args, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); | 375 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); |
| 371 ChromeV8Context* chrome_v8_context = | 376 ChromeV8Context* chrome_v8_context = |
| 372 dispatcher_->v8_context_set().GetByV8Context(script_context); | 377 dispatcher_->v8_context_set().GetByV8Context(script_context); |
| 373 if (!chrome_v8_context) | 378 if (!chrome_v8_context) |
| 374 return; | 379 return; |
| 375 chrome_v8_context->module_system()->CallModuleMethod( | 380 chrome_v8_context->module_system()->CallModuleMethod( |
| 376 "app.window", "onAppWindowClosed"); | 381 "app.window", "onAppWindowClosed"); |
| 377 } | 382 } |
| 378 | 383 |
| 379 } // namespace extensions | 384 } // namespace extensions |
| OLD | NEW |