summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authoraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-25 22:43:26 +0000
committeraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-25 22:43:26 +0000
commitb06cf8652c19434c4267c28cbd30debb8c5ba224 (patch)
tree939b959471f68c387e02651032cff5089aaf533d /webkit/glue
parentcf388e8b0332b79fbc37881170c0c864733bff4a (diff)
downloadchromium_src-b06cf8652c19434c4267c28cbd30debb8c5ba224.zip
chromium_src-b06cf8652c19434c4267c28cbd30debb8c5ba224.tar.gz
chromium_src-b06cf8652c19434c4267c28cbd30debb8c5ba224.tar.bz2
Backwards compatibility with HistoryItems with old page scale.
Given the semantic change in page scale, users upgrading from M18 would find their existing tabs all zoomed in at a weird scroll offset. Add some more backwards compatibility cruft to compensate. NOTRY=true BUG=175807 Review URL: https://chromiumcodereview.appspot.com/12297020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/glue_serialize.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/webkit/glue/glue_serialize.cc b/webkit/glue/glue_serialize.cc
index e9d3ae4..cfe9330 100644
--- a/webkit/glue/glue_serialize.cc
+++ b/webkit/glue/glue_serialize.cc
@@ -17,6 +17,7 @@
#include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebHistoryItem.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptValue.h"
+#include "ui/gfx/screen.h"
#include "webkit/base/file_path_string_conversions.h"
using WebKit::WebData;
@@ -456,11 +457,23 @@ WebHistoryItem ReadHistoryItem(
}
#if defined(OS_ANDROID)
- // Now-unused values that shipped in this version of Chrome for Android when
- // it was on a private branch.
if (obj->version == 11) {
+ // Now-unused values that shipped in this version of Chrome for Android when
+ // it was on a private branch.
ReadReal(obj);
ReadBoolean(obj);
+
+ // In this version, pageScaleFactor included deviceScaleFactor and scroll
+ // offsets were premultiplied by pageScaleFactor.
+ if (item.pageScaleFactor()) {
+ if (include_scroll_offset)
+ item.setScrollOffset(
+ WebPoint(item.scrollOffset().x / item.pageScaleFactor(),
+ item.scrollOffset().y / item.pageScaleFactor()));
+ item.setPageScaleFactor(item.pageScaleFactor() /
+ gfx::Screen::GetNativeScreen()->GetPrimaryDisplay()
+ .device_scale_factor());
+ }
}
#endif