Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3367)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/LogoBridge.java

Issue 1343913002: Introduce Animated Logo to Chrome on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: respond to newt's comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698