| 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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 OnJavaScriptExecuteRequest) | 1386 OnJavaScriptExecuteRequest) |
| 1387 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, | 1387 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, |
| 1388 OnJavaScriptExecuteRequestForTests) | 1388 OnJavaScriptExecuteRequestForTests) |
| 1389 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld, | 1389 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld, |
| 1390 OnJavaScriptExecuteRequestInIsolatedWorld) | 1390 OnJavaScriptExecuteRequestInIsolatedWorld) |
| 1391 IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest, | 1391 IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest, |
| 1392 OnVisualStateRequest) | 1392 OnVisualStateRequest) |
| 1393 IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets, | 1393 IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets, |
| 1394 OnSetEditableSelectionOffsets) | 1394 OnSetEditableSelectionOffsets) |
| 1395 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 1395 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
| 1396 IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages) |
| 1396 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 1397 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
| 1397 OnTextSurroundingSelectionRequest) | 1398 OnTextSurroundingSelectionRequest) |
| 1398 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, | 1399 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, |
| 1399 OnSetAccessibilityMode) | 1400 OnSetAccessibilityMode) |
| 1400 IPC_MESSAGE_HANDLER(AccessibilityMsg_SnapshotTree, | 1401 IPC_MESSAGE_HANDLER(AccessibilityMsg_SnapshotTree, |
| 1401 OnSnapshotAccessibilityTree) | 1402 OnSnapshotAccessibilityTree) |
| 1402 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) | 1403 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) |
| 1403 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) | 1404 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) |
| 1404 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 1405 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
| 1405 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, | 1406 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2123 source_frame, | 2124 source_frame, |
| 2124 frame_->document(), | 2125 frame_->document(), |
| 2125 channels); | 2126 channels); |
| 2126 frame_->dispatchMessageEventWithOriginCheck(target_origin, msg_event); | 2127 frame_->dispatchMessageEventWithOriginCheck(target_origin, msg_event); |
| 2127 } | 2128 } |
| 2128 | 2129 |
| 2129 void RenderFrameImpl::OnReload(bool ignore_cache) { | 2130 void RenderFrameImpl::OnReload(bool ignore_cache) { |
| 2130 frame_->reload(ignore_cache); | 2131 frame_->reload(ignore_cache); |
| 2131 } | 2132 } |
| 2132 | 2133 |
| 2134 void RenderFrameImpl::OnReloadLoFiImages() { |
| 2135 is_using_lofi_ = false; |
| 2136 GetWebFrame()->reloadLoFiImages(); |
| 2137 } |
| 2138 |
| 2133 void RenderFrameImpl::OnTextSurroundingSelectionRequest(size_t max_length) { | 2139 void RenderFrameImpl::OnTextSurroundingSelectionRequest(size_t max_length) { |
| 2134 blink::WebSurroundingText surroundingText; | 2140 blink::WebSurroundingText surroundingText; |
| 2135 surroundingText.initialize(frame_->selectionRange(), max_length); | 2141 surroundingText.initialize(frame_->selectionRange(), max_length); |
| 2136 | 2142 |
| 2137 if (surroundingText.isNull()) { | 2143 if (surroundingText.isNull()) { |
| 2138 // |surroundingText| might not be correctly initialized, for example if | 2144 // |surroundingText| might not be correctly initialized, for example if |
| 2139 // |frame_->selectionRange().isNull()|, in other words, if there was no | 2145 // |frame_->selectionRange().isNull()|, in other words, if there was no |
| 2140 // selection. | 2146 // selection. |
| 2141 Send(new FrameHostMsg_TextSurroundingSelectionResponse( | 2147 Send(new FrameHostMsg_TextSurroundingSelectionResponse( |
| 2142 routing_id_, base::string16(), 0, 0)); | 2148 routing_id_, base::string16(), 0, 0)); |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3126 const blink::WebHistoryItem& item, | 3132 const blink::WebHistoryItem& item, |
| 3127 blink::WebHistoryCommitType commit_type) { | 3133 blink::WebHistoryCommitType commit_type) { |
| 3128 TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad", | 3134 TRACE_EVENT2("navigation", "RenderFrameImpl::didCommitProvisionalLoad", |
| 3129 "id", routing_id_, | 3135 "id", routing_id_, |
| 3130 "url", GetLoadingUrl().possibly_invalid_spec()); | 3136 "url", GetLoadingUrl().possibly_invalid_spec()); |
| 3131 DCHECK(!frame_ || frame_ == frame); | 3137 DCHECK(!frame_ || frame_ == frame); |
| 3132 DocumentState* document_state = | 3138 DocumentState* document_state = |
| 3133 DocumentState::FromDataSource(frame->dataSource()); | 3139 DocumentState::FromDataSource(frame->dataSource()); |
| 3134 NavigationStateImpl* navigation_state = | 3140 NavigationStateImpl* navigation_state = |
| 3135 static_cast<NavigationStateImpl*>(document_state->navigation_state()); | 3141 static_cast<NavigationStateImpl*>(document_state->navigation_state()); |
| 3136 WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse( | 3142 WebURLResponseExtraDataImpl* extra_data = |
| 3137 frame->dataSource()->response()); | 3143 GetExtraDataFromResponse(frame->dataSource()->response()); |
| 3138 is_using_lofi_ = extra_data && extra_data->is_using_lofi(); | 3144 // Only update LoFi state for new main frame documents. Subframes inherit from |
| 3145 // the main frame and should not change at commit time. |
| 3146 if (is_main_frame_ && !navigation_state->WasWithinSamePage()) { |
| 3147 is_using_lofi_ = extra_data && extra_data->is_using_lofi(); |
| 3148 } |
| 3139 | 3149 |
| 3140 if (proxy_routing_id_ != MSG_ROUTING_NONE) { | 3150 if (proxy_routing_id_ != MSG_ROUTING_NONE) { |
| 3141 RenderFrameProxy* proxy = | 3151 RenderFrameProxy* proxy = |
| 3142 RenderFrameProxy::FromRoutingID(proxy_routing_id_); | 3152 RenderFrameProxy::FromRoutingID(proxy_routing_id_); |
| 3143 | 3153 |
| 3144 // The proxy might have been detached while the provisional LocalFrame was | 3154 // The proxy might have been detached while the provisional LocalFrame was |
| 3145 // being navigated. In that case, don't swap the frame back in the tree | 3155 // being navigated. In that case, don't swap the frame back in the tree |
| 3146 // and return early (to avoid sending confusing IPCs to the browser | 3156 // and return early (to avoid sending confusing IPCs to the browser |
| 3147 // process). See https://crbug.com/526304 and https://crbug.com/568676. | 3157 // process). See https://crbug.com/526304 and https://crbug.com/568676. |
| 3148 // TODO(nasko, alexmos): Eventually, the browser process will send an IPC | 3158 // TODO(nasko, alexmos): Eventually, the browser process will send an IPC |
| (...skipping 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6097 int match_count, | 6107 int match_count, |
| 6098 int ordinal, | 6108 int ordinal, |
| 6099 const WebRect& selection_rect, | 6109 const WebRect& selection_rect, |
| 6100 bool final_status_update) { | 6110 bool final_status_update) { |
| 6101 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6111 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
| 6102 selection_rect, ordinal, | 6112 selection_rect, ordinal, |
| 6103 final_status_update)); | 6113 final_status_update)); |
| 6104 } | 6114 } |
| 6105 | 6115 |
| 6106 } // namespace content | 6116 } // namespace content |
| OLD | NEW |