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.layouts; |
| 6 |
| 7 import org.chromium.chrome.browser.Tab; |
| 8 import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; |
| 9 |
| 10 /** |
| 11 * {@link LayoutRenderHost} is the minimal interface the layouts need to know ab
out its host to |
| 12 * update. |
| 13 */ |
| 14 public interface LayoutUpdateHost { |
| 15 /** |
| 16 * Requests a next update to refresh the transforms and changing properties.
The update occurs |
| 17 * once a frame. This is requesting a new frame to be updated and rendered (
no need to call |
| 18 * {@link LayoutRenderHost#requestRender()}). |
| 19 */ |
| 20 void requestUpdate(); |
| 21 |
| 22 /** |
| 23 * Tells its host {@link android.view.View} that the hide will be an animati
on away. |
| 24 * This is to be called from a {@link Layout}. |
| 25 * @param nextTabId The id of the next tab. |
| 26 * @param hintAtTabSelection Whether or not to hint about a new tab being se
lected. |
| 27 */ |
| 28 void startHiding(int nextTabId, boolean hintAtTabSelection); |
| 29 |
| 30 /** |
| 31 * Tells its host {@link android.view.View} that the Layout has done all ani
mation so the view |
| 32 * can hide. This is to be called from a {@link Layout}. |
| 33 */ |
| 34 void doneHiding(); |
| 35 |
| 36 /** |
| 37 * Tells its host that the Layout is done it's preliminary showing animation
. |
| 38 */ |
| 39 void doneShowing(); |
| 40 |
| 41 /** |
| 42 * @param layout The {@link Layout} being evaluated. |
| 43 * @return Whether the given {@link Layout} is being displayed. |
| 44 */ |
| 45 boolean isActiveLayout(Layout layout); |
| 46 |
| 47 /** |
| 48 * Initializes {@link org.chromium.chrome.browser.compositor.layouts.compone
nts.LayoutTab} with |
| 49 * data accessible only from the {@link LayoutUpdateHost} such as data extra
cted out of a |
| 50 * {@link Tab}. |
| 51 * |
| 52 * @param tabId The id of the |
| 53 * {@link org.chromium.chrome.browser.compositor.layouts.compon
ents.LayoutTab} |
| 54 * to be initialized from a {@link Tab}. |
| 55 */ |
| 56 void initLayoutTabFromHost(final int tabId); |
| 57 |
| 58 /** |
| 59 * Creates or recycles a {@Link LayoutTab}. |
| 60 * |
| 61 * @param id The id of the reference tab in the |
| 62 * {@link org.chromium.chrome.browser.tabmodel.TabMo
del}. |
| 63 * @param incognito Whether the new tab is incognito. |
| 64 * @param showCloseButton True to show and activate a close button on the b
order. |
| 65 * @param isTitleNeeded Whether a title will be shown. |
| 66 * @param maxContentWidth The maximum layout width this tab can be. Negati
ve numbers will use |
| 67 * the original content width. |
| 68 * @param maxContentHeight The maximum layout height this tab can be. Negat
ive numbers will use |
| 69 * the original content height. |
| 70 * @return The created or recycled {@link LayoutTab}. |
| 71 */ |
| 72 LayoutTab createLayoutTab(int id, boolean incognito, boolean showCloseButton
, |
| 73 boolean isTitleNeeded, float maxContentWidth, float maxContentHeight
); |
| 74 |
| 75 /** |
| 76 * Notifies the host that the {@link LayoutTab} is no longer needed by the l
ayout. |
| 77 * |
| 78 * @param id The id of the reference tab in the |
| 79 * {@link org.chromium.chrome.browser.tabmodel.TabModel}. |
| 80 */ |
| 81 void releaseTabLayout(int id); |
| 82 } |
OLD | NEW |