| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, | 1582 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, |
| 1583 OnSetFrameOwnerProperties) | 1583 OnSetFrameOwnerProperties) |
| 1584 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) | 1584 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) |
| 1585 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) | 1585 IPC_MESSAGE_HANDLER(FrameMsg_SetFocusedFrame, OnSetFocusedFrame) |
| 1586 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, | 1586 IPC_MESSAGE_HANDLER(FrameMsg_SetTextTrackSettings, |
| 1587 OnTextTrackSettingsChanged) | 1587 OnTextTrackSettingsChanged) |
| 1588 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) | 1588 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) |
| 1589 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) | 1589 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) |
| 1590 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation, | 1590 IPC_MESSAGE_HANDLER(FrameMsg_ReportContentSecurityPolicyViolation, |
| 1591 OnReportContentSecurityPolicyViolation) | 1591 OnReportContentSecurityPolicyViolation) |
| 1592 IPC_MESSAGE_HANDLER(FrameMsg_DroppedNavigation, OnDroppedNavigation) |
| 1592 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, | 1593 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, |
| 1593 OnGetSavableResourceLinks) | 1594 OnGetSavableResourceLinks) |
| 1594 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, | 1595 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, |
| 1595 OnGetSerializedHtmlWithLocalLinks) | 1596 OnGetSerializedHtmlWithLocalLinks) |
| 1596 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) | 1597 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) |
| 1597 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) | 1598 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) |
| 1598 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) | 1599 IPC_MESSAGE_HANDLER(FrameMsg_ClearActiveFindMatch, OnClearActiveFindMatch) |
| 1599 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) | 1600 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) |
| 1600 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) | 1601 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
| 1601 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, | 1602 IPC_MESSAGE_HANDLER(FrameMsg_SuppressFurtherDialogs, |
| (...skipping 3703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5305 | 5306 |
| 5306 browser_side_navigation_pending_ = false; | 5307 browser_side_navigation_pending_ = false; |
| 5307 } | 5308 } |
| 5308 | 5309 |
| 5309 void RenderFrameImpl::OnReportContentSecurityPolicyViolation( | 5310 void RenderFrameImpl::OnReportContentSecurityPolicyViolation( |
| 5310 const content::CSPViolationParams& violation_params) { | 5311 const content::CSPViolationParams& violation_params) { |
| 5311 frame_->reportContentSecurityPolicyViolation( | 5312 frame_->reportContentSecurityPolicyViolation( |
| 5312 BuildWebContentSecurityPolicyViolation(violation_params)); | 5313 BuildWebContentSecurityPolicyViolation(violation_params)); |
| 5313 } | 5314 } |
| 5314 | 5315 |
| 5316 void RenderFrameImpl::OnDroppedNavigation(int navigation_id) { |
| 5317 // Check that the navigation dropped was the last one sent to the browser |
| 5318 // process. If not, do nothing as the browser process still has some more |
| 5319 // navigations to process. |
| 5320 if (navigation_id != navigation_id_) |
| 5321 return; |
| 5322 browser_side_navigation_pending_ = false; |
| 5323 frame_->clientDroppedNavigation(); |
| 5324 } |
| 5325 |
| 5315 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( | 5326 WebNavigationPolicy RenderFrameImpl::decidePolicyForNavigation( |
| 5316 const NavigationPolicyInfo& info) { | 5327 const NavigationPolicyInfo& info) { |
| 5317 // A content initiated navigation may have originated from a link-click, | 5328 // A content initiated navigation may have originated from a link-click, |
| 5318 // script, drag-n-drop operation, etc. | 5329 // script, drag-n-drop operation, etc. |
| 5319 // info.extraData is only non-null if this is a redirect. Use the extraData | 5330 // info.extraData is only non-null if this is a redirect. Use the extraData |
| 5320 // initiation information for redirects, and check pending_navigation_params_ | 5331 // initiation information for redirects, and check pending_navigation_params_ |
| 5321 // otherwise. | 5332 // otherwise. |
| 5322 bool is_content_initiated = | 5333 bool is_content_initiated = |
| 5323 info.extraData | 5334 info.extraData |
| 5324 ? static_cast<DocumentState*>(info.extraData) | 5335 ? static_cast<DocumentState*>(info.extraData) |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6392 info.navigationType == blink::WebNavigationTypeFormSubmitted || | 6403 info.navigationType == blink::WebNavigationTypeFormSubmitted || |
| 6393 info.navigationType == blink::WebNavigationTypeFormResubmitted; | 6404 info.navigationType == blink::WebNavigationTypeFormResubmitted; |
| 6394 | 6405 |
| 6395 BeginNavigationParams begin_navigation_params( | 6406 BeginNavigationParams begin_navigation_params( |
| 6396 GetWebURLRequestHeaders(info.urlRequest), load_flags, | 6407 GetWebURLRequestHeaders(info.urlRequest), load_flags, |
| 6397 info.urlRequest.hasUserGesture(), | 6408 info.urlRequest.hasUserGesture(), |
| 6398 info.urlRequest.getServiceWorkerMode() != | 6409 info.urlRequest.getServiceWorkerMode() != |
| 6399 blink::WebURLRequest::ServiceWorkerMode::All, | 6410 blink::WebURLRequest::ServiceWorkerMode::All, |
| 6400 GetRequestContextTypeForWebURLRequest(info.urlRequest), | 6411 GetRequestContextTypeForWebURLRequest(info.urlRequest), |
| 6401 GetMixedContentContextTypeForWebURLRequest(info.urlRequest), | 6412 GetMixedContentContextTypeForWebURLRequest(info.urlRequest), |
| 6402 is_form_submission, initiator_origin); | 6413 is_form_submission, initiator_origin, ++navigation_id_); |
| 6403 | 6414 |
| 6404 if (!info.form.isNull()) { | 6415 if (!info.form.isNull()) { |
| 6405 WebSearchableFormData web_searchable_form_data(info.form); | 6416 WebSearchableFormData web_searchable_form_data(info.form); |
| 6406 begin_navigation_params.searchable_form_url = | 6417 begin_navigation_params.searchable_form_url = |
| 6407 web_searchable_form_data.url(); | 6418 web_searchable_form_data.url(); |
| 6408 begin_navigation_params.searchable_form_encoding = | 6419 begin_navigation_params.searchable_form_encoding = |
| 6409 web_searchable_form_data.encoding().utf8(); | 6420 web_searchable_form_data.encoding().utf8(); |
| 6410 } | 6421 } |
| 6411 | 6422 |
| 6412 if (info.isClientRedirect) | 6423 if (info.isClientRedirect) |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6970 policy(info.defaultPolicy), | 6981 policy(info.defaultPolicy), |
| 6971 replaces_current_history_item(info.replacesCurrentHistoryItem), | 6982 replaces_current_history_item(info.replacesCurrentHistoryItem), |
| 6972 history_navigation_in_new_child_frame( | 6983 history_navigation_in_new_child_frame( |
| 6973 info.isHistoryNavigationInNewChildFrame), | 6984 info.isHistoryNavigationInNewChildFrame), |
| 6974 client_redirect(info.isClientRedirect), | 6985 client_redirect(info.isClientRedirect), |
| 6975 cache_disabled(info.isCacheDisabled), | 6986 cache_disabled(info.isCacheDisabled), |
| 6976 form(info.form), | 6987 form(info.form), |
| 6977 source_location(info.sourceLocation) {} | 6988 source_location(info.sourceLocation) {} |
| 6978 | 6989 |
| 6979 } // namespace content | 6990 } // namespace content |
| OLD | NEW |