| 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 // 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 the extension JSON API. | 6 // intercepting navigation events, as specified in the extension JSON API. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
| 9 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 // Observes navigation notifications and routes them as events to the extension | 132 // Observes navigation notifications and routes them as events to the extension |
| 133 // system. | 133 // system. |
| 134 class WebNavigationEventRouter : public TabStripModelObserver, | 134 class WebNavigationEventRouter : public TabStripModelObserver, |
| 135 public chrome::BrowserListObserver, | 135 public chrome::BrowserListObserver, |
| 136 public content::NotificationObserver { | 136 public content::NotificationObserver { |
| 137 public: | 137 public: |
| 138 explicit WebNavigationEventRouter(Profile* profile); | 138 explicit WebNavigationEventRouter(Profile* profile); |
| 139 virtual ~WebNavigationEventRouter(); | 139 virtual ~WebNavigationEventRouter(); |
| 140 | 140 |
| 141 // Invoked by the extensions service once the extension system is fully set | |
| 142 // up and can start dispatching events to extensions. | |
| 143 void Init(); | |
| 144 | |
| 145 private: | 141 private: |
| 146 // Used to cache the information about newly created WebContents objects. | 142 // Used to cache the information about newly created WebContents objects. |
| 147 struct PendingWebContents{ | 143 struct PendingWebContents{ |
| 148 PendingWebContents(); | 144 PendingWebContents(); |
| 149 PendingWebContents(content::WebContents* source_web_contents, | 145 PendingWebContents(content::WebContents* source_web_contents, |
| 150 int64 source_frame_id, | 146 int64 source_frame_id, |
| 151 bool source_frame_is_main_frame, | 147 bool source_frame_is_main_frame, |
| 152 content::WebContents* target_web_contents, | 148 content::WebContents* target_web_contents, |
| 153 const GURL& target_url); | 149 const GURL& target_url); |
| 154 ~PendingWebContents(); | 150 ~PendingWebContents(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // API function that returns the states of all frames in a given tab. | 207 // API function that returns the states of all frames in a given tab. |
| 212 class GetAllFramesFunction : public SyncExtensionFunction { | 208 class GetAllFramesFunction : public SyncExtensionFunction { |
| 213 virtual ~GetAllFramesFunction() {} | 209 virtual ~GetAllFramesFunction() {} |
| 214 virtual bool RunImpl() OVERRIDE; | 210 virtual bool RunImpl() OVERRIDE; |
| 215 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames") | 211 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames") |
| 216 }; | 212 }; |
| 217 | 213 |
| 218 } // namespace extensions | 214 } // namespace extensions |
| 219 | 215 |
| 220 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 216 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
| OLD | NEW |