OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 #include "modules/serviceworkers/NavigatorServiceWorker.h" | 69 #include "modules/serviceworkers/NavigatorServiceWorker.h" |
70 #include "modules/serviceworkers/ServiceWorkerLinkResource.h" | 70 #include "modules/serviceworkers/ServiceWorkerLinkResource.h" |
71 #include "modules/storage/DOMWindowStorageController.h" | 71 #include "modules/storage/DOMWindowStorageController.h" |
72 #include "modules/vr/NavigatorVR.h" | 72 #include "modules/vr/NavigatorVR.h" |
73 #include "platform/Histogram.h" | 73 #include "platform/Histogram.h" |
74 #include "platform/RuntimeEnabledFeatures.h" | 74 #include "platform/RuntimeEnabledFeatures.h" |
75 #include "platform/UserGestureIndicator.h" | 75 #include "platform/UserGestureIndicator.h" |
76 #include "platform/exported/WrappedResourceRequest.h" | 76 #include "platform/exported/WrappedResourceRequest.h" |
77 #include "platform/exported/WrappedResourceResponse.h" | 77 #include "platform/exported/WrappedResourceResponse.h" |
78 #include "platform/feature_policy/FeaturePolicy.h" | 78 #include "platform/feature_policy/FeaturePolicy.h" |
| 79 #include "platform/loader/fetch/ResourceFetcher.h" |
79 #include "platform/network/HTTPParsers.h" | 80 #include "platform/network/HTTPParsers.h" |
80 #include "platform/network/mime/MIMETypeRegistry.h" | 81 #include "platform/network/mime/MIMETypeRegistry.h" |
81 #include "platform/plugins/PluginData.h" | 82 #include "platform/plugins/PluginData.h" |
82 #include "platform/wtf/PtrUtil.h" | 83 #include "platform/wtf/PtrUtil.h" |
83 #include "platform/wtf/StringExtras.h" | 84 #include "platform/wtf/StringExtras.h" |
84 #include "platform/wtf/text/CString.h" | 85 #include "platform/wtf/text/CString.h" |
85 #include "platform/wtf/text/WTFString.h" | 86 #include "platform/wtf/text/WTFString.h" |
86 #include "public/platform/Platform.h" | 87 #include "public/platform/Platform.h" |
87 #include "public/platform/WebApplicationCacheHost.h" | 88 #include "public/platform/WebApplicationCacheHost.h" |
88 #include "public/platform/WebMediaPlayerSource.h" | 89 #include "public/platform/WebMediaPlayerSource.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 navigation_info.extra_data = ds ? ds->GetExtraData() : nullptr; | 508 navigation_info.extra_data = ds ? ds->GetExtraData() : nullptr; |
508 navigation_info.replaces_current_history_item = replaces_current_history_item; | 509 navigation_info.replaces_current_history_item = replaces_current_history_item; |
509 navigation_info.is_history_navigation_in_new_child_frame = | 510 navigation_info.is_history_navigation_in_new_child_frame = |
510 is_history_navigation_in_new_child_frame; | 511 is_history_navigation_in_new_child_frame; |
511 navigation_info.is_client_redirect = is_client_redirect; | 512 navigation_info.is_client_redirect = is_client_redirect; |
512 navigation_info.should_check_main_world_content_security_policy = | 513 navigation_info.should_check_main_world_content_security_policy = |
513 should_check_main_world_content_security_policy == | 514 should_check_main_world_content_security_policy == |
514 kCheckContentSecurityPolicy | 515 kCheckContentSecurityPolicy |
515 ? kWebContentSecurityPolicyDispositionCheck | 516 ? kWebContentSecurityPolicyDispositionCheck |
516 : kWebContentSecurityPolicyDispositionDoNotCheck; | 517 : kWebContentSecurityPolicyDispositionDoNotCheck; |
| 518 |
| 519 if (IsLoadedAsMHTMLArchive()) { |
| 520 navigation_info.archive_status = |
| 521 WebFrameClient::NavigationPolicyInfo::ArchiveStatus::Present; |
| 522 } |
| 523 |
517 // Caching could be disabled for requests initiated by DevTools. | 524 // Caching could be disabled for requests initiated by DevTools. |
518 // TODO(ananta) | 525 // TODO(ananta) |
519 // We should extract the network cache state into a global component which | 526 // We should extract the network cache state into a global component which |
520 // can be queried here and wherever necessary. | 527 // can be queried here and wherever necessary. |
521 navigation_info.is_cache_disabled = | 528 navigation_info.is_cache_disabled = |
522 DevToolsAgent() ? DevToolsAgent()->CacheDisabled() : false; | 529 DevToolsAgent() ? DevToolsAgent()->CacheDisabled() : false; |
523 if (form) | 530 if (form) |
524 navigation_info.form = WebFormElement(form); | 531 navigation_info.form = WebFormElement(form); |
525 | 532 |
526 std::unique_ptr<SourceLocation> source_location = | 533 std::unique_ptr<SourceLocation> source_location = |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 WrappedResourceRequest(request)); | 980 WrappedResourceRequest(request)); |
974 } | 981 } |
975 return false; | 982 return false; |
976 } | 983 } |
977 | 984 |
978 WebDevToolsAgentImpl* LocalFrameClientImpl::DevToolsAgent() { | 985 WebDevToolsAgentImpl* LocalFrameClientImpl::DevToolsAgent() { |
979 return WebLocalFrameImpl::FromFrame(web_frame_->GetFrame()->LocalFrameRoot()) | 986 return WebLocalFrameImpl::FromFrame(web_frame_->GetFrame()->LocalFrameRoot()) |
980 ->DevToolsAgentImpl(); | 987 ->DevToolsAgentImpl(); |
981 } | 988 } |
982 | 989 |
| 990 bool LocalFrameClientImpl::IsLoadedAsMHTMLArchive() const { |
| 991 WebFrame* parent_frame = web_frame_->Parent(); |
| 992 if (!parent_frame) |
| 993 return false; |
| 994 |
| 995 // TODO(nasko): How should this work with OOPIF? |
| 996 // The MHTMLArchive is parsed as a whole, but can be constructed from frames |
| 997 // in multiple processes. In that case, which process should parse it and how |
| 998 // should the output be spread back across multiple processes? |
| 999 if (!parent_frame->IsWebLocalFrame()) |
| 1000 return false; |
| 1001 |
| 1002 return ToWebLocalFrameImpl(parent_frame) |
| 1003 ->GetFrame() |
| 1004 ->Loader() |
| 1005 .GetDocumentLoader() |
| 1006 ->Fetcher() |
| 1007 ->Archive(); |
| 1008 } |
| 1009 |
983 KURL LocalFrameClientImpl::OverrideFlashEmbedWithHTML(const KURL& url) { | 1010 KURL LocalFrameClientImpl::OverrideFlashEmbedWithHTML(const KURL& url) { |
984 return web_frame_->Client()->OverrideFlashEmbedWithHTML(WebURL(url)); | 1011 return web_frame_->Client()->OverrideFlashEmbedWithHTML(WebURL(url)); |
985 } | 1012 } |
986 | 1013 |
987 void LocalFrameClientImpl::SetHasReceivedUserGesture(bool received_previously) { | 1014 void LocalFrameClientImpl::SetHasReceivedUserGesture(bool received_previously) { |
988 // The client potentially needs to dispatch the event to other processes only | 1015 // The client potentially needs to dispatch the event to other processes only |
989 // for the first time. | 1016 // for the first time. |
990 if (!received_previously && web_frame_->Client()) | 1017 if (!received_previously && web_frame_->Client()) |
991 web_frame_->Client()->SetHasReceivedUserGesture(); | 1018 web_frame_->Client()->SetHasReceivedUserGesture(); |
992 // WebAutofillClient reacts only to the user gestures for this particular | 1019 // WebAutofillClient reacts only to the user gestures for this particular |
(...skipping 11 matching lines...) Expand all Loading... |
1004 void LocalFrameClientImpl::AbortClientNavigation() { | 1031 void LocalFrameClientImpl::AbortClientNavigation() { |
1005 if (web_frame_->Client()) | 1032 if (web_frame_->Client()) |
1006 web_frame_->Client()->AbortClientNavigation(); | 1033 web_frame_->Client()->AbortClientNavigation(); |
1007 } | 1034 } |
1008 | 1035 |
1009 TextCheckerClient& LocalFrameClientImpl::GetTextCheckerClient() const { | 1036 TextCheckerClient& LocalFrameClientImpl::GetTextCheckerClient() const { |
1010 return web_frame_->GetTextCheckerClient(); | 1037 return web_frame_->GetTextCheckerClient(); |
1011 } | 1038 } |
1012 | 1039 |
1013 } // namespace blink | 1040 } // namespace blink |
OLD | NEW |