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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // True if the transition and target url correspond to a reference fragment | 87 // True if the transition and target url correspond to a reference fragment |
88 // navigation. | 88 // navigation. |
89 bool IsReferenceFragmentNavigation(int64 frame_id, const GURL& url); | 89 bool IsReferenceFragmentNavigation(int64 frame_id, const GURL& url); |
90 | 90 |
91 // Tracks the state of the frames we are sending events for. | 91 // Tracks the state of the frames we are sending events for. |
92 FrameNavigationState navigation_state_; | 92 FrameNavigationState navigation_state_; |
93 | 93 |
94 // Used for tracking registrations to redirect notifications. | 94 // Used for tracking registrations to redirect notifications. |
95 content::NotificationRegistrar registrar_; | 95 content::NotificationRegistrar registrar_; |
96 | 96 |
| 97 content::RenderViewHost* render_view_host_; |
| 98 content::RenderViewHost* pending_render_view_host_; |
| 99 |
97 DISALLOW_COPY_AND_ASSIGN(WebNavigationTabObserver); | 100 DISALLOW_COPY_AND_ASSIGN(WebNavigationTabObserver); |
98 }; | 101 }; |
99 | 102 |
100 // Observes navigation notifications and routes them as events to the extension | 103 // Observes navigation notifications and routes them as events to the extension |
101 // system. | 104 // system. |
102 class WebNavigationEventRouter : public TabStripModelObserver, | 105 class WebNavigationEventRouter : public TabStripModelObserver, |
103 public chrome::BrowserListObserver, | 106 public chrome::BrowserListObserver, |
104 public content::NotificationObserver { | 107 public content::NotificationObserver { |
105 public: | 108 public: |
106 explicit WebNavigationEventRouter(Profile* profile); | 109 explicit WebNavigationEventRouter(Profile* profile); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // API function that returns the states of all frames in a given tab. | 182 // API function that returns the states of all frames in a given tab. |
180 class GetAllFramesFunction : public SyncExtensionFunction { | 183 class GetAllFramesFunction : public SyncExtensionFunction { |
181 virtual ~GetAllFramesFunction() {} | 184 virtual ~GetAllFramesFunction() {} |
182 virtual bool RunImpl() OVERRIDE; | 185 virtual bool RunImpl() OVERRIDE; |
183 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames") | 186 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames") |
184 }; | 187 }; |
185 | 188 |
186 } // namespace extensions | 189 } // namespace extensions |
187 | 190 |
188 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ | 191 #endif // CHROME_BROWSER_EXTENSIONS_API_WEB_NAVIGATION_WEB_NAVIGATION_API_H_ |
OLD | NEW |