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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2898423002: Reset scroll and scale while toggling "Request desktop site" (Closed)
Patch Set: WebView bug Created 3 years, 6 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 | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 9c44ea096cfe65ca06e8f72f9ffe4dd8d87782dc..899803fbcab671b616e08614bef61513caf3d97d 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -80,6 +80,7 @@
#include "core/layout/TextAutosizer.h"
#include "core/layout/api/LayoutViewItem.h"
#include "core/layout/compositing/PaintLayerCompositor.h"
+#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoadRequest.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderStateMachine.h"
@@ -3285,6 +3286,14 @@ void WebViewImpl::ResetScrollAndScaleState() {
scrollable_area->SetScrollOffset(ScrollOffset(), kProgrammaticScroll);
}
+ if (Document* document =
+ ToLocalFrame(GetPage()->MainFrame())->GetDocument()) {
+ if (DocumentLoader* loader = document->Loader()) {
+ if (HistoryItem* item = loader->GetHistoryItem())
+ item->SetDidSaveScrollOrScaleState(false);
+ }
+ }
+
GetPageScaleConstraintsSet().SetNeedsReset(true);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698