| 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 #ifndef CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 const char* event_name, | 115 const char* event_name, |
| 116 scoped_ptr<base::ListValue> event_args, | 116 scoped_ptr<base::ListValue> event_args, |
| 117 EventRouter::UserGestureState user_gesture); | 117 EventRouter::UserGestureState user_gesture); |
| 118 | 118 |
| 119 void DispatchEventsAcrossIncognito( | 119 void DispatchEventsAcrossIncognito( |
| 120 Profile* profile, | 120 Profile* profile, |
| 121 const char* event_name, | 121 const char* event_name, |
| 122 scoped_ptr<base::ListValue> event_args, | 122 scoped_ptr<base::ListValue> event_args, |
| 123 scoped_ptr<base::ListValue> cross_incognito_args); | 123 scoped_ptr<base::ListValue> cross_incognito_args); |
| 124 | 124 |
| 125 void DispatchEventWithTab(Profile* profile, | |
| 126 const std::string& extension_id, | |
| 127 const char* event_name, | |
| 128 const content::WebContents* web_contents, | |
| 129 bool active, | |
| 130 EventRouter::UserGestureState user_gesture, | |
| 131 scoped_ptr<ListValue> event_args); | |
| 132 | |
| 133 // DispatchEvent with a tab value appended as the last argument. | |
| 134 void DispatchEventWithTab(Profile* profile, | |
| 135 const std::string& extension_id, | |
| 136 const char* event_name, | |
| 137 const content::WebContents* web_contents, | |
| 138 bool active, | |
| 139 EventRouter::UserGestureState user_gesture) { | |
| 140 DispatchEventWithTab(profile, extension_id, event_name, web_contents, | |
| 141 active, user_gesture, | |
| 142 scoped_ptr<ListValue>(new ListValue).Pass()); | |
| 143 } | |
| 144 | |
| 145 void DispatchSimpleBrowserEvent(Profile* profile, | 125 void DispatchSimpleBrowserEvent(Profile* profile, |
| 146 const int window_id, | 126 const int window_id, |
| 147 const char* event_name); | 127 const char* event_name); |
| 148 | 128 |
| 149 // Packages |changed_properties| as a tab updated event for the tab |contents| | 129 // Packages |changed_properties| as a tab updated event for the tab |contents| |
| 150 // and dispatches the event to the extension. | 130 // and dispatches the event to the extension. |
| 151 void DispatchTabUpdatedEvent(content::WebContents* contents, | 131 void DispatchTabUpdatedEvent(content::WebContents* contents, |
| 152 DictionaryValue* changed_properties); | 132 DictionaryValue* changed_properties); |
| 153 | 133 |
| 154 // Called to dispatch a deprecated style page action click event that was | 134 // Called to dispatch a deprecated style page action click event that was |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 205 |
| 226 // The main profile that owns this event router. | 206 // The main profile that owns this event router. |
| 227 Profile* profile_; | 207 Profile* profile_; |
| 228 | 208 |
| 229 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); | 209 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); |
| 230 }; | 210 }; |
| 231 | 211 |
| 232 } // namespace extensions | 212 } // namespace extensions |
| 233 | 213 |
| 234 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 214 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| OLD | NEW |