Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoBridge.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoBridge.java |
| index cf2937d62c70aefdcfc75c4d139763be192ad4a1..292aceef2bc87c61d951cb7a5cbdac9f45a135e0 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoBridge.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoBridge.java |
| @@ -33,10 +33,16 @@ class LogoBridge { |
| */ |
| public final String altText; |
| - Logo(Bitmap image, String onClickUrl, String altText) { |
| + /** |
| + * The URL to download the animated GIF. If null, there is no GIF to download. |
|
newt (away)
2015/09/23 20:38:42
"animated GIF logo"
Ian Wen
2015/09/23 21:59:51
Done.
|
| + */ |
| + public final String animagedLogoUrl; |
|
newt (away)
2015/09/23 20:38:43
typo
Ian Wen
2015/09/23 21:59:51
Done.
|
| + |
| + Logo(Bitmap image, String onClickUrl, String altText, String gifUrl) { |
|
newt (away)
2015/09/23 20:38:42
animatedLogoUrl
Ian Wen
2015/09/23 21:59:51
Done.
|
| this.image = image; |
| this.onClickUrl = onClickUrl; |
| this.altText = altText; |
| + this.animagedLogoUrl = gifUrl; |
| } |
| } |
| @@ -55,6 +61,20 @@ class LogoBridge { |
| void onLogoAvailable(Logo logo, boolean fromCache); |
| } |
| + /** |
| + * A callback that is called when the GIF file is successfully downloaded. |
|
newt (away)
2015/09/23 20:38:43
s/GIF file/animated logo
Ian Wen
2015/09/23 21:59:51
Done.
|
| + */ |
| + interface AnimatedLogoCallback { |
| + |
| + /** |
| + * Called when the animated GIF is successfully downloaded. |
|
newt (away)
2015/09/23 20:38:43
Let's use "animated GIF logo" consistently in the
Ian Wen
2015/09/23 21:59:51
Done.
|
| + * |
| + * @param bytes The byte array representing the raw data for the animated GIF. |
| + */ |
| + @CalledByNative("AnimatedLogoCallback") |
| + void onGifDownloaded(byte[] bytes); |
|
newt (away)
2015/09/23 20:38:42
"void onAnimatedLogoAvailable(byte[] imageData);"
Ian Wen
2015/09/23 21:59:51
Done.
|
| + } |
| + |
| private long mNativeLogoBridge; |
| /** |
| @@ -87,12 +107,23 @@ class LogoBridge { |
| nativeGetCurrentLogo(mNativeLogoBridge, logoObserver); |
| } |
| + /** |
| + * Downloads an animated GIF logo. |
|
newt (away)
2015/09/23 20:38:42
Explain the subtleties about what happens if this
Ian Wen
2015/09/23 21:59:51
Done.
|
| + * @param callback The callback to be called when the animated GIF is successfully downloaded. |
| + * @param gifUrl The url from which to download the animated GIF. |
| + */ |
| + void getAnimatedLogo(AnimatedLogoCallback callback, String gifUrl) { |
| + nativeGetAnimatedLogo(mNativeLogoBridge, callback, gifUrl); |
|
newt (away)
2015/09/23 20:38:43
nativeGetAnimatedLogo returns a boolean, but we dr
Ian Wen
2015/09/23 21:59:51
Removed.
|
| + } |
| + |
| @CalledByNative |
| - private static Logo createLogo(Bitmap image, String onClickUrl, String altText) { |
| - return new Logo(image, onClickUrl, altText); |
| + private static Logo createLogo(Bitmap image, String onClickUrl, String altText, String gifUrl) { |
| + return new Logo(image, onClickUrl, altText, gifUrl); |
| } |
| private native long nativeInit(Profile profile); |
| private native void nativeGetCurrentLogo(long nativeLogoBridge, LogoObserver logoObserver); |
| + private native boolean nativeGetAnimatedLogo(long nativeLogoBridge, |
| + AnimatedLogoCallback callback, String gifUrl); |
| private native void nativeDestroy(long nativeLogoBridge); |
| } |