Chromium Code Reviews| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 const content::NotificationSource& source, | 90 const content::NotificationSource& source, |
| 91 const content::NotificationDetails& details) OVERRIDE; | 91 const content::NotificationDetails& details) OVERRIDE; |
| 92 private: | 92 private: |
| 93 // "Synthetic" event. Called from TabInsertedAt if new tab is detected. | 93 // "Synthetic" event. Called from TabInsertedAt if new tab is detected. |
| 94 void TabCreatedAt(content::WebContents* contents, int index, bool active); | 94 void TabCreatedAt(content::WebContents* contents, int index, bool active); |
| 95 | 95 |
| 96 // Internal processing of tab updated events. Is called by both TabChangedAt | 96 // Internal processing of tab updated events. Is called by both TabChangedAt |
| 97 // and Observe/NAV_ENTRY_COMMITTED. | 97 // and Observe/NAV_ENTRY_COMMITTED. |
| 98 void TabUpdated(content::WebContents* contents, bool did_navigate); | 98 void TabUpdated(content::WebContents* contents, bool did_navigate); |
| 99 | 99 |
| 100 // Triggers a tab updated event if the favicon URL changes. | |
| 101 void FaviconUrlUpdated(content::WebContents* contents, | |
| 102 bool* icon_url_changed); | |
|
pkotwicz
2013/03/13 17:44:49
Nit: const bool*
Timo Reimann
2013/03/13 19:42:13
Done. Also added const qualifier at call site for
| |
| 103 | |
| 100 // The DispatchEvent methods forward events to the |profile|'s event router. | 104 // The DispatchEvent methods forward events to the |profile|'s event router. |
| 101 // The BrowserEventRouter listens to events for all profiles, | 105 // The BrowserEventRouter listens to events for all profiles, |
| 102 // so we avoid duplication by dropping events destined for other profiles. | 106 // so we avoid duplication by dropping events destined for other profiles. |
| 103 void DispatchEvent(Profile* profile, | 107 void DispatchEvent(Profile* profile, |
| 104 const char* event_name, | 108 const char* event_name, |
| 105 scoped_ptr<base::ListValue> args, | 109 scoped_ptr<base::ListValue> args, |
| 106 EventRouter::UserGestureState user_gesture); | 110 EventRouter::UserGestureState user_gesture); |
| 107 | 111 |
| 108 void DispatchEventToExtension(Profile* profile, | 112 void DispatchEventToExtension(Profile* profile, |
| 109 const std::string& extension_id, | 113 const std::string& extension_id, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 | 202 |
| 199 // The main profile that owns this event router. | 203 // The main profile that owns this event router. |
| 200 Profile* profile_; | 204 Profile* profile_; |
| 201 | 205 |
| 202 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); | 206 DISALLOW_COPY_AND_ASSIGN(BrowserEventRouter); |
| 203 }; | 207 }; |
| 204 | 208 |
| 205 } // namespace extensions | 209 } // namespace extensions |
| 206 | 210 |
| 207 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ | 211 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_EVENT_ROUTER_H_ |
| OLD | NEW |