OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 6 // intercepting navigation events, as specified in |
7 // chrome/common/extensions/api/extension_api.json. | 7 // chrome/common/extensions/api/extension_api.json. |
8 | 8 |
9 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 9 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
10 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 10 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 virtual void DidStartProvisionalLoadForFrame( | 134 virtual void DidStartProvisionalLoadForFrame( |
135 int64 frame_id, | 135 int64 frame_id, |
136 bool is_main_frame, | 136 bool is_main_frame, |
137 const GURL& validated_url, | 137 const GURL& validated_url, |
138 bool is_error_page, | 138 bool is_error_page, |
139 RenderViewHost* render_view_host) OVERRIDE; | 139 RenderViewHost* render_view_host) OVERRIDE; |
140 virtual void DidCommitProvisionalLoadForFrame( | 140 virtual void DidCommitProvisionalLoadForFrame( |
141 int64 frame_id, | 141 int64 frame_id, |
142 bool is_main_frame, | 142 bool is_main_frame, |
143 const GURL& url, | 143 const GURL& url, |
144 PageTransition::Type transition_type) OVERRIDE; | 144 content::PageTransition transition_type) OVERRIDE; |
145 virtual void DidFailProvisionalLoad( | 145 virtual void DidFailProvisionalLoad( |
146 int64 frame_id, | 146 int64 frame_id, |
147 bool is_main_frame, | 147 bool is_main_frame, |
148 const GURL& validated_url, | 148 const GURL& validated_url, |
149 int error_code, | 149 int error_code, |
150 const string16& error_description) OVERRIDE; | 150 const string16& error_description) OVERRIDE; |
151 virtual void DocumentLoadedInFrame(int64 frame_id) OVERRIDE; | 151 virtual void DocumentLoadedInFrame(int64 frame_id) OVERRIDE; |
152 virtual void DidFinishLoad(int64 frame_id) OVERRIDE; | 152 virtual void DidFinishLoad(int64 frame_id) OVERRIDE; |
153 virtual void DidOpenRequestedURL(TabContents* new_contents, | 153 virtual void DidOpenRequestedURL(TabContents* new_contents, |
154 const GURL& url, | 154 const GURL& url, |
155 const GURL& referrer, | 155 const GURL& referrer, |
156 WindowOpenDisposition disposition, | 156 WindowOpenDisposition disposition, |
157 PageTransition::Type transition, | 157 content::PageTransition transition, |
158 int64 source_frame_id) OVERRIDE; | 158 int64 source_frame_id) OVERRIDE; |
159 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; | 159 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; |
160 | 160 |
161 private: | 161 private: |
162 // True if the transition and target url correspond to a reference fragment | 162 // True if the transition and target url correspond to a reference fragment |
163 // navigation. | 163 // navigation. |
164 bool IsReferenceFragmentNavigation(int64 frame_id, const GURL& url); | 164 bool IsReferenceFragmentNavigation(int64 frame_id, const GURL& url); |
165 | 165 |
166 // Tracks the state of the frames we are sending events for. | 166 // Tracks the state of the frames we are sending events for. |
167 FrameNavigationState navigation_state_; | 167 FrameNavigationState navigation_state_; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 }; | 237 }; |
238 | 238 |
239 // API function that returns the states of all frames in a given tab. | 239 // API function that returns the states of all frames in a given tab. |
240 class GetAllFramesFunction : public SyncExtensionFunction { | 240 class GetAllFramesFunction : public SyncExtensionFunction { |
241 virtual ~GetAllFramesFunction() {} | 241 virtual ~GetAllFramesFunction() {} |
242 virtual bool RunImpl() OVERRIDE; | 242 virtual bool RunImpl() OVERRIDE; |
243 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames") | 243 DECLARE_EXTENSION_FUNCTION_NAME("webNavigation.getAllFrames") |
244 }; | 244 }; |
245 | 245 |
246 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 246 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
OLD | NEW |