summaryrefslogtreecommitdiffstats
path: root/ios
diff options
context:
space:
mode:
authoreugenebut <eugenebut@chromium.org>2016-03-25 14:42:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-25 21:45:30 +0000
commite3cc7bce01caf52aad5eb6d83787eae8499231b6 (patch)
treee0a1715066f82b02e250481cf1554076490c5699 /ios
parent1275d3aca4b5dab9bdaeac8255fd54fe58649182 (diff)
downloadchromium_src-e3cc7bce01caf52aad5eb6d83787eae8499231b6.zip
chromium_src-e3cc7bce01caf52aad5eb6d83787eae8499231b6.tar.gz
chromium_src-e3cc7bce01caf52aad5eb6d83787eae8499231b6.tar.bz2
[ios] Removed PageZoomState::IsLegacyFormat as unneeded.
BUG=579697 Review URL: https://codereview.chromium.org/1791443003 Cr-Commit-Position: refs/heads/master@{#383372}
Diffstat (limited to 'ios')
-rw-r--r--ios/web/public/web_state/page_display_state.h6
-rw-r--r--ios/web/public/web_state/page_display_state.mm8
-rw-r--r--ios/web/web_state/ui/crw_web_controller.mm2
-rw-r--r--ios/web/web_state/ui/crw_wk_web_view_web_controller.mm3
4 files changed, 2 insertions, 17 deletions
diff --git a/ios/web/public/web_state/page_display_state.h b/ios/web/public/web_state/page_display_state.h
index 7098e2f..a9e8802 100644
--- a/ios/web/public/web_state/page_display_state.h
+++ b/ios/web/public/web_state/page_display_state.h
@@ -53,12 +53,6 @@ class PageZoomState {
// are NAN and the zoom scale is greater than zero.
bool IsValid() const;
- // PageScrollStates restored from the legacy serialization format make
- // assumptions about the web view's implementation of zooming, and contain a
- // non-NAN zoom scale and a NAN minimum and maximum scale. Legacy zoom scales
- // can only be applied to CRWUIWebViewWebControllers.
- bool IsLegacyFormat() const;
-
// Returns the allowed zoom scale range for this scroll state.
double GetMinMaxZoomDifference() const {
return maximum_zoom_scale_ - minimum_zoom_scale_;
diff --git a/ios/web/public/web_state/page_display_state.mm b/ios/web/public/web_state/page_display_state.mm
index 6837ecb..0c8a9ce 100644
--- a/ios/web/public/web_state/page_display_state.mm
+++ b/ios/web/public/web_state/page_display_state.mm
@@ -56,18 +56,12 @@ PageZoomState::~PageZoomState() {
}
bool PageZoomState::IsValid() const {
- return IsLegacyFormat() ||
- (!std::isnan(minimum_zoom_scale_) &&
+ return (!std::isnan(minimum_zoom_scale_) &&
!std::isnan(maximum_zoom_scale_) && !std::isnan(zoom_scale_) &&
zoom_scale_ >= minimum_zoom_scale_ &&
zoom_scale_ <= maximum_zoom_scale_);
}
-bool PageZoomState::IsLegacyFormat() const {
- return std::isnan(minimum_zoom_scale_) && std::isnan(maximum_zoom_scale_) &&
- zoom_scale_ > 0.0;
-}
-
bool PageZoomState::operator==(const PageZoomState& other) const {
return StateValuesAreEqual(minimum_zoom_scale_, other.minimum_zoom_scale_) &&
StateValuesAreEqual(maximum_zoom_scale_, other.maximum_zoom_scale_) &&
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 8739d22..d47b34a 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -3250,7 +3250,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
_applyingPageState = YES;
web::PageZoomState zoomState =
currentItem->GetPageDisplayState().zoom_state();
- if (!zoomState.IsValid() || zoomState.IsLegacyFormat())
+ if (!zoomState.IsValid())
zoomState = web::PageZoomState(1.0, 1.0, 1.0);
[self applyWebViewScrollZoomScaleFromZoomState:zoomState];
_applyingPageState = NO;
diff --git a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
index e4c28c9..b451ff1 100644
--- a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
+++ b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
@@ -699,9 +699,6 @@ WKWebViewErrorSource WKWebViewErrorSourceFromError(NSError* error) {
// meta tags of a page may have changed since the state was recorded, so clamp
// the zoom scale to the current range if necessary.
DCHECK(zoomState.IsValid());
- // Legacy-format scroll states cannot be applied to WKWebViews.
- if (zoomState.IsLegacyFormat())
- return;
CGFloat zoomScale = zoomState.zoom_scale();
if (zoomScale < self.webScrollView.minimumZoomScale)
zoomScale = self.webScrollView.minimumZoomScale;