Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1624583003: Reload Lo-Fi images inline instead of reloading the whole page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added comment Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 0fc35cb87d037f9f330bc1da25ca7754801db471..30ee8e4b1b1a08d7f8b9f3e5ae71cc31edc69816 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1393,6 +1393,7 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets,
OnSetEditableSelectionOffsets)
IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload)
+ IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages)
IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest,
OnTextSurroundingSelectionRequest)
IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode,
@@ -2130,6 +2131,11 @@ void RenderFrameImpl::OnReload(bool ignore_cache) {
frame_->reload(ignore_cache);
}
+void RenderFrameImpl::OnReloadLoFiImages() {
+ is_using_lofi_ = false;
+ GetWebFrame()->reloadLoFiImages();
+}
+
void RenderFrameImpl::OnTextSurroundingSelectionRequest(size_t max_length) {
blink::WebSurroundingText surroundingText;
surroundingText.initialize(frame_->selectionRange(), max_length);
@@ -3133,9 +3139,13 @@ void RenderFrameImpl::didCommitProvisionalLoad(
DocumentState::FromDataSource(frame->dataSource());
NavigationStateImpl* navigation_state =
static_cast<NavigationStateImpl*>(document_state->navigation_state());
- WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(
- frame->dataSource()->response());
- is_using_lofi_ = extra_data && extra_data->is_using_lofi();
+ WebURLResponseExtraDataImpl* extra_data =
+ GetExtraDataFromResponse(frame->dataSource()->response());
+ // Only update LoFi state for new main frame documents. Subframes inherit from
+ // the main frame and should not change at commit time.
+ if (is_main_frame_ && !navigation_state->WasWithinSamePage()) {
+ is_using_lofi_ = extra_data && extra_data->is_using_lofi();
+ }
if (proxy_routing_id_ != MSG_ROUTING_NONE) {
RenderFrameProxy* proxy =
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_frame_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698