OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 // The client should handle the navigation externally. | 177 // The client should handle the navigation externally. |
178 virtual void loadURLExternally( | 178 virtual void loadURLExternally( |
179 WebLocalFrame*, const WebURLRequest&, WebNavigationPolicy, const WebStri
ng& downloadName) { } | 179 WebLocalFrame*, const WebURLRequest&, WebNavigationPolicy, const WebStri
ng& downloadName) { } |
180 | 180 |
181 | 181 |
182 // Navigational queries ------------------------------------------------ | 182 // Navigational queries ------------------------------------------------ |
183 | 183 |
184 // The client may choose to alter the navigation policy. Otherwise, | 184 // The client may choose to alter the navigation policy. Otherwise, |
185 // defaultPolicy should just be returned. | 185 // defaultPolicy should just be returned. |
| 186 |
| 187 struct NavigationPolicyInfo { |
| 188 WebLocalFrame* frame; |
| 189 WebDataSource::ExtraData* extraData; |
| 190 const WebURLRequest& urlRequest; |
| 191 WebNavigationType navigationType; |
| 192 WebNavigationPolicy defaultPolicy; |
| 193 bool isRedirect; |
| 194 bool isTransitionNavigation; |
| 195 |
| 196 NavigationPolicyInfo(const WebURLRequest& urlRequest) |
| 197 : frame(0) |
| 198 , extraData(0) |
| 199 , urlRequest(urlRequest) |
| 200 , navigationType(WebNavigationTypeOther) |
| 201 , defaultPolicy(WebNavigationPolicyIgnore) |
| 202 , isRedirect(false) |
| 203 , isTransitionNavigation(false) { } |
| 204 }; |
| 205 |
| 206 virtual WebNavigationPolicy decidePolicyForNavigation(const NavigationPolicy
Info& info) |
| 207 { |
| 208 return decidePolicyForNavigation(info.frame, info.extraData, info.urlReq
uest, info.navigationType, info.defaultPolicy, info.isRedirect); |
| 209 } |
| 210 |
| 211 // DEPRECATED |
186 virtual WebNavigationPolicy decidePolicyForNavigation( | 212 virtual WebNavigationPolicy decidePolicyForNavigation( |
187 WebLocalFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavi
gationType, | 213 WebLocalFrame*, WebDataSource::ExtraData*, const WebURLRequest&, WebNavi
gationType, |
188 WebNavigationPolicy defaultPolicy, bool isRedirect) { return defaultPoli
cy; } | 214 WebNavigationPolicy defaultPolicy, bool isRedirect) { return defaultPoli
cy; } |
189 | 215 |
190 // During a history navigation, we may choose to load new subframes from his
tory as well. | 216 // During a history navigation, we may choose to load new subframes from his
tory as well. |
191 // This returns such a history item if appropriate. | 217 // This returns such a history item if appropriate. |
192 virtual WebHistoryItem historyItemForNewChildFrame(WebFrame*) { return WebHi
storyItem(); } | 218 virtual WebHistoryItem historyItemForNewChildFrame(WebFrame*) { return WebHi
storyItem(); } |
193 | 219 |
194 | 220 |
195 // Navigational notifications ------------------------------------------ | 221 // Navigational notifications ------------------------------------------ |
(...skipping 12 matching lines...) Expand all Loading... |
208 virtual void willSendSubmitEvent(WebLocalFrame*, const WebFormElement&) { } | 234 virtual void willSendSubmitEvent(WebLocalFrame*, const WebFormElement&) { } |
209 | 235 |
210 // A form submission is about to occur. | 236 // A form submission is about to occur. |
211 virtual void willSubmitForm(WebLocalFrame*, const WebFormElement&) { } | 237 virtual void willSubmitForm(WebLocalFrame*, const WebFormElement&) { } |
212 | 238 |
213 // A datasource has been created for a new navigation. The given | 239 // A datasource has been created for a new navigation. The given |
214 // datasource will become the provisional datasource for the frame. | 240 // datasource will become the provisional datasource for the frame. |
215 virtual void didCreateDataSource(WebLocalFrame*, WebDataSource*) { } | 241 virtual void didCreateDataSource(WebLocalFrame*, WebDataSource*) { } |
216 | 242 |
217 // A new provisional load has been started. | 243 // A new provisional load has been started. |
| 244 virtual void didStartProvisionalLoad(WebLocalFrame* localFrame, bool isTrans
itionNavigation) { didStartProvisionalLoad(localFrame); } |
| 245 // DEPRECATED |
218 virtual void didStartProvisionalLoad(WebLocalFrame*) { } | 246 virtual void didStartProvisionalLoad(WebLocalFrame*) { } |
219 | 247 |
220 // The provisional load was redirected via a HTTP 3xx response. | 248 // The provisional load was redirected via a HTTP 3xx response. |
221 virtual void didReceiveServerRedirectForProvisionalLoad(WebLocalFrame*) { } | 249 virtual void didReceiveServerRedirectForProvisionalLoad(WebLocalFrame*) { } |
222 | 250 |
223 // The provisional load failed. | 251 // The provisional load failed. |
224 virtual void didFailProvisionalLoad(WebLocalFrame*, const WebURLError&) { } | 252 virtual void didFailProvisionalLoad(WebLocalFrame*, const WebURLError&) { } |
225 | 253 |
226 // The provisional datasource is now committed. The first part of the | 254 // The provisional datasource is now committed. The first part of the |
227 // response body has been received, and the encoding of the response | 255 // response body has been received, and the encoding of the response |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // The frame's manifest has changed. | 295 // The frame's manifest has changed. |
268 virtual void didChangeManifest(WebLocalFrame*) { } | 296 virtual void didChangeManifest(WebLocalFrame*) { } |
269 | 297 |
270 // TODO: Remove when chromium is changed to use didChangeThemeColor(). | 298 // TODO: Remove when chromium is changed to use didChangeThemeColor(). |
271 virtual void didChangeBrandColor() { } | 299 virtual void didChangeBrandColor() { } |
272 | 300 |
273 // The frame's theme color has changed. | 301 // The frame's theme color has changed. |
274 virtual void didChangeThemeColor() { } | 302 virtual void didChangeThemeColor() { } |
275 | 303 |
276 | 304 |
| 305 // Transition navigations ----------------------------------------------- |
| 306 |
| 307 // Provides serialized markup of transition elements for use in the followin
g navigation. |
| 308 virtual void addNavigationTransitionData(const WebString& allowedDestination
Origin, const WebString& selector, const WebString& markup) { } |
| 309 |
| 310 |
277 // Web Notifications --------------------------------------------------- | 311 // Web Notifications --------------------------------------------------- |
278 | 312 |
279 // Requests permission to display platform notifications on the origin of th
is frame. | 313 // Requests permission to display platform notifications on the origin of th
is frame. |
280 virtual void requestNotificationPermission(const WebSecurityOrigin&, WebNoti
ficationPermissionCallback* callback) { } | 314 virtual void requestNotificationPermission(const WebSecurityOrigin&, WebNoti
ficationPermissionCallback* callback) { } |
281 | 315 |
282 // Called to retrieve the provider of desktop notifications. | 316 // Called to retrieve the provider of desktop notifications. |
283 // FIXME: Remove this method once the presenter is obtained through Platform
. | 317 // FIXME: Remove this method once the presenter is obtained through Platform
. |
284 virtual WebNotificationPresenter* notificationPresenter() { return 0; } | 318 virtual WebNotificationPresenter* notificationPresenter() { return 0; } |
285 | 319 |
286 | 320 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 // Access the embedder API for (client-based) screen orientation client . | 560 // Access the embedder API for (client-based) screen orientation client . |
527 virtual WebScreenOrientationClient* webScreenOrientationClient() { return 0;
} | 561 virtual WebScreenOrientationClient* webScreenOrientationClient() { return 0;
} |
528 | 562 |
529 protected: | 563 protected: |
530 virtual ~WebFrameClient() { } | 564 virtual ~WebFrameClient() { } |
531 }; | 565 }; |
532 | 566 |
533 } // namespace blink | 567 } // namespace blink |
534 | 568 |
535 #endif | 569 #endif |
OLD | NEW |