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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java

Issue 2179563003: Android: Remove ContentViewCore::GetLayer() from public interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 5 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: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
index e4d9b67e00472dcadcf45d866c01956e1e4f61b3..af427ab826ca0c791822f6a93e282cc51f0a5f01 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -46,6 +46,7 @@ import org.chromium.content.browser.ContextualSearchClient;
import org.chromium.content_public.browser.GestureStateListener;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.NavigationEntry;
+import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.common.TopControlsState;
import org.chromium.ui.base.WindowAndroid;
@@ -456,7 +457,7 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
// the user activates a Voice Search.
nativeGatherSurroundingText(mNativeContextualSearchManagerPtr,
mSelectionController.getSelectedText(), NEVER_USE_RESOLVED_SEARCH_TERM,
- getBaseContentView(), mPolicy.maySendBasePageUrl());
+ getBaseContentView().getWebContents(), mPolicy.maySendBasePageUrl());
}
mWereSearchResultsSeen = false;
@@ -502,7 +503,7 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
ContentViewCore baseContentView = getBaseContentView();
if (baseContentView != null) {
nativeStartSearchTermResolutionRequest(mNativeContextualSearchManagerPtr, selection,
- ALWAYS_USE_RESOLVED_SEARCH_TERM, getBaseContentView(),
+ ALWAYS_USE_RESOLVED_SEARCH_TERM, getBaseContentView().getWebContents(),
mPolicy.maySendBasePageUrl());
}
}
@@ -933,7 +934,7 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
if (mPolicy.isContextualSearchJsApiEnabled()) {
// Enable the Contextual Search JavaScript API between our service and the new view.
nativeEnableContextualSearchJsApiForOverlay(
- mNativeContextualSearchManagerPtr, contentViewCore);
+ mNativeContextualSearchManagerPtr, contentViewCore.getWebContents());
}
// TODO(mdjones): Move SearchContentViewDelegate ownership to panel.
@@ -1363,13 +1364,13 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
private native long nativeInit();
private native void nativeDestroy(long nativeContextualSearchManager);
private native void nativeStartSearchTermResolutionRequest(long nativeContextualSearchManager,
- String selection, boolean useResolvedSearchTerm, ContentViewCore baseContentViewCore,
+ String selection, boolean useResolvedSearchTerm, WebContents baseWebContents,
boolean maySendBasePageUrl);
protected native void nativeGatherSurroundingText(long nativeContextualSearchManager,
- String selection, boolean useResolvedSearchTerm, ContentViewCore baseContentViewCore,
+ String selection, boolean useResolvedSearchTerm, WebContents baseWebContents,
boolean maySendBasePageUrl);
private native void nativeEnableContextualSearchJsApiForOverlay(
- long nativeContextualSearchManager, ContentViewCore overlayContentViewCore);
+ long nativeContextualSearchManager, WebContents overlayWebContents);
// Don't call these directly, instead call the private methods that cache the results.
private native String nativeGetTargetLanguage(long nativeContextualSearchManager);
private native String nativeGetAcceptLanguages(long nativeContextualSearchManager);

Powered by Google App Engine
This is Rietveld 408576698