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.toolbar; |
| 6 |
| 7 import org.chromium.base.VisibleForTesting; |
| 8 import org.chromium.chrome.browser.Tab; |
| 9 import org.chromium.chrome.browser.ntp.NewTabPage; |
| 10 |
| 11 /** |
| 12 * Defines the data that is exposed to properly render the Toolbar. |
| 13 */ |
| 14 public interface ToolbarDataProvider { |
| 15 /** |
| 16 * @return The tab that contains the information currently displayed in the
toolbar. |
| 17 */ |
| 18 Tab getTab(); |
| 19 |
| 20 /** |
| 21 * @return The NewTabPage shown for the current Tab or null if one is not be
ing shown. |
| 22 */ |
| 23 NewTabPage getNewTabPageForCurrentTab(); |
| 24 |
| 25 /** |
| 26 * @return Whether the toolbar is currently being displayed for incognito. |
| 27 */ |
| 28 boolean isIncognito(); |
| 29 |
| 30 /** |
| 31 * @return The load progress for the current tab (0 being no load progress,
100 being |
| 32 * fully loaded). |
| 33 */ |
| 34 @VisibleForTesting |
| 35 int getLoadProgress(); |
| 36 |
| 37 /** |
| 38 * @return The chip text from the search URL. |
| 39 */ |
| 40 String getCorpusChipText(); |
| 41 |
| 42 /** |
| 43 * @return The formatted text (URL or search terms) for display. |
| 44 */ |
| 45 String getText(); |
| 46 |
| 47 /** |
| 48 * @return Whether the text to display is a search query replacing the URL. |
| 49 */ |
| 50 boolean wouldReplaceURL(); |
| 51 |
| 52 /** |
| 53 * @return The primary color to use for the background drawable. |
| 54 */ |
| 55 int getPrimaryColor(); |
| 56 |
| 57 /** |
| 58 * @return Whether the current primary color is a brand color. |
| 59 */ |
| 60 boolean isUsingBrandColor(); |
| 61 } |
OLD | NEW |