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

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: adding blink test Created 4 years, 11 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
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index cb739dca7562b993b53bea655cea39e2fdbf156f..3e5d16517db09178b6b787473760131f314dc43d 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1316,6 +1316,7 @@ bool RenderFrameImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(FrameMsg_ContextMenuClosed, OnContextMenuClosed)
IPC_MESSAGE_HANDLER(FrameMsg_CustomContextMenuAction,
OnCustomContextMenuAction)
+ IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages)
IPC_MESSAGE_HANDLER(InputMsg_Undo, OnUndo)
IPC_MESSAGE_HANDLER(InputMsg_Redo, OnRedo)
IPC_MESSAGE_HANDLER(InputMsg_Cut, OnCut)
@@ -1646,6 +1647,11 @@ void RenderFrameImpl::OnCustomContextMenuAction(
}
}
+void RenderFrameImpl::OnReloadLoFiImages() {
+ is_using_lofi_ = false;
Charlie Reis 2016/01/29 23:01:12 This line is surprising to me, since this CL isn't
megjablon 2016/01/29 23:22:23 There is no other state to update. This is the onl
Charlie Reis 2016/01/29 23:52:00 As in web_contents.h, a comment (perhaps in frame_
+ GetWebFrame()->reloadLoFiImages();
+}
+
void RenderFrameImpl::OnUndo() {
frame_->executeCommand(WebString::fromUTF8("Undo"), GetFocusedElement());
}
@@ -3085,7 +3091,9 @@ void RenderFrameImpl::didCommitProvisionalLoad(
static_cast<NavigationStateImpl*>(document_state->navigation_state());
WebURLResponseExtraDataImpl* extra_data = GetExtraDataFromResponse(
frame->dataSource()->response());
- is_using_lofi_ = extra_data && extra_data->is_using_lofi();
+ if (is_main_frame_ && !navigation_state->WasWithinSamePage()) {
Charlie Reis 2016/01/29 23:01:12 This looks unrelated to the rest of the CL, and it
megjablon 2016/01/29 23:22:23 The initial intention was this behavior. Children
Charlie Reis 2016/01/29 23:52:00 Sorry, I'm not following. If I understand correct
megjablon 2016/01/30 08:30:09 The first paragraph you're describing is the only
Charlie Reis 2016/02/01 22:12:00 Ok, thanks. I'd recommend adding a test for that
megjablon 2016/02/04 02:37:26 Done.
+ is_using_lofi_ = extra_data && extra_data->is_using_lofi();
+ }
if (proxy_routing_id_ != MSG_ROUTING_NONE) {
RenderFrameProxy* proxy =

Powered by Google App Engine
This is Rietveld 408576698