OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.compositor.bottombar.contextualsearch; |
| 6 |
| 7 import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.Context
ualSearchPanel.PanelState; |
| 8 import org.chromium.chrome.browser.compositor.bottombar.contextualsearch.Context
ualSearchPanel.StateChangeReason; |
| 9 |
| 10 /** |
| 11 * The delegate that that interfaces with the {@link ContextualSearchPanel}. |
| 12 */ |
| 13 public interface ContextualSearchPanelDelegate { |
| 14 /** |
| 15 * @return Whether the Panel is showing. |
| 16 */ |
| 17 boolean isShowing(); |
| 18 |
| 19 /** |
| 20 * @return Whether the Search Bar is peeking. |
| 21 */ |
| 22 boolean isPeeking(); |
| 23 |
| 24 /** |
| 25 * Maximizes the Contextual Search Panel, then promotes it to a regular Tab. |
| 26 * @param reason The {@code StateChangeReason} behind the maximization and p
romotion to tab. |
| 27 */ |
| 28 void maximizePanelThenPromoteToTab(StateChangeReason reason); |
| 29 |
| 30 /** |
| 31 * Maximizes the Contextual Search Panel, then promotes it to a regular Tab. |
| 32 * @param reason The {@code StateChangeReason} behind the maximization and p
romotion to tab. |
| 33 * @param duration The animation duration in milliseconds. |
| 34 */ |
| 35 void maximizePanelThenPromoteToTab(StateChangeReason reason, long duration); |
| 36 |
| 37 /** |
| 38 * Animates the Contextual Search Panel to its peeked state. |
| 39 * @param reason The {@code StateChangeReason} to which closing the panel is
attributed. |
| 40 */ |
| 41 void peekPanel(StateChangeReason reason); |
| 42 |
| 43 /** |
| 44 * Animates the Contextual Search Panel to its closed state. |
| 45 * @param reason The {@code StateChangeReason} to which closing the panel is
attributed. |
| 46 * @param animate Whether to animate the close action. |
| 47 */ |
| 48 void closePanel(StateChangeReason reason, boolean animate); |
| 49 |
| 50 /** |
| 51 * Updates the y coordinate of the Base Page's selection start position. |
| 52 * @param y The y coordinate. |
| 53 */ |
| 54 void updateBasePageSelectionYPx(float y); |
| 55 |
| 56 /** |
| 57 * Sets the content height of the First Run Flow Panel. |
| 58 * @param height The content height of the First Run Flow Panel. |
| 59 */ |
| 60 void setPromoContentHeight(float height); |
| 61 |
| 62 /** |
| 63 * @param shouldHidePromoHeader Sets whether the First Run Flow's header |
| 64 * should be hidden. |
| 65 */ |
| 66 void setShouldHidePromoHeader(boolean shouldHidePromoHeader); |
| 67 |
| 68 /** |
| 69 * Animates the Contextual Search panel after first-run success. |
| 70 */ |
| 71 void animateAfterFirstRunSuccess(); |
| 72 |
| 73 /** |
| 74 * Handles the onLoadStarted event in the WebContents. |
| 75 */ |
| 76 void onLoadStarted(); |
| 77 |
| 78 /** |
| 79 * Handles the onLoadStopped event in the WebContents. |
| 80 */ |
| 81 void onLoadStopped(); |
| 82 |
| 83 /** |
| 84 * Handles the onLoadProgressChanged event in the WebContents. |
| 85 * @param progress The loading progress in percentage (from 0 to 100). |
| 86 */ |
| 87 void onLoadProgressChanged(int progress); |
| 88 |
| 89 /** |
| 90 * @return The panel's state. |
| 91 */ |
| 92 PanelState getPanelState(); |
| 93 |
| 94 /** |
| 95 * Sets that the contextual search involved the promo. |
| 96 */ |
| 97 void setDidSearchInvolvePromo(); |
| 98 |
| 99 /** |
| 100 * Sets that the Search Content View was seen. |
| 101 */ |
| 102 void setWasSearchContentViewSeen(); |
| 103 |
| 104 /** |
| 105 * Sets whether the promo is active. |
| 106 * @param shown Whether the promo is active. |
| 107 */ |
| 108 void setIsPromoActive(boolean shown); |
| 109 |
| 110 /** |
| 111 * Gets whether a touch on the search content view has been done yet or not. |
| 112 */ |
| 113 boolean didTouchSearchContentView(); |
| 114 } |
OLD | NEW |