| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 // The profile that owns us via ExtensionService. | 163 // The profile that owns us via ExtensionService. |
| 164 Profile* profile_; | 164 Profile* profile_; |
| 165 | 165 |
| 166 BrowserTabStripTracker browser_tab_strip_tracker_; | 166 BrowserTabStripTracker browser_tab_strip_tracker_; |
| 167 | 167 |
| 168 DISALLOW_COPY_AND_ASSIGN(WebNavigationEventRouter); | 168 DISALLOW_COPY_AND_ASSIGN(WebNavigationEventRouter); |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 // API function that returns the state of a given frame. | 171 // API function that returns the state of a given frame. |
| 172 class WebNavigationGetFrameFunction : public ChromeSyncExtensionFunction { | 172 class WebNavigationGetFrameFunction : public UIThreadExtensionFunction { |
| 173 ~WebNavigationGetFrameFunction() override {} | 173 ~WebNavigationGetFrameFunction() override {} |
| 174 bool RunSync() override; | 174 ResponseAction Run() override; |
| 175 DECLARE_EXTENSION_FUNCTION("webNavigation.getFrame", WEBNAVIGATION_GETFRAME) | 175 DECLARE_EXTENSION_FUNCTION("webNavigation.getFrame", WEBNAVIGATION_GETFRAME) |
| 176 }; | 176 }; |
| 177 | 177 |
| 178 // API function that returns the states of all frames in a given tab. | 178 // API function that returns the states of all frames in a given tab. |
| 179 class WebNavigationGetAllFramesFunction : public ChromeSyncExtensionFunction { | 179 class WebNavigationGetAllFramesFunction : public UIThreadExtensionFunction { |
| 180 ~WebNavigationGetAllFramesFunction() override {} | 180 ~WebNavigationGetAllFramesFunction() override {} |
| 181 bool RunSync() override; | 181 ResponseAction Run() override; |
| 182 DECLARE_EXTENSION_FUNCTION("webNavigation.getAllFrames", | 182 DECLARE_EXTENSION_FUNCTION("webNavigation.getAllFrames", |
| 183 WEBNAVIGATION_GETALLFRAMES) | 183 WEBNAVIGATION_GETALLFRAMES) |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 class WebNavigationAPI : public BrowserContextKeyedAPI, | 186 class WebNavigationAPI : public BrowserContextKeyedAPI, |
| 187 public extensions::EventRouter::Observer { | 187 public extensions::EventRouter::Observer { |
| 188 public: | 188 public: |
| 189 explicit WebNavigationAPI(content::BrowserContext* context); | 189 explicit WebNavigationAPI(content::BrowserContext* context); |
| 190 ~WebNavigationAPI() override; | 190 ~WebNavigationAPI() override; |
| 191 | 191 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 211 | 211 |
| 212 // Created lazily upon OnListenerAdded. | 212 // Created lazily upon OnListenerAdded. |
| 213 std::unique_ptr<WebNavigationEventRouter> web_navigation_event_router_; | 213 std::unique_ptr<WebNavigationEventRouter> web_navigation_event_router_; |
| 214 | 214 |
| 215 DISALLOW_COPY_AND_ASSIGN(WebNavigationAPI); | 215 DISALLOW_COPY_AND_ASSIGN(WebNavigationAPI); |
| 216 }; | 216 }; |
| 217 | 217 |
| 218 } // namespace extensions | 218 } // namespace extensions |
| 219 | 219 |
| 220 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 220 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
| OLD | NEW |