| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_BROWSER_EVENT_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 bool user_gesture); | 38 bool user_gesture); |
| 39 void TabMoved(TabContents* contents, int from_index, int to_index); | 39 void TabMoved(TabContents* contents, int from_index, int to_index); |
| 40 void TabChangedAt(TabContents* contents, int index, bool loading_only); | 40 void TabChangedAt(TabContents* contents, int index, bool loading_only); |
| 41 void TabStripEmpty(); | 41 void TabStripEmpty(); |
| 42 | 42 |
| 43 // NotificationObserver | 43 // NotificationObserver |
| 44 void Observe(NotificationType type, | 44 void Observe(NotificationType type, |
| 45 const NotificationSource& source, | 45 const NotificationSource& source, |
| 46 const NotificationDetails& details); | 46 const NotificationDetails& details); |
| 47 private: | 47 private: |
| 48 // Construct and dispatch windows.onCreated event. |
| 49 void BrowserOpened(Browser* browser); |
| 50 // Construct and dispatch windows.onRemoved event. |
| 51 void BrowserClosed(Browser* browser); |
| 48 ExtensionBrowserEventRouter(); | 52 ExtensionBrowserEventRouter(); |
| 49 friend struct DefaultSingletonTraits<ExtensionBrowserEventRouter>; | 53 friend struct DefaultSingletonTraits<ExtensionBrowserEventRouter>; |
| 50 | 54 |
| 51 bool initialized_; | 55 bool initialized_; |
| 52 | 56 |
| 53 // Maintain set of known tab ids, so we can distinguish between tab creation | 57 // Maintain set of known tab ids, so we can distinguish between tab creation |
| 54 // and tab insertion. Also used to not send tab-detached after tab-removed. | 58 // and tab insertion. Also used to not send tab-detached after tab-removed. |
| 55 std::set<int> tab_ids_; | 59 std::set<int> tab_ids_; |
| 56 | 60 |
| 57 DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserEventRouter); | 61 DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserEventRouter); |
| 58 }; | 62 }; |
| 59 | 63 |
| 60 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ | 64 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ |
| OLD | NEW |