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