Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java |
| index 53d8d2f157ed7ee18085ee81ff24fd0925a84183..b253a53abd6053b1e20c86ceaa5e1d822b8440a1 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java |
| @@ -53,8 +53,6 @@ import org.chromium.chrome.browser.util.ViewUtils; |
| import org.chromium.chrome.browser.widget.displaystyle.UiConfig; |
| import org.chromium.ui.base.DeviceFormFactor; |
| -import jp.tomorrowkey.android.gifplayer.BaseGifImage; |
| - |
| /** |
| * The native new tab page, represented by some basic data such as title and url, and an Android |
| * View that displays the page. |
| @@ -95,6 +93,7 @@ public class NewTabPageView |
| private ChromeActivity mActivity; |
| private NewTabPageManager mManager; |
| + private LogoManagerImpl mLogoManager; |
| private TileGroup.Delegate mTileGroupDelegate; |
| private TileGroup mTileGroup; |
| private UiConfig mUiConfig; |
| @@ -143,18 +142,6 @@ public class NewTabPageView |
| void focusSearchBox(boolean beginVoiceSearch, String pastedText); |
| /** |
| - * Called when the user clicks on the logo. |
| - * @param isAnimatedLogoShowing Whether the animated GIF logo is playing. |
| - */ |
| - void onLogoClicked(boolean isAnimatedLogoShowing); |
| - |
| - /** |
| - * Gets the default search provider's logo and calls logoObserver with the result. |
| - * @param logoObserver The callback to notify when the logo is available. |
| - */ |
| - void getSearchProviderLogo(LogoObserver logoObserver); |
| - |
| - /** |
| * @return whether the {@link NewTabPage} associated with this manager is the current page |
| * displayed to the user. |
| */ |
| @@ -239,6 +226,7 @@ public class NewTabPageView |
| mSearchProviderLogoView = |
| (LogoView) mNewTabPageLayout.findViewById(R.id.search_provider_logo); |
| + mLogoManager = new LogoManagerImpl(tab, mSearchProviderLogoView); |
| mSearchBoxView = mNewTabPageLayout.findViewById(R.id.search_box); |
| mNoSearchLogoSpacer = mNewTabPageLayout.findViewById(R.id.no_search_logo_spacer); |
| @@ -499,11 +487,12 @@ public class NewTabPageView |
| * Loads the search provider logo (e.g. Google doodle), if any. |
| */ |
| private void loadSearchProviderLogo() { |
| - mManager.getSearchProviderLogo(new LogoObserver() { |
| + final LogoManagerImpl manager = mLogoManager; |
|
dgn
2017/02/28 14:09:56
why the local variable here?
Theresa
2017/02/28 17:02:23
The variable is referenced in onLogoAvailable() be
dgn
2017/02/28 17:21:23
but member variables don't need to be final to be
Theresa
2017/02/28 17:50:40
You're right. Done.
|
| + manager.getSearchProviderLogo(new LogoObserver() { |
| @Override |
| public void onLogoAvailable(Logo logo, boolean fromCache) { |
| if (logo == null && fromCache) return; |
| - mSearchProviderLogoView.setMananger(mManager); |
| + mSearchProviderLogoView.setMananger(manager); |
|
Michael van Ouwerkerk
2017/02/28 13:36:15
Hmn, maybe rename setMananger to setManager now th
Theresa
2017/02/28 17:02:23
I renamed it to setDelegate().
|
| mSearchProviderLogoView.updateLogo(logo); |
| mSnapshotTileGridChanged = true; |
| } |
| @@ -562,20 +551,6 @@ public class NewTabPageView |
| } |
| /** |
| - * Shows a progressbar indicating the animated logo is being downloaded. |
| - */ |
| - void showLogoLoadingView() { |
| - mSearchProviderLogoView.showLoadingView(); |
| - } |
| - |
| - /** |
| - * Starts playing the given animated GIF logo. |
| - */ |
| - void playAnimatedLogo(BaseGifImage gifImage) { |
| - mSearchProviderLogoView.playAnimatedLogo(gifImage); |
| - } |
| - |
| - /** |
| * @return Whether URL focus animations are currently disabled. |
| */ |
| boolean urlFocusAnimationsDisabled() { |