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

Side by Side Diff: chrome/browser/extensions/event_router.cc

Issue 10821120: Send user gesture to extensions for page and browser action clicks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/browser/extensions/event_router.h" 5 #include "chrome/browser/extensions/event_router.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 } 293 }
294 294
295 void EventRouter::DispatchEventToRenderers(const std::string& event_name, 295 void EventRouter::DispatchEventToRenderers(const std::string& event_name,
296 const std::string& event_args, 296 const std::string& event_args,
297 Profile* restrict_to_profile, 297 Profile* restrict_to_profile,
298 const GURL& event_url) { 298 const GURL& event_url) {
299 DispatchEventToRenderers(event_name, event_args, restrict_to_profile, 299 DispatchEventToRenderers(event_name, event_args, restrict_to_profile,
300 event_url, EventFilteringInfo()); 300 event_url, EventFilteringInfo());
301 } 301 }
302 302
303 void EventRouter::DispatchEventToRenderers(const std::string& event_name,
304 const std::string& event_args,
305 Profile* restrict_to_profile,
306 const GURL& event_url,
307 UserGestureState user_gesture) {
308 DCHECK(!event_args.empty());
309 StringValue event_args_value(event_args);
310 EventFilteringInfo info;
311 linked_ptr<Event> event(new Event(event_name, event_args_value,
312 event_url, restrict_to_profile,
313 user_gesture, info));
314 DispatchEventImpl("", event);
315 }
316
303 void EventRouter::DispatchEventToExtension(const std::string& extension_id, 317 void EventRouter::DispatchEventToExtension(const std::string& extension_id,
304 const std::string& event_name, 318 const std::string& event_name,
305 const Value& event_args, 319 const Value& event_args,
306 Profile* restrict_to_profile, 320 Profile* restrict_to_profile,
307 const GURL& event_url) { 321 const GURL& event_url) {
308 DCHECK(!extension_id.empty()); 322 DCHECK(!extension_id.empty());
309 linked_ptr<Event> event(new Event(event_name, event_args, event_url, 323 linked_ptr<Event> event(new Event(event_name, event_args, event_url,
310 restrict_to_profile, USER_GESTURE_UNKNOWN, 324 restrict_to_profile, USER_GESTURE_UNKNOWN,
311 EventFilteringInfo())); 325 EventFilteringInfo()));
312 DispatchEventImpl(extension_id, event); 326 DispatchEventImpl(extension_id, event);
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 restrict_to_profile(restrict_to_profile), 624 restrict_to_profile(restrict_to_profile),
611 cross_incognito_args(NULL), 625 cross_incognito_args(NULL),
612 user_gesture(user_gesture), 626 user_gesture(user_gesture),
613 info(info) { 627 info(info) {
614 } 628 }
615 629
616 Event::~Event() { 630 Event::~Event() {
617 } 631 }
618 632
619 } // namespace extensions 633 } // namespace extensions
OLDNEW
« chrome/browser/extensions/browser_event_router.cc ('K') | « chrome/browser/extensions/event_router.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698