| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // Used for tracking registrations to navigation notifications. | 194 // Used for tracking registrations to navigation notifications. |
| 195 content::NotificationRegistrar registrar_; | 195 content::NotificationRegistrar registrar_; |
| 196 | 196 |
| 197 // The profile that owns us via ExtensionService. | 197 // The profile that owns us via ExtensionService. |
| 198 Profile* profile_; | 198 Profile* profile_; |
| 199 | 199 |
| 200 DISALLOW_COPY_AND_ASSIGN(WebNavigationEventRouter); | 200 DISALLOW_COPY_AND_ASSIGN(WebNavigationEventRouter); |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 // API function that returns the state of a given frame. | 203 // API function that returns the state of a given frame. |
| 204 class GetFrameFunction : public SyncExtensionFunction { | 204 class WebNavigationGetFrameFunction : public SyncExtensionFunction { |
| 205 virtual ~GetFrameFunction() {} | 205 virtual ~WebNavigationGetFrameFunction() {} |
| 206 virtual bool RunImpl() OVERRIDE; | 206 virtual bool RunImpl() OVERRIDE; |
| 207 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getFrame") | 207 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getFrame") |
| 208 }; | 208 }; |
| 209 | 209 |
| 210 // API function that returns the states of all frames in a given tab. | 210 // API function that returns the states of all frames in a given tab. |
| 211 class GetAllFramesFunction : public SyncExtensionFunction { | 211 class WebNavigationGetAllFramesFunction : public SyncExtensionFunction { |
| 212 virtual ~GetAllFramesFunction() {} | 212 virtual ~WebNavigationGetAllFramesFunction() {} |
| 213 virtual bool RunImpl() OVERRIDE; | 213 virtual bool RunImpl() OVERRIDE; |
| 214 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames") | 214 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames") |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 class WebNavigationAPI : public ProfileKeyedAPI, | 217 class WebNavigationAPI : public ProfileKeyedAPI, |
| 218 public extensions::EventRouter::Observer { | 218 public extensions::EventRouter::Observer { |
| 219 public: | 219 public: |
| 220 explicit WebNavigationAPI(Profile* profile); | 220 explicit WebNavigationAPI(Profile* profile); |
| 221 virtual ~WebNavigationAPI(); | 221 virtual ~WebNavigationAPI(); |
| 222 | 222 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 243 | 243 |
| 244 // Created lazily upon OnListenerAdded. | 244 // Created lazily upon OnListenerAdded. |
| 245 scoped_ptr<WebNavigationEventRouter> web_navigation_event_router_; | 245 scoped_ptr<WebNavigationEventRouter> web_navigation_event_router_; |
| 246 | 246 |
| 247 DISALLOW_COPY_AND_ASSIGN(WebNavigationAPI); | 247 DISALLOW_COPY_AND_ASSIGN(WebNavigationAPI); |
| 248 }; | 248 }; |
| 249 | 249 |
| 250 } // namespace extensions | 250 } // namespace extensions |
| 251 | 251 |
| 252 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 252 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
| OLD | NEW |