Index: chrome/browser/extensions/extension_event_router.h |
diff --git a/chrome/browser/extensions/extension_event_router.h b/chrome/browser/extensions/extension_event_router.h |
index daef5543e4f0e983d392206dcb0f9b3693fb7249..3b777fd87ce56acb956c2a1706ae6ea33bb66618 100644 |
--- a/chrome/browser/extensions/extension_event_router.h |
+++ b/chrome/browser/extensions/extension_event_router.h |
@@ -28,13 +28,22 @@ class RenderProcessHost; |
class ExtensionEventRouter : public content::NotificationObserver { |
public: |
+ // These constants convey the state of our knowledge of whether we're in |
+ // a user-caused gesture as part of DispatchEvent. |
+ enum UserGesture { |
Aaron Boodman
2012/02/29 01:20:37
Naming suggestion: UserGestureState?
Greg Billock
2012/02/29 17:58:08
Done.
|
+ kUnknownUserGesture = 0, |
Aaron Boodman
2012/02/29 01:20:37
according to the style guide (http://www.chromium.
Greg Billock
2012/02/29 17:58:08
I'd read this: "Though the style guide says to use
|
+ kIsUserGesture = 1, |
+ kIsNotUserGesture = 2, |
+ }; |
+ |
// Sends an event via ipc_sender to the given extension. Can be called on |
// any thread. |
static void DispatchEvent(IPC::Message::Sender* ipc_sender, |
const std::string& extension_id, |
const std::string& event_name, |
const std::string& event_args, |
- const GURL& event_url); |
+ const GURL& event_url, |
+ UserGesture user_gesture); |
explicit ExtensionEventRouter(Profile* profile); |
virtual ~ExtensionEventRouter(); |
@@ -86,6 +95,16 @@ class ExtensionEventRouter : public content::NotificationObserver { |
Profile* restrict_to_profile, |
const GURL& event_url); |
+ // Dispatch an event to particular extension. Also include an |
+ // explicit user gesture indicator. |
+ virtual void DispatchEventToExtension( |
+ const std::string& extension_id, |
+ const std::string& event_name, |
+ const std::string& event_args, |
+ Profile* restrict_to_profile, |
+ const GURL& event_url, |
+ UserGesture user_gesture); |
+ |
// Send different versions of an event to extensions in different profiles. |
// This is used in the case of sending one event to extensions that have |
// incognito access, and another event to extensions that don't (here), |