OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.compositor.overlays; |
| 6 |
| 7 import org.chromium.chrome.browser.compositor.LayerTitleCache; |
| 8 import org.chromium.chrome.browser.compositor.layouts.components.VirtualView; |
| 9 import org.chromium.chrome.browser.compositor.layouts.eventfilter.EventFilter; |
| 10 import org.chromium.chrome.browser.compositor.scene_layer.SceneOverlayLayer; |
| 11 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; |
| 12 import org.chromium.chrome.browser.tabmodel.TabModel; |
| 13 import org.chromium.ui.resources.ResourceManager; |
| 14 |
| 15 import java.util.List; |
| 16 |
| 17 /** |
| 18 * An interface which positions the actual tabs and adds additional UI to the th
em. |
| 19 */ |
| 20 public interface SceneOverlay { |
| 21 /** |
| 22 * Updates and gets a {@link SceneOverlayLayer} that represents an scene ove
rlay. |
| 23 * |
| 24 * @param layerTitleCache A layer title cache. |
| 25 * @param resourceManager A resource manager. |
| 26 * @param fullscreenManager A fullscreen manager. |
| 27 * @return A {@link SceneOverlayLayer} that represents an scene overlay. |
| 28 * Or {@code null} if this {@link SceneOverlay} doesn't have a tree. |
| 29 */ |
| 30 SceneOverlayLayer getUpdatedSceneOverlayTree(LayerTitleCache layerTitleCache
, |
| 31 ResourceManager resourceManager, ChromeFullscreenManager fullscreenM
anager); |
| 32 |
| 33 /** |
| 34 * @return The {@link EventFilter} that processes events for this {@link Sce
neOverlay}. |
| 35 */ |
| 36 EventFilter getEventFilter(); |
| 37 |
| 38 /** |
| 39 * Called when the viewport size of the screen changes. |
| 40 * @param width The new width of the viewport available in
dp. |
| 41 * @param height The new height of the viewport available in
dp. |
| 42 * @param visibleViewportOffsetY The visible viewport Y offset in dp. |
| 43 */ |
| 44 void onSizeChanged(float width, float height, float visibleViewportOffsetY); |
| 45 |
| 46 /** |
| 47 * @param views A list of virtual views representing compositor rendered vie
ws. |
| 48 */ |
| 49 void getVirtualViews(List<VirtualView> views); |
| 50 |
| 51 /** |
| 52 * Helper-specific updates. Cascades the values updated by the animations an
d flings. |
| 53 * @param time The current time of the app in ms. |
| 54 * @param dt The delta time between update frames in ms. |
| 55 * @return Whether the updating is done. |
| 56 */ |
| 57 boolean updateOverlay(long time, long dt); |
| 58 |
| 59 /** |
| 60 * Notify the a title has changed. |
| 61 * |
| 62 * @param tabId The id of the tab that has changed. |
| 63 * @param title The new title. |
| 64 */ |
| 65 void tabTitleChanged(int tabId, String title); |
| 66 |
| 67 /** |
| 68 * Called when the active {@link TabModel} switched (e.g. standard -> incogn
ito). |
| 69 * @param incognito Whether or not the new active model is incognito. |
| 70 */ |
| 71 void tabModelSwitched(boolean incognito); |
| 72 |
| 73 /** |
| 74 * Called when a tab get selected. |
| 75 * @param time The current time of the app in ms. |
| 76 * @param incognito Whether or not the affected model was incognito. |
| 77 * @param id The id of the selected tab. |
| 78 * @param prevId The id of the previously selected tab. |
| 79 */ |
| 80 void tabSelected(long time, boolean incognito, int id, int prevId); |
| 81 |
| 82 /** |
| 83 * Called when a tab has been moved in the tabModel. |
| 84 * @param time The current time of the app in ms. |
| 85 * @param incognito Whether or not the affected model was incognito. |
| 86 * @param id The id of the Tab. |
| 87 * @param oldIndex The old index of the tab in the {@link TabModel}. |
| 88 * @param newIndex The new index of the tab in the {@link TabModel}. |
| 89 */ |
| 90 void tabMoved(long time, boolean incognito, int id, int oldIndex, int newInd
ex); |
| 91 |
| 92 /** |
| 93 * Called when a tab is being closed. When called, the closing tab will not |
| 94 * be part of the model. |
| 95 * @param time The current time of the app in ms. |
| 96 * @param incognito Whether or not the affected model was incognito. |
| 97 * @param id The id of the tab being closed. |
| 98 */ |
| 99 void tabClosed(long time, boolean incognito, int id); |
| 100 |
| 101 /** |
| 102 * Called when a tab close has been undone and the tab has been restored. |
| 103 * @param time The current time of the app in ms. |
| 104 * @param id The id of the Tab. |
| 105 * @param incognito True if the tab is incognito |
| 106 */ |
| 107 void tabClosureCancelled(long time, boolean incognito, int id); |
| 108 |
| 109 /** |
| 110 * Called when a tab is created from the top left button. |
| 111 * @param time The current time of the app in ms. |
| 112 * @param incognito Whether or not the affected model was incognito. |
| 113 * @param id The id of the newly created tab. |
| 114 * @param prevId The id of the source tab. |
| 115 * @param selected Whether the tab will be selected. |
| 116 */ |
| 117 void tabCreated(long time, boolean incognito, int id, int prevId, boolean se
lected); |
| 118 |
| 119 /** |
| 120 * Called when a tab has started loading. |
| 121 * @param id The id of the Tab. |
| 122 * @param incognito True if the tab is incognito. |
| 123 */ |
| 124 void tabPageLoadStarted(int id, boolean incognito); |
| 125 |
| 126 /** |
| 127 * Called when a tab has finished loading. |
| 128 * @param id The id of the Tab. |
| 129 * @param incognito True if the tab is incognito. |
| 130 */ |
| 131 void tabPageLoadFinished(int id, boolean incognito); |
| 132 |
| 133 /** |
| 134 * Called when a tab has started loading resources. |
| 135 * @param id The id of the Tab. |
| 136 * @param incognito True if the tab is incognito. |
| 137 */ |
| 138 void tabLoadStarted(int id, boolean incognito); |
| 139 |
| 140 /** |
| 141 * Called when a tab has stopped loading resources. |
| 142 * @param id The id of the Tab. |
| 143 * @param incognito True if the tab is incognito. |
| 144 */ |
| 145 void tabLoadFinished(int id, boolean incognito); |
| 146 } |
OLD | NEW |