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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 void DispatchSimpleBrowserEvent(Profile* profile, | 124 void DispatchSimpleBrowserEvent(Profile* profile, |
125 const int window_id, | 125 const int window_id, |
126 const char* event_name); | 126 const char* event_name); |
127 | 127 |
128 // Packages |changed_properties| as a tab updated event for the tab |contents| | 128 // Packages |changed_properties| as a tab updated event for the tab |contents| |
129 // and dispatches the event to the extension. | 129 // and dispatches the event to the extension. |
130 void DispatchTabUpdatedEvent(content::WebContents* contents, | 130 void DispatchTabUpdatedEvent(content::WebContents* contents, |
131 scoped_ptr<DictionaryValue> changed_properties); | 131 scoped_ptr<DictionaryValue> changed_properties); |
132 | 132 |
| 133 void DispatchTabDetached(content::WebContents* contents, int index); |
| 134 |
| 135 // Send Tab removed event and stop listening for notifications on said |
| 136 // |contents|. |
| 137 void DispatchTabRemovedAndUnregisterNotifications( |
| 138 content::WebContents* contents, |
| 139 int tab_id, |
| 140 bool window_closing); |
| 141 |
133 // Called to dispatch a deprecated style page action click event that was | 142 // Called to dispatch a deprecated style page action click event that was |
134 // registered like: | 143 // registered like: |
135 // chrome.pageActions["name"].addListener(function(actionId, info){}) | 144 // chrome.pageActions["name"].addListener(function(actionId, info){}) |
136 void DispatchOldPageActionEvent(Profile* profile, | 145 void DispatchOldPageActionEvent(Profile* profile, |
137 const std::string& extension_id, | 146 const std::string& extension_id, |
138 const std::string& page_action_id, | 147 const std::string& page_action_id, |
139 int tab_id, | 148 int tab_id, |
140 const std::string& url, | 149 const std::string& url, |
141 int button); | 150 int button); |
142 | 151 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 211 |
203 // The main profile that owns this event router. | 212 // The main profile that owns this event router. |
204 Profile* profile_; | 213 Profile* profile_; |
205 | 214 |
206 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); | 215 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); |
207 }; | 216 }; |
208 | 217 |
209 } // namespace extensions | 218 } // namespace extensions |
210 | 219 |
211 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 220 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
OLD | NEW |