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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentView.java

Issue 275733002: Remove all external references to ContentView from Tab/Shell/etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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: content/public/android/java/src/org/chromium/content/browser/ContentView.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentView.java b/content/public/android/java/src/org/chromium/content/browser/ContentView.java
index f405f7e91544d5150e60e48ea6b0b2b1e56f124b..d479be66eb9d8a0d0a55389797d905861e1ed8a9 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentView.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentView.java
@@ -19,19 +19,15 @@ import android.view.inputmethod.InputConnection;
import android.widget.FrameLayout;
import org.chromium.base.TraceEvent;
-import org.chromium.ui.base.WindowAndroid;
/**
* The containing view for {@link ContentViewCore} that exists in the Android UI hierarchy and
* exposes the various {@link View} functionality to it.
- *
- * TODO(joth): Remove any methods overrides from this class that were added for WebView
- * compatibility.
*/
public class ContentView extends FrameLayout
implements ContentViewCore.InternalAccessDelegate {
- private final ContentViewCore mContentViewCore;
+ protected final ContentViewCore mContentViewCore;
private final int[] mLocationInWindow = new int[2];
@@ -39,20 +35,18 @@ public class ContentView extends FrameLayout
* Creates an instance of a ContentView.
* @param context The Context the view is running in, through which it can
* access the current theme, resources, etc.
- * @param nativeWebContents A pointer to the native web contents.
- * @param windowAndroid An instance of the WindowAndroid.
+ * @param cvc A pointer to the content view core managing this content view.
* @return A ContentView instance.
*/
- public static ContentView newInstance(
- Context context, long nativeWebContents, WindowAndroid windowAndroid) {
+ public static ContentView newInstance(Context context, ContentViewCore cvc) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
- return new ContentView(context, nativeWebContents, windowAndroid);
+ return new ContentView(context, cvc);
} else {
- return new JellyBeanContentView(context, nativeWebContents, windowAndroid);
+ return new JellyBeanContentView(context, cvc);
}
}
- protected ContentView(Context context, long nativeWebContents, WindowAndroid windowAndroid) {
+ protected ContentView(Context context, ContentViewCore cvc) {
super(context, null, android.R.attr.webViewStyle);
if (getScrollBarStyle() == View.SCROLLBARS_INSIDE_OVERLAY) {
@@ -63,20 +57,9 @@ public class ContentView extends FrameLayout
setFocusable(true);
setFocusableInTouchMode(true);
- mContentViewCore = new ContentViewCore(context);
- mContentViewCore.initialize(this, this, nativeWebContents, windowAndroid);
+ mContentViewCore = cvc;
}
- /**
- * @return The core component of the ContentView that handles JNI communication. Should only be
- * used for passing to native.
- */
- public ContentViewCore getContentViewCore() {
- return mContentViewCore;
- }
-
- // FrameLayout overrides.
-
// Needed by ContentViewCore.InternalAccessDelegate
@Override
public boolean drawChild(Canvas canvas, View child, long drawingTime) {
@@ -275,24 +258,6 @@ public class ContentView extends FrameLayout
mContentViewCore.onVisibilityChanged(changedView, visibility);
}
- /**
- * Return content scroll y.
- *
- * @return The vertical scroll position in pixels.
- */
- public int getContentScrollY() {
- return mContentViewCore.computeVerticalScrollOffset();
- }
-
- /**
- * Return content height.
- *
- * @return The height of the content in pixels.
- */
- public int getContentHeight() {
- return mContentViewCore.computeVerticalScrollRange();
- }
-
///////////////////////////////////////////////////////////////////////////////////////////////
// Start Implementation of ContentViewCore.InternalAccessDelegate //
///////////////////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698