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

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

Issue 414423002: Removing ContentViewCore dependencies from few functions which acts as direct wrapper to WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restructured WillHandleDeferAfterResponseStarted and DidDeferAfterResponseStarted APIs. Created 6 years, 4 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/ContentViewCore.java
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 9733a58784af0c70ff24a72caa08e94a4c75e899..e261d99c096a5f5be5633e3ef555ce25633b5c8d 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
@@ -906,7 +906,8 @@ public class ContentViewCore
* Stops loading the current web contents.
*/
public void stopLoading() {
- if (mWebContents != null) mWebContents.stop();
+ assert mWebContents != null;
+ mWebContents.stop();
}
/**
@@ -915,8 +916,8 @@ public class ContentViewCore
* @return The URL of the current page.
*/
public String getUrl() {
- if (mNativeContentViewCore != 0) return nativeGetURL(mNativeContentViewCore);
- return null;
+ assert mWebContents != null;
+ return mWebContents.getUrl();
}
/**
@@ -925,7 +926,8 @@ public class ContentViewCore
* @return The title of the current page.
*/
public String getTitle() {
- return mWebContents == null ? null : mWebContents.getTitle();
+ assert mWebContents != null;
+ return mWebContents.getTitle();
}
/**
@@ -2152,9 +2154,10 @@ public class ContentViewCore
mActionMode = null;
// On ICS, startActionMode throws an NPE when getParent() is null.
if (mContainerView.getParent() != null) {
+ assert mWebContents != null;
mActionMode = mContainerView.startActionMode(
getContentViewClient().getSelectActionModeCallback(getContext(), actionHandler,
- nativeIsIncognito(mNativeContentViewCore)));
+ mWebContents.isIncognito()));
}
mUnselectAllOnActionModeDismiss = true;
if (mActionMode == null) {
@@ -3059,42 +3062,22 @@ public class ContentViewCore
}
@CalledByNative
- private void didDeferAfterResponseStarted(String enteringColor) {
- if (mNavigationTransitionDelegate != null ) {
- mNavigationTransitionDelegate.didDeferAfterResponseStarted(enteringColor);
- }
- }
-
- @CalledByNative
public void didStartNavigationTransitionForFrame(long frameId) {
shatch 2014/08/05 14:54:24 Seems like this would need to move as well?
AKVT 2014/08/05 16:07:24 Earlier Yaron suggested to move 2 functions which
Yaron 2014/08/06 00:35:45 Well logically it doesn't make sense to split thes
if (mNavigationTransitionDelegate != null ) {
mNavigationTransitionDelegate.didStartNavigationTransitionForFrame(frameId);
}
}
- @CalledByNative
- private boolean willHandleDeferAfterResponseStarted() {
- if (mNavigationTransitionDelegate == null) return false;
- return mNavigationTransitionDelegate.willHandleDeferAfterResponseStarted();
- }
-
@VisibleForTesting
void setHasPendingNavigationTransitionForTesting() {
- if (mNativeContentViewCore == 0) return;
- nativeSetHasPendingNavigationTransitionForTesting(mNativeContentViewCore);
+ assert mWebContents != null;
+ mWebContents.setHasPendingNavigationTransitionForTesting();
}
public void setNavigationTransitionDelegate(NavigationTransitionDelegate delegate) {
mNavigationTransitionDelegate = delegate;
shatch 2014/08/05 14:54:24 And this?
AKVT 2014/08/05 16:07:23 This too I duplicated as I mentioned on top. Pleas
Yaron 2014/08/06 00:35:45 I don't see the benefit of duplicating this. Pleas
}
- @CalledByNative
- private void addEnteringStylesheetToTransition(String stylesheet) {
- if (mNavigationTransitionDelegate != null ) {
- mNavigationTransitionDelegate.addEnteringStylesheetToTransition(stylesheet);
- }
- }
-
/**
* Offer a long press gesture to the embedding View, primarily for WebView compatibility.
*
@@ -3150,8 +3133,8 @@ public class ContentViewCore
}
public void resumeResponseDeferredAtStart() {
- if (mNativeContentViewCore == 0) return;
- nativeResumeResponseDeferredAtStart(mNativeContentViewCore);
+ assert mWebContents != null;
+ mWebContents.resumeResponseDeferredAtStart();
}
/**
@@ -3186,10 +3169,6 @@ public class ContentViewCore
boolean canLoadLocalResources,
boolean isRendererInitiated);
- private native String nativeGetURL(long nativeContentViewCoreImpl);
-
- private native boolean nativeIsIncognito(long nativeContentViewCoreImpl);
-
private native void nativeSetFocus(long nativeContentViewCoreImpl, boolean focused);
private native void nativeSendOrientationChangeEvent(
@@ -3252,8 +3231,10 @@ public class ContentViewCore
private native void nativeHideTextHandles(long nativeContentViewCoreImpl);
private native void nativeResetGestureDetection(long nativeContentViewCoreImpl);
+
private native void nativeSetDoubleTapSupportEnabled(
long nativeContentViewCoreImpl, boolean enabled);
+
private native void nativeSetMultiTouchZoomSupportEnabled(
long nativeContentViewCoreImpl, boolean enabled);
@@ -3273,6 +3254,7 @@ public class ContentViewCore
private native void nativeSetUseDesktopUserAgent(long nativeContentViewCoreImpl,
boolean enabled, boolean reloadOnChange);
+
private native boolean nativeGetUseDesktopUserAgent(long nativeContentViewCoreImpl);
private native void nativeClearSslPreferences(long nativeContentViewCoreImpl);
@@ -3287,8 +3269,10 @@ public class ContentViewCore
String name);
private native int nativeGetNavigationHistory(long nativeContentViewCoreImpl, Object context);
+
private native void nativeGetDirectedNavigationHistory(long nativeContentViewCoreImpl,
Object context, boolean isForward, int maxEntries);
+
private native String nativeGetOriginalUrlForActiveNavigationEntry(
long nativeContentViewCoreImpl);
@@ -3299,10 +3283,6 @@ public class ContentViewCore
private native void nativeExtractSmartClipData(long nativeContentViewCoreImpl,
int x, int y, int w, int h);
- private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl, boolean opaque);
- private native void nativeResumeResponseDeferredAtStart(
- long nativeContentViewCoreImpl);
- private native void nativeSetHasPendingNavigationTransitionForTesting(
- long nativeContentViewCoreImpl);
+ private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl, boolean opaque);
}

Powered by Google App Engine
This is Rietveld 408576698