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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 14840011: [Android] Move zoom controls management into WebView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use an interface and an inline stub, as discussed offline Created 7 years, 8 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: android_webview/java/src/org/chromium/android_webview/AwContents.java
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 4118f4915df669673f01165405d1cade1ca5cd26..683304fd6cb9460e2ee3758848a6d86ab9c8490a 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -115,6 +115,7 @@ public class AwContents {
private InterceptNavigationDelegateImpl mInterceptNavigationDelegate;
private InternalAccessDelegate mInternalAccessAdapter;
private final AwLayoutSizer mLayoutSizer;
+ private AwZoomControls mZoomControls;
// This can be accessed on any thread after construction. See AwContentsIoThreadClient.
private final AwSettings mSettings;
private boolean mIsPaused;
@@ -328,12 +329,15 @@ public class AwContents {
mCleanupReference = new CleanupReference(this, new DestroyRunnable(mNativeAwContents));
int nativeWebContents = nativeGetWebContents(mNativeAwContents);
- mContentViewCore.initialize(containerView, internalAccessAdapter, nativeWebContents, null);
+ mContentViewCore.initialize(
+ containerView, internalAccessAdapter, nativeWebContents, null);
mContentViewCore.setContentViewClient(mContentsClient.getContentViewClient());
+ mZoomControls = new AwZoomControls(this);
+ mContentViewCore.setZoomControlsDelegate(mZoomControls);
mContentsClient.installWebContentsObserver(mContentViewCore);
mSettings = new AwSettings(mContentViewCore.getContext(), nativeWebContents,
- isAccessFromFileURLsGrantedByDefault);
+ mContentViewCore, isAccessFromFileURLsGrantedByDefault);
setIoThreadClient(new IoThreadClientImpl());
setInterceptNavigationDelegate(new InterceptNavigationDelegateImpl());
@@ -573,11 +577,9 @@ public class AwContents {
ContentViewCore.PERSONALITY_VIEW);
newCore.initialize(mContainerView, mInternalAccessAdapter, newWebContentsPtr, null);
newCore.setContentViewClient(mContentsClient.getContentViewClient());
+ newCore.setZoomControlsDelegate(mZoomControls);
mContentsClient.installWebContentsObserver(newCore);
- ContentSettings oldSettings = mContentViewCore.getContentSettings();
- newCore.getContentSettings().initFrom(oldSettings);
-
// Now swap the Java side reference.
mContentViewCore.destroy();
mContentViewCore = newCore;
@@ -610,6 +612,14 @@ public class AwContents {
}
}
+ public boolean isMultiTouchZoomSupported() {
+ return mSettings.supportsMultiTouchZoom();
+ }
+
+ public View getZoomControlsForTest() {
+ return mZoomControls.getZoomControlsViewForTest();
+ }
+
//--------------------------------------------------------------------------------------------
// WebView[Provider] method implementations (where not provided by ContentViewCore)
//--------------------------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698