| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Defines the Chrome Extensions WebNavigation API functions for observing and | 5 // Defines the Chrome Extensions WebNavigation API functions for observing and |
| 6 // intercepting navigation events, as specified in | 6 // intercepting navigation events, as specified in |
| 7 // chrome/common/extensions/api/extension_api.json. | 7 // chrome/common/extensions/api/extension_api.json. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 9 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
| 10 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 10 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 public: | 134 public: |
| 135 explicit ExtensionWebNavigationEventRouter(Profile* profile); | 135 explicit ExtensionWebNavigationEventRouter(Profile* profile); |
| 136 virtual ~ExtensionWebNavigationEventRouter(); | 136 virtual ~ExtensionWebNavigationEventRouter(); |
| 137 | 137 |
| 138 // Invoked by the extensions service once the extension system is fully set | 138 // Invoked by the extensions service once the extension system is fully set |
| 139 // up and can start dispatching events to extensions. | 139 // up and can start dispatching events to extensions. |
| 140 void Init(); | 140 void Init(); |
| 141 | 141 |
| 142 private: | 142 private: |
| 143 // NotificationObserver implementation. | 143 // NotificationObserver implementation. |
| 144 virtual void Observe(NotificationType type, | 144 virtual void Observe(int type, |
| 145 const NotificationSource& source, | 145 const NotificationSource& source, |
| 146 const NotificationDetails& details); | 146 const NotificationDetails& details); |
| 147 | 147 |
| 148 // Handler for the CREATING_NEW_WINDOW event. The method takes the details of | 148 // Handler for the CREATING_NEW_WINDOW event. The method takes the details of |
| 149 // such an event and constructs a suitable JSON formatted extension event from | 149 // such an event and constructs a suitable JSON formatted extension event from |
| 150 // it. | 150 // it. |
| 151 void CreatingNewWindow(TabContents* tab_content, | 151 void CreatingNewWindow(TabContents* tab_content, |
| 152 const ViewHostMsg_CreateWindow_Params* details); | 152 const ViewHostMsg_CreateWindow_Params* details); |
| 153 | 153 |
| 154 // Used for tracking registrations to navigation notifications. | 154 // Used for tracking registrations to navigation notifications. |
| 155 NotificationRegistrar registrar_; | 155 NotificationRegistrar registrar_; |
| 156 | 156 |
| 157 // The profile that owns us via ExtensionService. | 157 // The profile that owns us via ExtensionService. |
| 158 Profile* profile_; | 158 Profile* profile_; |
| 159 | 159 |
| 160 DISALLOW_COPY_AND_ASSIGN(ExtensionWebNavigationEventRouter); | 160 DISALLOW_COPY_AND_ASSIGN(ExtensionWebNavigationEventRouter); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 163 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
| OLD | NEW |