summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-12 13:49:11 +0000
committermnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-12 13:49:11 +0000
commit68fe60ff51e006b604f2884e76ea5d91861b30d7 (patch)
tree54fc076177fdeb6149392357c364553770ae18cd
parent6ccd58c92931257602cdfa2bde06c02944570760 (diff)
downloadchromium_src-68fe60ff51e006b604f2884e76ea5d91861b30d7.zip
chromium_src-68fe60ff51e006b604f2884e76ea5d91861b30d7.tar.gz
chromium_src-68fe60ff51e006b604f2884e76ea5d91861b30d7.tar.bz2
Fix the cause of AwZoomTest#testMagnification... tests flakiness
AwContents maintains its own page scale value, which it receives synchronously from the compositor. However, it was still using page scale limits values from ContentViewCore, where they are updated async-ly. This was causing spurious wrong 'canZoomOut' results. Fixed by propagating page scale limits to AwContents together with page scale updates. It would be great to eliminate duplication of page scale values between ContentViewCore and AwContents though. Re-applied changes to the tests from https://codereview.chromium.org/143683005 as they still make sense. BUG=340327,340648 Review URL: https://codereview.chromium.org/156233005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250706 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--android_webview/browser/browser_view_renderer.h7
-rw-r--r--android_webview/browser/in_process_view_renderer.cc15
-rw-r--r--android_webview/browser/in_process_view_renderer.h5
-rw-r--r--android_webview/java/src/org/chromium/android_webview/AwContents.java30
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/AwZoomTest.java39
-rw-r--r--android_webview/native/aw_contents.cc11
-rw-r--r--android_webview/native/aw_contents.h5
-rw-r--r--cc/input/layer_scroll_offset_delegate.h7
-rw-r--r--cc/layers/layer_impl_unittest.cc10
-rw-r--r--cc/trees/layer_tree_host_impl_unittest.cc34
-rw-r--r--cc/trees/layer_tree_impl.cc20
-rw-r--r--content/browser/android/in_process/synchronous_compositor_impl.cc9
-rw-r--r--content/browser/android/in_process/synchronous_compositor_impl.h5
-rw-r--r--content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java15
-rw-r--r--content/public/browser/android/synchronous_compositor_client.h5
15 files changed, 139 insertions, 78 deletions
diff --git a/android_webview/browser/browser_view_renderer.h b/android_webview/browser/browser_view_renderer.h
index 4261f2b..951e5cc 100644
--- a/android_webview/browser/browser_view_renderer.h
+++ b/android_webview/browser/browser_view_renderer.h
@@ -54,8 +54,11 @@ class BrowserViewRenderer {
// Is a WebView-managed fling in progress?
virtual bool IsFlingActive() const = 0;
- // Set the current page scale to |page_scale_factor|.
- virtual void SetPageScaleFactor(float page_scale_factor) = 0;
+ // Set the current page scale to |page_scale_factor| and page scale limits
+ // to |min_page_scale_factor|..|max_page_scale_factor|.
+ virtual void SetPageScaleFactorAndLimits(float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) = 0;
// Set the current contents_size to |contents_size_dip|.
virtual void SetContentsSize(gfx::SizeF contents_size_dip) = 0;
diff --git a/android_webview/browser/in_process_view_renderer.cc b/android_webview/browser/in_process_view_renderer.cc
index 1becdf1..6b1e05c 100644
--- a/android_webview/browser/in_process_view_renderer.cc
+++ b/android_webview/browser/in_process_view_renderer.cc
@@ -852,8 +852,10 @@ void InProcessViewRenderer::SetTotalRootLayerScrollOffset(
DCHECK(0 <= scroll_offset.x());
DCHECK(0 <= scroll_offset.y());
- DCHECK(scroll_offset.x() <= max_offset.x());
- DCHECK(scroll_offset.y() <= max_offset.y());
+ // Disabled because the conditions are being violated while running
+ // AwZoomTest.testMagnification, see http://crbug.com/340648
+ // DCHECK(scroll_offset.x() <= max_offset.x());
+ // DCHECK(scroll_offset.y() <= max_offset.y());
client_->ScrollContainerViewTo(scroll_offset);
}
@@ -866,11 +868,14 @@ bool InProcessViewRenderer::IsExternalFlingActive() const {
return client_->IsFlingActive();
}
-void InProcessViewRenderer::SetRootLayerPageScaleFactor(
- float page_scale_factor) {
+void InProcessViewRenderer::SetRootLayerPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) {
page_scale_factor_ = page_scale_factor;
DCHECK_GT(page_scale_factor_, 0);
- client_->SetPageScaleFactor(page_scale_factor);
+ client_->SetPageScaleFactorAndLimits(
+ page_scale_factor, min_page_scale_factor, max_page_scale_factor);
}
void InProcessViewRenderer::SetRootLayerScrollableSize(
diff --git a/android_webview/browser/in_process_view_renderer.h b/android_webview/browser/in_process_view_renderer.h
index f7c4279..a53120e 100644
--- a/android_webview/browser/in_process_view_renderer.h
+++ b/android_webview/browser/in_process_view_renderer.h
@@ -87,7 +87,10 @@ class InProcessViewRenderer : public BrowserViewRenderer,
virtual void DidUpdateContent() OVERRIDE;
virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() OVERRIDE;
virtual bool IsExternalFlingActive() const OVERRIDE;
- virtual void SetRootLayerPageScaleFactor(float page_scale_factor) OVERRIDE;
+ virtual void SetRootLayerPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) OVERRIDE;
virtual void SetRootLayerScrollableSize(gfx::SizeF scrollable_size) OVERRIDE;
virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll,
gfx::Vector2dF latest_overscroll_delta,
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 408b8cc..4556782 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -182,9 +182,11 @@ public class AwContents {
private boolean mContainerViewFocused;
private boolean mWindowFocused;
- // These come from the compositor and are updated immediately (in contrast to the values in
+ // These come from the compositor and are updated synchronously (in contrast to the values in
// ContentViewCore, which are updated at end of every frame).
private float mPageScaleFactor = 1.0f;
+ private float mMinPageScaleFactor = 1.0f;
+ private float mMaxPageScaleFactor = 1.0f;
private float mContentWidthDip;
private float mContentHeightDip;
@@ -1398,8 +1400,7 @@ public class AwContents {
// This method uses the term 'zoom' for legacy reasons, but relates
// to what chrome calls the 'page scale factor'.
public boolean canZoomIn() {
- final float zoomInExtent = mContentViewCore.getRenderCoordinates().getMaxPageScaleFactor()
- - mPageScaleFactor;
+ final float zoomInExtent = mMaxPageScaleFactor - mPageScaleFactor;
return zoomInExtent > ZOOM_CONTROLS_EPSILON;
}
@@ -1409,8 +1410,7 @@ public class AwContents {
// This method uses the term 'zoom' for legacy reasons, but relates
// to what chrome calls the 'page scale factor'.
public boolean canZoomOut() {
- final float zoomOutExtent = mPageScaleFactor
- - mContentViewCore.getRenderCoordinates().getMinPageScaleFactor();
+ final float zoomOutExtent = mPageScaleFactor - mMinPageScaleFactor;
return zoomOutExtent > ZOOM_CONTROLS_EPSILON;
}
@@ -1899,13 +1899,21 @@ public class AwContents {
}
@CalledByNative
- private void setPageScaleFactor(float pageScaleFactor) {
- if (mPageScaleFactor == pageScaleFactor)
+ private void setPageScaleFactorAndLimits(
+ float pageScaleFactor, float minPageScaleFactor, float maxPageScaleFactor) {
+ if (mPageScaleFactor == pageScaleFactor &&
+ mMinPageScaleFactor == minPageScaleFactor &&
+ mMaxPageScaleFactor == maxPageScaleFactor)
return;
- float oldPageScaleFactor = mPageScaleFactor;
- mPageScaleFactor = pageScaleFactor;
- mContentsClient.getCallbackHelper().postOnScaleChangedScaled(
- (float) (oldPageScaleFactor * mDIPScale), (float) (mPageScaleFactor * mDIPScale));
+ mMinPageScaleFactor = minPageScaleFactor;
+ mMaxPageScaleFactor = maxPageScaleFactor;
+ if (mPageScaleFactor != pageScaleFactor) {
+ float oldPageScaleFactor = mPageScaleFactor;
+ mPageScaleFactor = pageScaleFactor;
+ mContentsClient.getCallbackHelper().postOnScaleChangedScaled(
+ (float)(oldPageScaleFactor * mDIPScale),
+ (float)(mPageScaleFactor * mDIPScale));
+ }
}
@CalledByNative
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwZoomTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwZoomTest.java
index 967792e..c0e193f 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwZoomTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwZoomTest.java
@@ -13,7 +13,6 @@ import android.view.ViewConfiguration;
import org.chromium.android_webview.AwContents;
import org.chromium.android_webview.AwSettings;
import org.chromium.base.ThreadUtils;
-import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import java.util.concurrent.Callable;
@@ -34,10 +33,14 @@ public class AwZoomTest extends AwTestBase {
mAwContents = testContainerView.getAwContents();
}
- private String getZoomableHtml() {
- return "<html><head><meta name=\"viewport\" content=\"" +
- "width=device-width, minimum-scale=0.5, maximum-scale=2.0, initial-scale=0.5" +
- "\"/></head><body>Zoomable</body></html>";
+ private String getZoomableHtml(float scale) {
+ final int divWidthPercent = (int)(100.0f / scale);
+ return String.format("<html><head><meta name=\"viewport\" content=\"" +
+ "width=device-width, minimum-scale=%f, maximum-scale=2.0, initial-scale=%f" +
+ "\"/></head><body style='margin:0'>" +
+ "<div style='width:%d%%;height:100px;border:1px solid black'>Zoomable</div>" +
+ "</body></html>",
+ scale, scale, divWidthPercent);
}
private String getNonZoomableHtml() {
@@ -119,11 +122,11 @@ public class AwZoomTest extends AwTestBase {
});
}
- private void waitUntilCanZoomIn() throws Throwable {
+ private void waitForScaleToBecome(final float expectedScale) throws Throwable {
poll(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
- return canZoomInOnUiThread(mAwContents);
+ return expectedScale == getScaleOnUiThread(mAwContents);
}
});
}
@@ -141,9 +144,10 @@ public class AwZoomTest extends AwTestBase {
private void runMagnificationTest() throws Throwable {
getAwSettingsOnUiThread(mAwContents).setUseWideViewPort(true);
assertFalse("Should not be able to zoom in", canZoomInOnUiThread(mAwContents));
+ final float pageMinimumScale = 0.5f;
loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
- getZoomableHtml(), "text/html", false);
- waitUntilCanZoomIn();
+ getZoomableHtml(pageMinimumScale), "text/html", false);
+ waitForScaleToBecome(pageMinimumScale);
assertTrue("Should be able to zoom in", canZoomInOnUiThread(mAwContents));
assertFalse("Should not be able to zoom out", canZoomOutOnUiThread(mAwContents));
@@ -158,25 +162,17 @@ public class AwZoomTest extends AwTestBase {
assertTrue("Should be able to zoom in", canZoomInOnUiThread(mAwContents));
}
- /*
@SmallTest
@Feature({"AndroidWebView"})
- crbug.com/340327
- */
- @DisabledTest
public void testMagnification() throws Throwable {
getAwSettingsOnUiThread(mAwContents).setSupportZoom(true);
runMagnificationTest();
}
- /*
// According to Android CTS test, zoomIn/Out must work
// even if supportZoom is turned off.
@SmallTest
@Feature({"AndroidWebView"})
- crbug.com/340327
- */
- @DisabledTest
public void testMagnificationWithZoomSupportOff() throws Throwable {
getAwSettingsOnUiThread(mAwContents).setSupportZoom(false);
runMagnificationTest();
@@ -187,7 +183,7 @@ public class AwZoomTest extends AwTestBase {
public void testZoomUsingMultiTouch() throws Throwable {
AwSettings webSettings = getAwSettingsOnUiThread(mAwContents);
loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
- getZoomableHtml(), "text/html", false);
+ getZoomableHtml(0.5f), "text/html", false);
assertTrue(webSettings.supportZoom());
assertFalse(webSettings.getBuiltInZoomControls());
@@ -206,9 +202,10 @@ public class AwZoomTest extends AwTestBase {
AwSettings webSettings = getAwSettingsOnUiThread(mAwContents);
webSettings.setUseWideViewPort(true);
assertFalse("Should not be able to zoom in", canZoomInOnUiThread(mAwContents));
+ final float pageMinimumScale = 0.5f;
loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
- getZoomableHtml(), "text/html", false);
- waitUntilCanZoomIn();
+ getZoomableHtml(pageMinimumScale), "text/html", false);
+ waitForScaleToBecome(pageMinimumScale);
// It must be possible to zoom in (or zoom out) for zoom controls to be shown
assertTrue("Should be able to zoom in", canZoomInOnUiThread(mAwContents));
@@ -253,7 +250,7 @@ public class AwZoomTest extends AwTestBase {
public void testZoomControlsOnOrientationChange() throws Throwable {
AwSettings webSettings = getAwSettingsOnUiThread(mAwContents);
loadDataSync(mAwContents, mContentsClient.getOnPageFinishedHelper(),
- getZoomableHtml(), "text/html", false);
+ getZoomableHtml(0.5f), "text/html", false);
assertTrue(webSettings.supportZoom());
webSettings.setBuiltInZoomControls(true);
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 074315a..5e73ed0 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -899,13 +899,20 @@ bool AwContents::IsFlingActive() const {
return Java_AwContents_isFlingActive(env, obj.obj());
}
-void AwContents::SetPageScaleFactor(float page_scale_factor) {
+void AwContents::SetPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
if (obj.is_null())
return;
- Java_AwContents_setPageScaleFactor(env, obj.obj(), page_scale_factor);
+ Java_AwContents_setPageScaleFactorAndLimits(env,
+ obj.obj(),
+ page_scale_factor,
+ min_page_scale_factor,
+ max_page_scale_factor);
}
void AwContents::SetContentsSize(gfx::SizeF contents_size_dip) {
diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h
index ed69b4b..1548981 100644
--- a/android_webview/native/aw_contents.h
+++ b/android_webview/native/aw_contents.h
@@ -165,7 +165,10 @@ class AwContents : public FindHelper::Listener,
gfx::Vector2d new_value) OVERRIDE;
virtual void ScrollContainerViewTo(gfx::Vector2d new_value) OVERRIDE;
virtual bool IsFlingActive() const OVERRIDE;
- virtual void SetPageScaleFactor(float page_scale_factor) OVERRIDE;
+ virtual void SetPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) OVERRIDE;
virtual void SetContentsSize(gfx::SizeF contents_size_dip) OVERRIDE;
virtual void DidOverscroll(gfx::Vector2d overscroll_delta) OVERRIDE;
diff --git a/cc/input/layer_scroll_offset_delegate.h b/cc/input/layer_scroll_offset_delegate.h
index 034daab..2da5f13 100644
--- a/cc/input/layer_scroll_offset_delegate.h
+++ b/cc/input/layer_scroll_offset_delegate.h
@@ -39,8 +39,11 @@ class LayerScrollOffsetDelegate {
virtual bool IsExternalFlingActive() const = 0;
// This is called by the compositor to notify the delegate what is the current
- // page scale factor is.
- virtual void SetTotalPageScaleFactor(float page_scale_factor) = 0;
+ // page scale factor and limits are.
+ virtual void SetTotalPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) = 0;
// This is called by the compositor to notify the delegate what is the layer's
// scrollable size is.
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index 33bd297..5796e98 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -491,7 +491,10 @@ class ScrollDelegateIgnore : public LayerScrollOffsetDelegate {
fixed_offset_ = fixed_offset;
}
- virtual void SetTotalPageScaleFactor(float page_scale_factor) OVERRIDE {}
+ virtual void SetTotalPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) OVERRIDE {}
virtual void SetScrollableSize(const gfx::SizeF& scrollable_size) OVERRIDE {}
private:
@@ -542,7 +545,10 @@ class ScrollDelegateAccept : public LayerScrollOffsetDelegate {
return current_offset_;
}
virtual bool IsExternalFlingActive() const OVERRIDE { return false; }
- virtual void SetTotalPageScaleFactor(float page_scale_factor) OVERRIDE {}
+ virtual void SetTotalPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) OVERRIDE {}
virtual void SetScrollableSize(const gfx::SizeF& scrollable_size) OVERRIDE {}
private:
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 448ac56..56eaecc 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -2686,7 +2686,10 @@ TEST_F(LayerTreeHostImplTest, ScrollScaledLayer) {
class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate {
public:
- TestScrollOffsetDelegate() : page_scale_factor_(0.f) {}
+ TestScrollOffsetDelegate()
+ : page_scale_factor_(0.f),
+ min_page_scale_factor_(-1.f),
+ max_page_scale_factor_(-1.f) {}
virtual ~TestScrollOffsetDelegate() {}
@@ -2705,8 +2708,13 @@ class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate {
virtual bool IsExternalFlingActive() const OVERRIDE { return false; }
- virtual void SetTotalPageScaleFactor(float page_scale_factor) OVERRIDE {
+ virtual void SetTotalPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) OVERRIDE {
page_scale_factor_ = page_scale_factor;
+ min_page_scale_factor_ = min_page_scale_factor;
+ max_page_scale_factor_ = max_page_scale_factor;
}
virtual void SetScrollableSize(const gfx::SizeF& scrollable_size) OVERRIDE {
@@ -2733,12 +2741,22 @@ class TestScrollOffsetDelegate : public LayerScrollOffsetDelegate {
return page_scale_factor_;
}
+ float min_page_scale_factor() const {
+ return min_page_scale_factor_;
+ }
+
+ float max_page_scale_factor() const {
+ return max_page_scale_factor_;
+ }
+
private:
gfx::Vector2dF last_set_scroll_offset_;
gfx::Vector2dF getter_return_value_;
gfx::Vector2dF max_scroll_offset_;
gfx::SizeF scrollable_size_;
float page_scale_factor_;
+ float min_page_scale_factor_;
+ float max_page_scale_factor_;
};
TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
@@ -2756,20 +2774,28 @@ TEST_F(LayerTreeHostImplTest, RootLayerScrollOffsetDelegation) {
EXPECT_EQ(initial_scroll_delta.ToString(),
scroll_delegate.last_set_scroll_offset().ToString());
- // Setting the delegate results in the scrollable_size, max_scroll_offset and
- // page_scale being set.
+ // Setting the delegate results in the scrollable_size, max_scroll_offset,
+ // page_scale_factor and {min|max}_page_scale_factor being set.
EXPECT_EQ(gfx::SizeF(100, 100), scroll_delegate.scrollable_size());
EXPECT_EQ(gfx::Vector2dF(90, 80), scroll_delegate.max_scroll_offset());
EXPECT_EQ(1.f, scroll_delegate.page_scale_factor());
+ EXPECT_EQ(0.f, scroll_delegate.min_page_scale_factor());
+ EXPECT_EQ(0.f, scroll_delegate.max_page_scale_factor());
// Updating page scale immediately updates the delegate.
host_impl_->active_tree()->SetPageScaleFactorAndLimits(2.f, 0.5f, 4.f);
EXPECT_EQ(2.f, scroll_delegate.page_scale_factor());
+ EXPECT_EQ(0.5f, scroll_delegate.min_page_scale_factor());
+ EXPECT_EQ(4.f, scroll_delegate.max_page_scale_factor());
host_impl_->active_tree()->SetPageScaleDelta(1.5f);
EXPECT_EQ(3.f, scroll_delegate.page_scale_factor());
+ EXPECT_EQ(0.5f, scroll_delegate.min_page_scale_factor());
+ EXPECT_EQ(4.f, scroll_delegate.max_page_scale_factor());
host_impl_->active_tree()->SetPageScaleDelta(1.f);
host_impl_->active_tree()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
EXPECT_EQ(1.f, scroll_delegate.page_scale_factor());
+ EXPECT_EQ(0.5f, scroll_delegate.min_page_scale_factor());
+ EXPECT_EQ(4.f, scroll_delegate.max_page_scale_factor());
// Scrolling should be relative to the offset as returned by the delegate.
gfx::Vector2dF scroll_delta(0.f, 10.f);
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index dfffb82..309939d 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -57,7 +57,7 @@ class LayerScrollOffsetDelegateProxy : public LayerScrollOffsetDelegate {
NOTIMPLEMENTED();
}
- virtual void SetTotalPageScaleFactor(float scale) OVERRIDE {
+ virtual void SetTotalPageScaleFactorAndLimits(float, float, float) OVERRIDE {
NOTIMPLEMENTED();
}
@@ -303,8 +303,10 @@ void LayerTreeImpl::SetPageScaleFactorAndLimits(float page_scale_factor,
page_scale_factor_ = page_scale_factor;
if (root_layer_scroll_offset_delegate_) {
- root_layer_scroll_offset_delegate_->SetTotalPageScaleFactor(
- total_page_scale_factor());
+ root_layer_scroll_offset_delegate_->SetTotalPageScaleFactorAndLimits(
+ total_page_scale_factor(),
+ this->min_page_scale_factor(),
+ this->max_page_scale_factor());
}
ForceScrollbarParameterUpdateAfterScaleChange(page_scale_layer());
@@ -335,8 +337,10 @@ void LayerTreeImpl::SetPageScaleDelta(float delta) {
set_needs_update_draw_properties();
if (root_layer_scroll_offset_delegate_) {
- root_layer_scroll_offset_delegate_->SetTotalPageScaleFactor(
- total_page_scale_factor());
+ root_layer_scroll_offset_delegate_->SetTotalPageScaleFactorAndLimits(
+ total_page_scale_factor(),
+ min_page_scale_factor(),
+ max_page_scale_factor());
}
}
@@ -777,8 +781,10 @@ void LayerTreeImpl::SetRootLayerScrollOffsetDelegate(
root_layer_scroll_offset_delegate_->SetMaxScrollOffset(
TotalMaxScrollOffset());
root_layer_scroll_offset_delegate_->SetScrollableSize(ScrollableSize());
- root_layer_scroll_offset_delegate_->SetTotalPageScaleFactor(
- total_page_scale_factor());
+ root_layer_scroll_offset_delegate_->SetTotalPageScaleFactorAndLimits(
+ total_page_scale_factor(),
+ min_page_scale_factor(),
+ max_page_scale_factor());
if (inner_viewport_scroll_layer_) {
inner_viewport_scroll_delegate_proxy_ = make_scoped_ptr(
diff --git a/content/browser/android/in_process/synchronous_compositor_impl.cc b/content/browser/android/in_process/synchronous_compositor_impl.cc
index 95289805..7b0b331 100644
--- a/content/browser/android/in_process/synchronous_compositor_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_impl.cc
@@ -239,11 +239,14 @@ bool SynchronousCompositorImpl::IsExternalFlingActive() const {
return false;
}
-void SynchronousCompositorImpl::SetTotalPageScaleFactor(
- float page_scale_factor) {
+void SynchronousCompositorImpl::SetTotalPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) {
DCHECK(CalledOnValidThread());
if (compositor_client_)
- compositor_client_->SetRootLayerPageScaleFactor(page_scale_factor);
+ compositor_client_->SetRootLayerPageScaleFactorAndLimits(
+ page_scale_factor, min_page_scale_factor, max_page_scale_factor);
}
void SynchronousCompositorImpl::SetScrollableSize(
diff --git a/content/browser/android/in_process/synchronous_compositor_impl.h b/content/browser/android/in_process/synchronous_compositor_impl.h
index 3cf1b61..95320c9 100644
--- a/content/browser/android/in_process/synchronous_compositor_impl.h
+++ b/content/browser/android/in_process/synchronous_compositor_impl.h
@@ -78,7 +78,10 @@ class SynchronousCompositorImpl
virtual void SetTotalScrollOffset(const gfx::Vector2dF& new_value) OVERRIDE;
virtual gfx::Vector2dF GetTotalScrollOffset() OVERRIDE;
virtual bool IsExternalFlingActive() const OVERRIDE;
- virtual void SetTotalPageScaleFactor(float page_scale_factor) OVERRIDE;
+ virtual void SetTotalPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) OVERRIDE;
virtual void SetScrollableSize(const gfx::SizeF& scrollable_size) OVERRIDE;
void SetInputHandler(cc::InputHandler* input_handler);
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 6d6c901..11cfc9a 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -206,21 +206,6 @@ public class ContentViewCore
}
/**
- * An interface that allows the embedder to be notified of changes to the parameters of the
- * currently displayed contents.
- * These notifications are consistent with respect to the UI thread (the size is the size of
- * the contents currently displayed on screen).
- */
- public interface UpdateFrameInfoListener {
- /**
- * Called each time any of the parameters are changed.
- *
- * @param pageScaleFactor The page scale.
- */
- void onFrameInfoUpdated(float pageScaleFactor);
- }
-
- /**
* An interface that allows the embedder to be notified when the results of
* extractSmartClipData are available.
*/
diff --git a/content/public/browser/android/synchronous_compositor_client.h b/content/public/browser/android/synchronous_compositor_client.h
index fd57c6d..8b43f28 100644
--- a/content/public/browser/android/synchronous_compositor_client.h
+++ b/content/public/browser/android/synchronous_compositor_client.h
@@ -30,7 +30,10 @@ class SynchronousCompositorClient {
virtual void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value) = 0;
virtual gfx::Vector2dF GetTotalRootLayerScrollOffset() = 0;
virtual bool IsExternalFlingActive() const = 0;
- virtual void SetRootLayerPageScaleFactor(float page_scale_factor) = 0;
+ virtual void SetRootLayerPageScaleFactorAndLimits(
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) = 0;
virtual void SetRootLayerScrollableSize(gfx::SizeF scrollable_size) = 0;
virtual void DidOverscroll(gfx::Vector2dF accumulated_overscroll,