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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelDelegate.java

Issue 1304013002: Move functionality for ContentViewCore to ContextualSearchPanel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple-move-cvc-to-panel
Patch Set: remove extra override Created 5 years, 3 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/compositor/bottombar/contextualsearch/ContextualSearchPanelDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelDelegate.java
index a11a54e71b9e16ff6fb5abc5d648cf3e98e87c5b..d9659ec725e052c1973286b89a7e17350b18c480 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelDelegate.java
@@ -4,12 +4,11 @@
package org.chromium.chrome.browser.compositor.bottombar.contextualsearch;
+import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.ContextualSearchPanel.PanelState;
import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.ContextualSearchPanel.StateChangeReason;
-import org.chromium.components.navigation_interception.InterceptNavigationDelegate;
-import org.chromium.components.web_contents_delegate_android.WebContentsDelegateAndroid;
+import org.chromium.chrome.browser.contextualsearch.ContextualSearchContentController;
import org.chromium.content.browser.ContentViewCore;
-import org.chromium.content_public.browser.WebContents;
/**
* The delegate that that interfaces with the {@link ContextualSearchPanel}.
@@ -83,22 +82,6 @@ public interface ContextualSearchPanelDelegate {
void updateBasePageSelectionYPx(float y);
/**
- * Handles the onLoadStarted event in the WebContents.
- */
- void onLoadStarted();
-
- /**
- * Handles the onLoadStopped event in the WebContents.
- */
- void onLoadStopped();
-
- /**
- * Handles the onLoadProgressChanged event in the WebContents.
- * @param progress The loading progress in percentage (from 0 to 100).
- */
- void onLoadProgressChanged(int progress);
-
- /**
* @return The panel's state.
*/
PanelState getPanelState();
@@ -109,11 +92,6 @@ public interface ContextualSearchPanelDelegate {
void setDidSearchInvolvePromo();
/**
- * Sets that the Search Content View was seen.
- */
- void setWasSearchContentViewSeen();
-
- /**
* Sets whether the promo is active.
* @param shown Whether the promo is active.
*/
@@ -144,45 +122,55 @@ public interface ContextualSearchPanelDelegate {
/**
* @return The ContentViewCore associated with the panel.
+ * TODO(mdjones): Remove this method from the interface.
*/
ContentViewCore getContentViewCore();
/**
- * Set this panel's ContentViewCore to null.
+ * Remove the last entry from history provided it is in a given time frame.
+ * @param historyUrl The URL to remove.
+ * @param urlTimeMs The time that the URL was visited.
+ */
+ void removeLastHistoryEntry(String historyUrl, long urlTimeMs);
+
+ /**
+ * @param activity The current active ChromeActivity.
*/
- void resetContentViewCore();
+ void setChromeActivity(ChromeActivity activity);
/**
- * Destroy the native components of this class.
+ * Load a URL in the panel ContentViewCore.
+ * @param url The URL to load.
*/
- void destroy();
+ void loadUrlInPanel(String url);
/**
- * Remove the last entry from history provided it is in a given time frame.
- * @param historyUrl The URL to remove.
- * @param urlTimeMs The time that the URL was visited.
+ * @return True if the ContentViewCore is being shown.
*/
- void removeLastHistoryEntry(String historyUrl, long urlTimeMs);
+ boolean isContentViewShowing();
+
+ /**
+ * Create a new ContentViewCore for this panel.
+ */
+ void createNewPanelContentView();
/**
- * Set the WebContents
+ * Set the ContextualSearchContentController (for testing).
*/
- void setWebContents(ContentViewCore contentView, WebContentsDelegateAndroid delegate);
+ void setContentController(ContextualSearchContentController controller);
/**
- * Destroy the web contents associated with this object.
+ * @return The current content controller.
*/
- void destroyWebContents();
+ ContextualSearchContentController getContentController();
/**
- * Reset the native handle to the WebContents.
+ * @return True if the panel loaded a URL.
*/
- void releaseWebContents();
+ boolean didLoadAnyUrl();
/**
- * @param delegate InterceptNavigationDelegate to use.
- * @param webContents The WebContents to associate with the delegate.
+ * Sets the top control state based on the internals of the panel.
*/
- void setInterceptNavigationDelegate(
- InterceptNavigationDelegate delegate, WebContents webContents);
+ void updateTopControlState();
}

Powered by Google App Engine
This is Rietveld 408576698