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