| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.contextualsearch; | 5 package org.chromium.chrome.browser.contextualsearch; |
| 6 | 6 |
| 7 import org.chromium.chrome.browser.compositor.bottombar.OverlayContentDelegate; |
| 7 import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.Context
ualSearchPanel.StateChangeReason; | 8 import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.Context
ualSearchPanel.StateChangeReason; |
| 8 import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.Context
ualSearchPanelDelegate; | 9 import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.Context
ualSearchPanelDelegate; |
| 9 import org.chromium.chrome.browser.customtabs.CustomTab; | 10 import org.chromium.chrome.browser.customtabs.CustomTab; |
| 10 import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler; | |
| 11 import org.chromium.chrome.browser.tab.Tab; | 11 import org.chromium.chrome.browser.tab.Tab; |
| 12 import org.chromium.components.navigation_interception.NavigationParams; | |
| 13 import org.chromium.content.browser.ContentViewCore; | 12 import org.chromium.content.browser.ContentViewCore; |
| 14 import org.chromium.content_public.common.TopControlsState; | 13 import org.chromium.content_public.common.TopControlsState; |
| 15 | 14 |
| 16 /** | 15 /** |
| 17 * The delegate that provides global management functionality for Contextual Sea
rch. | 16 * The delegate that provides global management functionality for Contextual Sea
rch. |
| 18 */ | 17 */ |
| 19 public interface ContextualSearchManagementDelegate { | 18 public interface ContextualSearchManagementDelegate { |
| 20 /** | 19 /** |
| 21 * @return Whether the Search Panel is showing. | 20 * @return Whether the Search Panel is showing. |
| 22 */ | 21 */ |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 * @return The resource id that contains how large the top controls are. | 106 * @return The resource id that contains how large the top controls are. |
| 108 */ | 107 */ |
| 109 int getControlContainerHeightResource(); | 108 int getControlContainerHeightResource(); |
| 110 | 109 |
| 111 /** | 110 /** |
| 112 * @return Whether the current activity contains a {@link CustomTab}. | 111 * @return Whether the current activity contains a {@link CustomTab}. |
| 113 */ | 112 */ |
| 114 boolean isCustomTab(); | 113 boolean isCustomTab(); |
| 115 | 114 |
| 116 /** | 115 /** |
| 117 * This method is called when the panel's ContentViewCore is created. | |
| 118 * @param contentView The created ContentViewCore. | |
| 119 */ | |
| 120 void onContentViewCreated(ContentViewCore contentView); | |
| 121 | |
| 122 /** | |
| 123 * This method is called when the panel's ContentViewCore is destroyed. | |
| 124 */ | |
| 125 void onContentViewDestroyed(); | |
| 126 | |
| 127 /** | |
| 128 * This is called on navigation of the contextual search pane This is called
on navigation | 116 * This is called on navigation of the contextual search pane This is called
on navigation |
| 129 * of the contextual search panel. | 117 * of the contextual search panel. |
| 130 * @param isFailure If the request resulted in an error page. | 118 * @param isFailure If the request resulted in an error page. |
| 131 */ | 119 */ |
| 132 void onContextualSearchRequestNavigation(boolean isFailure); | 120 void onContextualSearchRequestNavigation(boolean isFailure); |
| 133 | 121 |
| 134 /** | 122 /** |
| 135 * This is called when the search panel is shown or is hidden. | 123 * @return An OverlayContentDelegate to watch events on the panel's content. |
| 136 * @param isVisible True if the panel is now visible. | |
| 137 */ | 124 */ |
| 138 void onContentViewVisibilityChanged(boolean isVisible); | 125 OverlayContentDelegate getOverlayContentDelegate(); |
| 139 | |
| 140 /** | |
| 141 * This is called when the panel has loaded search results. | |
| 142 */ | |
| 143 void onSearchResultsLoaded(); | |
| 144 | |
| 145 /** | |
| 146 * Called when an external navigation occurs. | |
| 147 * @param url The URL being navigated to. | |
| 148 */ | |
| 149 void onExternalNavigation(String url); | |
| 150 | |
| 151 /** | |
| 152 * Handles the WebContentsObserver#didNavigateMainFrame callback. | |
| 153 * @param url The URL of the navigation. | |
| 154 * @param httpResultCode The HTTP result code of the navigation. | |
| 155 */ | |
| 156 void handleDidNavigateMainFrame(String url, int httpResultCode); | |
| 157 | |
| 158 /** | |
| 159 * Called when the WebContents for the panel starts loading. | |
| 160 */ | |
| 161 void onStartedLoading(); | |
| 162 | |
| 163 /** | |
| 164 * Determine if a particular navigation should be intercepted. | |
| 165 * @param externalNavHandler External navigation handler for the activity th
e panel is in. | |
| 166 * @param navigationParams The navigation params for the current navigation. | |
| 167 * @return True if the navigation should be intercepted. | |
| 168 */ | |
| 169 boolean shouldInterceptNavigation(ExternalNavigationHandler externalNavHandl
er, | |
| 170 NavigationParams navigationParams); | |
| 171 } | 126 } |
| OLD | NEW |