| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.suggestions; | 5 package org.chromium.chrome.browser.suggestions; |
| 6 | 6 |
| 7 import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback; | 7 import org.chromium.chrome.browser.favicon.FaviconHelper.FaviconImageCallback; |
| 8 import org.chromium.chrome.browser.favicon.FaviconHelper.IconAvailabilityCallbac
k; | 8 import org.chromium.chrome.browser.favicon.FaviconHelper.IconAvailabilityCallbac
k; |
| 9 import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; | 9 import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; |
| 10 import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; | 10 import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource; |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * Interface between the suggestion surface and the rest of the browser. | 13 * Interface between the suggestion surface and the rest of the browser. |
| 14 */ | 14 */ |
| 15 public interface SuggestionsUiDelegate { | 15 public interface SuggestionsUiDelegate { |
| 16 // Dependency injection | 16 // Dependency injection |
| 17 // TODO(dgn): remove these methods once the users have a different way to ge
t a reference | 17 // TODO(dgn): remove these methods once the users have a different way to ge
t a reference |
| 18 // to these objects (https://crbug.com/677672) | 18 // to these objects (https://crbug.com/677672) |
| 19 | 19 |
| 20 /** Convenience method to access the {@link SuggestionsSource}. */ | 20 /** Convenience method to access the {@link SuggestionsSource}. */ |
| 21 SuggestionsSource getSuggestionsSource(); | 21 SuggestionsSource getSuggestionsSource(); |
| 22 | 22 |
| 23 /** Convenience method to access the {@link SuggestionsMetricsReporter}. */ | 23 /** Convenience method to access the {@link SuggestionsRanker}. */ |
| 24 SuggestionsMetricsReporter getMetricsReporter(); | 24 SuggestionsRanker getSuggestionsRanker(); |
| 25 |
| 26 /** Convenience method to access the {@link SuggestionsEventReporter}. */ |
| 27 SuggestionsEventReporter getEventReporter(); |
| 25 | 28 |
| 26 /** Convenience method to access the {@link SuggestionsNavigationDelegate}.
*/ | 29 /** Convenience method to access the {@link SuggestionsNavigationDelegate}.
*/ |
| 27 SuggestionsNavigationDelegate getNavigationDelegate(); | 30 SuggestionsNavigationDelegate getNavigationDelegate(); |
| 28 | 31 |
| 29 // Favicons | 32 // Favicons |
| 30 | 33 |
| 31 /** | 34 /** |
| 32 * Checks if an icon with the given URL is available. If not, | 35 * Checks if an icon with the given URL is available. If not, |
| 33 * downloads it and stores it as a favicon/large icon for the given {@code p
ageUrl}. | 36 * downloads it and stores it as a favicon/large icon for the given {@code p
ageUrl}. |
| 34 * @param pageUrl The URL of the site whose icon is being requested. | 37 * @param pageUrl The URL of the site whose icon is being requested. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 58 // Feature/State checks | 61 // Feature/State checks |
| 59 | 62 |
| 60 /** | 63 /** |
| 61 * Registers a {@link DestructionObserver}, notified when the New Tab Page g
oes away. | 64 * Registers a {@link DestructionObserver}, notified when the New Tab Page g
oes away. |
| 62 */ | 65 */ |
| 63 void addDestructionObserver(DestructionObserver destructionObserver); | 66 void addDestructionObserver(DestructionObserver destructionObserver); |
| 64 | 67 |
| 65 /** @return whether the suggestions UI is currently visible. */ | 68 /** @return whether the suggestions UI is currently visible. */ |
| 66 boolean isVisible(); | 69 boolean isVisible(); |
| 67 } | 70 } |
| OLD | NEW |