Chromium Code Reviews| 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 <string> | 10 #include <string> |
| 10 | 11 |
| 11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 12 #include "base/singleton.h" | 13 #include "base/singleton.h" |
| 13 #include "chrome/browser/tabs/tab_strip_model.h" | 14 #include "chrome/browser/tabs/tab_strip_model.h" |
| 14 #include "chrome/common/notification_observer.h" | 15 #include "chrome/common/notification_observer.h" |
| 15 | 16 |
| 16 // The ExtensionBrowserEventRouter listens to Browser window & tab events | 17 // The ExtensionBrowserEventRouter listens to Browser window & tab events |
| 17 // and routes them to listeners inside extension process renderers. | 18 // and routes them to listeners inside extension process renderers. |
| 18 // ExtensionBrowserEventRouter listens to *all* events, but will only route | 19 // ExtensionBrowserEventRouter listens to *all* events, but will only route |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 42 // NotificationObserver | 43 // NotificationObserver |
| 43 void Observe(NotificationType type, | 44 void Observe(NotificationType type, |
| 44 const NotificationSource& source, | 45 const NotificationSource& source, |
| 45 const NotificationDetails& details); | 46 const NotificationDetails& details); |
| 46 private: | 47 private: |
| 47 ExtensionBrowserEventRouter(); | 48 ExtensionBrowserEventRouter(); |
| 48 friend struct DefaultSingletonTraits<ExtensionBrowserEventRouter>; | 49 friend struct DefaultSingletonTraits<ExtensionBrowserEventRouter>; |
| 49 | 50 |
| 50 bool initialized_; | 51 bool initialized_; |
| 51 | 52 |
| 53 // 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. | |
|
Matt Perry
2009/04/22 18:20:17
nit: "Also used to avoid sending"
| |
| 55 std::set<int> tab_ids_; | |
| 56 | |
| 52 DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserEventRouter); | 57 DISALLOW_COPY_AND_ASSIGN(ExtensionBrowserEventRouter); |
| 53 }; | 58 }; |
| 54 | 59 |
| 55 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ | 60 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSER_EVENT_ROUTER_H_ |
| OLD | NEW |