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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 125 void DispatchEventWithTab(Profile* profile, |
126 const std::string& extension_id, | 126 const std::string& extension_id, |
127 const char* event_name, | 127 const char* event_name, |
128 const content::WebContents* web_contents, | 128 const content::WebContents* web_contents, |
129 bool active, | 129 bool active, |
130 EventRouter::UserGestureState user_gesture); | 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 } |
131 | 144 |
132 void DispatchSimpleBrowserEvent(Profile* profile, | 145 void DispatchSimpleBrowserEvent(Profile* profile, |
133 const int window_id, | 146 const int window_id, |
134 const char* event_name); | 147 const char* event_name); |
135 | 148 |
136 // Packages |changed_properties| as a tab updated event for the tab |contents| | 149 // Packages |changed_properties| as a tab updated event for the tab |contents| |
137 // and dispatches the event to the extension. | 150 // and dispatches the event to the extension. |
138 void DispatchTabUpdatedEvent(content::WebContents* contents, | 151 void DispatchTabUpdatedEvent(content::WebContents* contents, |
139 DictionaryValue* changed_properties); | 152 DictionaryValue* changed_properties); |
140 | 153 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 225 |
213 // The main profile that owns this event router. | 226 // The main profile that owns this event router. |
214 Profile* profile_; | 227 Profile* profile_; |
215 | 228 |
216 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); | 229 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); |
217 }; | 230 }; |
218 | 231 |
219 } // namespace extensions | 232 } // namespace extensions |
220 | 233 |
221 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 234 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
OLD | NEW |