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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: a Created 4 years, 2 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
OLDNEW
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/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 kEventDispatchFunction, &args)); 635 kEventDispatchFunction, &args));
636 } 636 }
637 637
638 void Dispatcher::InvokeModuleSystemMethod(content::RenderFrame* render_frame, 638 void Dispatcher::InvokeModuleSystemMethod(content::RenderFrame* render_frame,
639 const std::string& extension_id, 639 const std::string& extension_id,
640 const std::string& module_name, 640 const std::string& module_name,
641 const std::string& function_name, 641 const std::string& function_name,
642 const base::ListValue& args, 642 const base::ListValue& args,
643 bool user_gesture) { 643 bool user_gesture) {
644 std::unique_ptr<WebScopedUserGesture> web_user_gesture; 644 std::unique_ptr<WebScopedUserGesture> web_user_gesture;
645 if (user_gesture) 645 if (user_gesture) {
646 web_user_gesture.reset(new WebScopedUserGesture); 646 blink::WebLocalFrame* web_frame =
647 render_frame ? render_frame->GetWebFrame() : nullptr;
648 web_user_gesture.reset(new WebScopedUserGesture(web_frame));
649 }
647 650
648 script_context_set_->ForEach( 651 script_context_set_->ForEach(
649 extension_id, render_frame, 652 extension_id, render_frame,
650 base::Bind(&CallModuleMethod, module_name, function_name, &args)); 653 base::Bind(&CallModuleMethod, module_name, function_name, &args));
651 654
652 // Reset the idle handler each time there's any activity like event or message 655 // Reset the idle handler each time there's any activity like event or message
653 // dispatch, for which Invoke is the chokepoint. 656 // dispatch, for which Invoke is the chokepoint.
654 if (set_idle_notifications_) { 657 if (set_idle_notifications_) {
655 RenderThread::Get()->ScheduleIdleHandler( 658 RenderThread::Get()->ScheduleIdleHandler(
656 kInitialExtensionIdleHandlerDelayMs); 659 kInitialExtensionIdleHandlerDelayMs);
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 // The "guestViewDeny" module must always be loaded last. It registers 1654 // The "guestViewDeny" module must always be loaded last. It registers
1652 // error-providing custom elements for the GuestView types that are not 1655 // error-providing custom elements for the GuestView types that are not
1653 // available, and thus all of those types must have been checked and loaded 1656 // available, and thus all of those types must have been checked and loaded
1654 // (or not loaded) beforehand. 1657 // (or not loaded) beforehand.
1655 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1658 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1656 module_system->Require("guestViewDeny"); 1659 module_system->Require("guestViewDeny");
1657 } 1660 }
1658 } 1661 }
1659 1662
1660 } // namespace extensions 1663 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698