| 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 25 matching lines...) Expand all Loading... |
| 36 #include "WebDOMMessageEvent.h" | 36 #include "WebDOMMessageEvent.h" |
| 37 #include "WebDataSource.h" | 37 #include "WebDataSource.h" |
| 38 #include "WebFileChooserParams.h" | 38 #include "WebFileChooserParams.h" |
| 39 #include "WebFormElement.h" | 39 #include "WebFormElement.h" |
| 40 #include "WebFrame.h" | 40 #include "WebFrame.h" |
| 41 #include "WebFrameOwnerProperties.h" | 41 #include "WebFrameOwnerProperties.h" |
| 42 #include "WebHistoryCommitType.h" | 42 #include "WebHistoryCommitType.h" |
| 43 #include "WebHistoryItem.h" | 43 #include "WebHistoryItem.h" |
| 44 #include "WebIconURL.h" | 44 #include "WebIconURL.h" |
| 45 #include "WebNavigationPolicy.h" | 45 #include "WebNavigationPolicy.h" |
| 46 #include "WebNavigationType.h" | |
| 47 #include "WebNavigatorContentUtilsClient.h" | 46 #include "WebNavigatorContentUtilsClient.h" |
| 48 #include "WebSandboxFlags.h" | 47 #include "WebSandboxFlags.h" |
| 49 #include "WebTextDirection.h" | 48 #include "WebTextDirection.h" |
| 50 #include "public/platform/BlameContext.h" | 49 #include "public/platform/BlameContext.h" |
| 51 #include "public/platform/WebCommon.h" | 50 #include "public/platform/WebCommon.h" |
| 52 #include "public/platform/WebEffectiveConnectionType.h" | 51 #include "public/platform/WebEffectiveConnectionType.h" |
| 53 #include "public/platform/WebFeaturePolicy.h" | 52 #include "public/platform/WebFeaturePolicy.h" |
| 54 #include "public/platform/WebFileSystem.h" | 53 #include "public/platform/WebFileSystem.h" |
| 55 #include "public/platform/WebFileSystemType.h" | 54 #include "public/platform/WebFileSystemType.h" |
| 56 #include "public/platform/WebInsecureRequestPolicy.h" | 55 #include "public/platform/WebInsecureRequestPolicy.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 const WebString& sourceName, | 264 const WebString& sourceName, |
| 266 unsigned sourceLine, | 265 unsigned sourceLine, |
| 267 const WebString& stackTrace) {} | 266 const WebString& stackTrace) {} |
| 268 | 267 |
| 269 // Load commands ------------------------------------------------------- | 268 // Load commands ------------------------------------------------------- |
| 270 | 269 |
| 271 // The client should handle the navigation externally. | 270 // The client should handle the navigation externally. |
| 272 virtual void loadURLExternally(const WebURLRequest&, | 271 virtual void loadURLExternally(const WebURLRequest&, |
| 273 WebNavigationPolicy, | 272 WebNavigationPolicy, |
| 274 const WebString& downloadName, | 273 const WebString& downloadName, |
| 275 bool shouldReplaceCurrentEntry) {} | 274 WebFrameLoadType loadType) {} |
| 276 | 275 |
| 277 // The client should load an error page in the current frame. | 276 // The client should load an error page in the current frame. |
| 278 virtual void loadErrorPage(int reason) {} | 277 virtual void loadErrorPage(int reason) {} |
| 279 | 278 |
| 280 // Navigational queries ------------------------------------------------ | 279 // Navigational queries ------------------------------------------------ |
| 281 | 280 |
| 282 // The client may choose to alter the navigation policy. Otherwise, | 281 // The client may choose to alter the navigation policy. Otherwise, |
| 283 // defaultPolicy should just be returned. | 282 // defaultPolicy should just be returned. |
| 284 | 283 |
| 285 struct NavigationPolicyInfo { | 284 struct NavigationPolicyInfo { |
| 286 WebDataSource::ExtraData* extraData; | 285 WebDataSource::ExtraData* extraData; |
| 287 | 286 |
| 288 // Note: if browser side navigations are enabled, the client may modify | 287 // Note: if browser side navigations are enabled, the client may modify |
| 289 // the urlRequest. However, should this happen, the client should change | 288 // the urlRequest. However, should this happen, the client should change |
| 290 // the WebNavigationPolicy to WebNavigationPolicyIgnore, and the load | 289 // the WebNavigationPolicy to WebNavigationPolicyIgnore, and the load |
| 291 // should stop in blink. In all other cases, the urlRequest should not | 290 // should stop in blink. In all other cases, the urlRequest should not |
| 292 // be modified. | 291 // be modified. |
| 293 WebURLRequest& urlRequest; | 292 WebURLRequest& urlRequest; |
| 294 WebNavigationType navigationType; | |
| 295 WebNavigationPolicy defaultPolicy; | 293 WebNavigationPolicy defaultPolicy; |
| 296 bool replacesCurrentHistoryItem; | 294 WebFrameLoadType loadType; |
| 297 bool isHistoryNavigationInNewChildFrame; | |
| 298 bool isClientRedirect; | 295 bool isClientRedirect; |
| 299 WebFormElement form; | 296 WebFormElement form; |
| 300 bool isCacheDisabled; | 297 bool isCacheDisabled; |
| 301 | 298 |
| 302 NavigationPolicyInfo(WebURLRequest& urlRequest) | 299 NavigationPolicyInfo(WebURLRequest& urlRequest) |
| 303 : extraData(nullptr), | 300 : extraData(nullptr), |
| 304 urlRequest(urlRequest), | 301 urlRequest(urlRequest), |
| 305 navigationType(WebNavigationTypeOther), | |
| 306 defaultPolicy(WebNavigationPolicyIgnore), | 302 defaultPolicy(WebNavigationPolicyIgnore), |
| 307 replacesCurrentHistoryItem(false), | 303 loadType(WebFrameLoadType::Standard), |
| 308 isHistoryNavigationInNewChildFrame(false), | |
| 309 isClientRedirect(false), | 304 isClientRedirect(false), |
| 310 isCacheDisabled(false) {} | 305 isCacheDisabled(false) {} |
| 311 }; | 306 }; |
| 312 | 307 |
| 313 virtual WebNavigationPolicy decidePolicyForNavigation( | 308 virtual WebNavigationPolicy decidePolicyForNavigation( |
| 314 const NavigationPolicyInfo& info) { | 309 const NavigationPolicyInfo& info) { |
| 315 return info.defaultPolicy; | 310 return info.defaultPolicy; |
| 316 } | 311 } |
| 317 | 312 |
| 318 // During a history navigation, we may choose to load new subframes from | 313 // During a history navigation, we may choose to load new subframes from |
| (...skipping 18 matching lines...) Expand all Loading... |
| 337 virtual void willSendSubmitEvent(const WebFormElement&) {} | 332 virtual void willSendSubmitEvent(const WebFormElement&) {} |
| 338 | 333 |
| 339 // A form submission is about to occur. | 334 // A form submission is about to occur. |
| 340 virtual void willSubmitForm(const WebFormElement&) {} | 335 virtual void willSubmitForm(const WebFormElement&) {} |
| 341 | 336 |
| 342 // A datasource has been created for a new navigation. The given | 337 // A datasource has been created for a new navigation. The given |
| 343 // datasource will become the provisional datasource for the frame. | 338 // datasource will become the provisional datasource for the frame. |
| 344 virtual void didCreateDataSource(WebLocalFrame*, WebDataSource*) {} | 339 virtual void didCreateDataSource(WebLocalFrame*, WebDataSource*) {} |
| 345 | 340 |
| 346 // A new provisional load has been started. | 341 // A new provisional load has been started. |
| 347 virtual void didStartProvisionalLoad(WebLocalFrame* localFrame) {} | 342 virtual void didStartProvisionalLoad(WebDataSource*, WebFrameLoadType) {} |
| 348 | 343 |
| 349 // The provisional load was redirected via a HTTP 3xx response. | 344 // The provisional load was redirected via a HTTP 3xx response. |
| 350 virtual void didReceiveServerRedirectForProvisionalLoad(WebLocalFrame*) {} | 345 virtual void didReceiveServerRedirectForProvisionalLoad(WebLocalFrame*) {} |
| 351 | 346 |
| 352 // The provisional load failed. The WebHistoryCommitType is the commit type | 347 // The provisional load failed. The WebHistoryCommitType is the commit type |
| 353 // that would have been used had the load succeeded. | 348 // that would have been used had the load succeeded. |
| 354 virtual void didFailProvisionalLoad(WebLocalFrame*, | 349 virtual void didFailProvisionalLoad(WebLocalFrame*, |
| 355 const WebURLError&, | 350 const WebURLError&, |
| 356 WebHistoryCommitType) {} | 351 WebHistoryCommitType) {} |
| 357 | 352 |
| 358 // The provisional datasource is now committed. The first part of the | 353 // The provisional datasource is now committed. The first part of the |
| 359 // response body has been received, and the encoding of the response | 354 // response body has been received, and the encoding of the response |
| 360 // body is known. | 355 // body is known. |
| 361 virtual void didCommitProvisionalLoad(WebLocalFrame*, | 356 virtual void didCommitProvisionalLoad(WebDataSource*, |
| 357 WebFrameLoadType, |
| 362 const WebHistoryItem&, | 358 const WebHistoryItem&, |
| 363 WebHistoryCommitType) {} | 359 WebHistoryCommitType) {} |
| 364 | 360 |
| 365 // The frame's document has just been initialized. | 361 // The frame's document has just been initialized. |
| 366 virtual void didCreateNewDocument(WebLocalFrame* frame) {} | 362 virtual void didCreateNewDocument(WebLocalFrame* frame) {} |
| 367 | 363 |
| 368 // The window object for the frame has been cleared of any extra | 364 // The window object for the frame has been cleared of any extra |
| 369 // properties that may have been set by script from the previously | 365 // properties that may have been set by script from the previously |
| 370 // loaded document. | 366 // loaded document. |
| 371 virtual void didClearWindowObject(WebLocalFrame* frame) {} | 367 virtual void didClearWindowObject(WebLocalFrame* frame) {} |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 virtual void didFailLoad(WebLocalFrame*, | 400 virtual void didFailLoad(WebLocalFrame*, |
| 405 const WebURLError&, | 401 const WebURLError&, |
| 406 WebHistoryCommitType) {} | 402 WebHistoryCommitType) {} |
| 407 | 403 |
| 408 // The frame's document and all of its subresources succeeded to load. | 404 // The frame's document and all of its subresources succeeded to load. |
| 409 virtual void didFinishLoad(WebLocalFrame*) {} | 405 virtual void didFinishLoad(WebLocalFrame*) {} |
| 410 | 406 |
| 411 // The navigation resulted in no change to the documents within the page. | 407 // The navigation resulted in no change to the documents within the page. |
| 412 // For example, the navigation may have just resulted in scrolling to a | 408 // For example, the navigation may have just resulted in scrolling to a |
| 413 // named anchor or a PopState event may have been dispatched. | 409 // named anchor or a PopState event may have been dispatched. |
| 414 virtual void didNavigateWithinPage(WebLocalFrame*, | 410 virtual void didNavigateWithinPage(WebDataSource*, |
| 411 WebFrameLoadType, |
| 415 const WebHistoryItem&, | 412 const WebHistoryItem&, |
| 416 WebHistoryCommitType, | 413 WebHistoryCommitType, |
| 417 bool contentInitiated) {} | 414 bool contentInitiated) {} |
| 418 | 415 |
| 419 // Called upon update to scroll position, document state, and other | 416 // Called upon update to scroll position, document state, and other |
| 420 // non-navigational events related to the data held by WebHistoryItem. | 417 // non-navigational events related to the data held by WebHistoryItem. |
| 421 // WARNING: This method may be called very frequently. | 418 // WARNING: This method may be called very frequently. |
| 422 virtual void didUpdateCurrentHistoryItem() {} | 419 virtual void didUpdateCurrentHistoryItem() {} |
| 423 | 420 |
| 424 // The frame's manifest has changed. | 421 // The frame's manifest has changed. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 | 520 |
| 524 // This method is called in response to WebView's saveImageAt(x, y). | 521 // This method is called in response to WebView's saveImageAt(x, y). |
| 525 // A data url from <canvas> or <img> is passed to the method's argument. | 522 // A data url from <canvas> or <img> is passed to the method's argument. |
| 526 virtual void saveImageFromDataURL(const WebString&) {} | 523 virtual void saveImageFromDataURL(const WebString&) {} |
| 527 | 524 |
| 528 // Low-level resource notifications ------------------------------------ | 525 // Low-level resource notifications ------------------------------------ |
| 529 | 526 |
| 530 // A request is about to be sent out, and the client may modify it. Request | 527 // A request is about to be sent out, and the client may modify it. Request |
| 531 // is writable, and changes to the URL, for example, will change the request | 528 // is writable, and changes to the URL, for example, will change the request |
| 532 // made. | 529 // made. |
| 533 virtual void willSendRequest(WebLocalFrame*, WebURLRequest&) {} | 530 virtual void willSendRequest(WebLocalFrame*, |
| 531 WebURLRequest&, |
| 532 blink::WebFrameLoadType) {} |
| 534 | 533 |
| 535 // Response headers have been received. | 534 // Response headers have been received. |
| 536 virtual void didReceiveResponse(const WebURLResponse&) {} | 535 virtual void didReceiveResponse(const WebURLResponse&) {} |
| 537 | 536 |
| 538 // The specified request was satified from WebCore's memory cache. | 537 // The specified request was satified from WebCore's memory cache. |
| 539 virtual void didLoadResourceFromMemoryCache(const WebURLRequest&, | 538 virtual void didLoadResourceFromMemoryCache(const WebURLRequest&, |
| 540 const WebURLResponse&) {} | 539 const WebURLResponse&) {} |
| 541 | 540 |
| 542 // This frame has displayed inactive content (such as an image) from an | 541 // This frame has displayed inactive content (such as an image) from an |
| 543 // insecure source. Inactive content cannot spread to other frames. | 542 // insecure source. Inactive content cannot spread to other frames. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 // Overwrites the given URL to use an HTML5 embed if possible. | 751 // Overwrites the given URL to use an HTML5 embed if possible. |
| 753 // An empty URL is returned if the URL is not overriden. | 752 // An empty URL is returned if the URL is not overriden. |
| 754 virtual WebURL overrideFlashEmbedWithHTML(const WebURL& url) { | 753 virtual WebURL overrideFlashEmbedWithHTML(const WebURL& url) { |
| 755 return WebURL(); | 754 return WebURL(); |
| 756 } | 755 } |
| 757 }; | 756 }; |
| 758 | 757 |
| 759 } // namespace blink | 758 } // namespace blink |
| 760 | 759 |
| 761 #endif | 760 #endif |
| OLD | NEW |