Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: chrome/renderer/extensions/extension_helper.cc

Issue 227413008: Add the feature to retain the user gesture in the extension callback (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 bool user_gesture) {
257 dispatcher_->OnExtensionResponse(request_id, 258 dispatcher_->OnExtensionResponse(request_id,
258 success, 259 success,
259 response, 260 response,
260 error); 261 error,
262 user_gesture);
261 } 263 }
262 264
263 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id, 265 void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id,
264 const std::string& module_name, 266 const std::string& module_name,
265 const std::string& function_name, 267 const std::string& function_name,
266 const base::ListValue& args, 268 const base::ListValue& args,
267 bool user_gesture) { 269 bool user_gesture) {
268 dispatcher_->InvokeModuleSystemMethod( 270 dispatcher_->InvokeModuleSystemMethod(
269 render_view(), extension_id, module_name, function_name, args, 271 render_view(), extension_id, module_name, function_name, args,
270 user_gesture); 272 user_gesture);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); 372 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext();
371 ChromeV8Context* chrome_v8_context = 373 ChromeV8Context* chrome_v8_context =
372 dispatcher_->v8_context_set().GetByV8Context(script_context); 374 dispatcher_->v8_context_set().GetByV8Context(script_context);
373 if (!chrome_v8_context) 375 if (!chrome_v8_context)
374 return; 376 return;
375 chrome_v8_context->module_system()->CallModuleMethod( 377 chrome_v8_context->module_system()->CallModuleMethod(
376 "app.window", "onAppWindowClosed"); 378 "app.window", "onAppWindowClosed");
377 } 379 }
378 380
379 } // namespace extensions 381 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698