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