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_EXTENSION_EVENT_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 // Ensures that all lazy background pages that are interested in the given | 207 // Ensures that all lazy background pages that are interested in the given |
208 // event are loaded, and queues the event if the page is not ready yet. | 208 // event are loaded, and queues the event if the page is not ready yet. |
209 void DispatchLazyEvent(const std::string& extension_id, | 209 void DispatchLazyEvent(const std::string& extension_id, |
210 const linked_ptr<ExtensionEvent>& event); | 210 const linked_ptr<ExtensionEvent>& event); |
211 | 211 |
212 // Dispatches the event to the specified extension running in |process|. | 212 // Dispatches the event to the specified extension running in |process|. |
213 void DispatchEventToProcess(const std::string& extension_id, | 213 void DispatchEventToProcess(const std::string& extension_id, |
214 content::RenderProcessHost* process, | 214 content::RenderProcessHost* process, |
215 const linked_ptr<ExtensionEvent>& event); | 215 const linked_ptr<ExtensionEvent>& event); |
216 | 216 |
217 // Dispatch "onSuspendCanceled" to a particular extension. | |
218 void DispatchOnSuspendCanceled( | |
219 content::RenderProcessHost* process, const std::string& extension_id); | |
220 | |
221 // Returns true if the given extension is in the process of unloading. More | |
222 // specifically, this will return true in the phase where the onSuspend event | |
223 // has been fired, but before the extension's background page has been | |
224 // unloaded. During this period other events that arrive for the extension | |
225 // cause the unload process to be canceled and an onSuspendCanceled event to | |
226 // be sent. | |
227 bool IsClosing(Profile* profile, const extensions::Extension* extension); | |
benwells
2012/07/19 04:01:21
Could we rename this to MightBeClosing, MaybeClosi
koz (OOO until 15th September)
2012/07/19 06:52:11
Hm, I don't think IsClosing() is such a bad name.
| |
228 | |
217 // Returns false when the event is scoped to a profile and the listening | 229 // Returns false when the event is scoped to a profile and the listening |
218 // extension does not have access to events from that profile. Also fills | 230 // extension does not have access to events from that profile. Also fills |
219 // |event_args| with the proper arguments to send, which may differ if | 231 // |event_args| with the proper arguments to send, which may differ if |
220 // the event crosses the incognito boundary. | 232 // the event crosses the incognito boundary. |
221 bool CanDispatchEventToProfile( | 233 bool CanDispatchEventToProfile( |
222 Profile* profile, | 234 Profile* profile, |
223 const extensions::Extension* extension, | 235 const extensions::Extension* extension, |
224 const linked_ptr<ExtensionEvent>& event, | 236 const linked_ptr<ExtensionEvent>& event, |
225 const base::Value** event_args); | 237 const base::Value** event_args); |
226 | 238 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 const GURL& event_url, | 298 const GURL& event_url, |
287 Profile* restrict_to_profile, | 299 Profile* restrict_to_profile, |
288 ExtensionEventRouter::UserGestureState user_gesture, | 300 ExtensionEventRouter::UserGestureState user_gesture, |
289 const extensions::EventFilteringInfo& info); | 301 const extensions::EventFilteringInfo& info); |
290 | 302 |
291 ~ExtensionEvent(); | 303 ~ExtensionEvent(); |
292 }; | 304 }; |
293 | 305 |
294 | 306 |
295 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ | 307 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_EVENT_ROUTER_H_ |
OLD | NEW |