OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/android/logo_bridge.h" | 5 #include "chrome/browser/android/logo_bridge.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 JNIEnv* env = base::android::AttachCurrentThread(); | 292 JNIEnv* env = base::android::AttachCurrentThread(); |
293 | 293 |
294 if (image.IsEmpty()) { | 294 if (image.IsEmpty()) { |
295 DLOG(WARNING) << "Failed to download doodle image"; | 295 DLOG(WARNING) << "Failed to download doodle image"; |
296 Java_LogoObserver_onLogoAvailable(env, j_logo_observer_, | 296 Java_LogoObserver_onLogoAvailable(env, j_logo_observer_, |
297 ScopedJavaLocalRef<jobject>(), | 297 ScopedJavaLocalRef<jobject>(), |
298 config_from_cache); | 298 config_from_cache); |
299 return; | 299 return; |
300 } | 300 } |
301 | 301 |
| 302 UMA_HISTOGRAM_BOOLEAN("NewTabPage.LogoImageDownloaded", |
| 303 metadata.from_http_cache); |
| 304 |
302 ScopedJavaLocalRef<jobject> j_logo = MakeJavaLogo( | 305 ScopedJavaLocalRef<jobject> j_logo = MakeJavaLogo( |
303 env, image.ToSkBitmap(), on_click_url, alt_text, animated_image_url); | 306 env, image.ToSkBitmap(), on_click_url, alt_text, animated_image_url); |
304 Java_LogoObserver_onLogoAvailable(env, j_logo_observer_, j_logo, | 307 Java_LogoObserver_onLogoAvailable(env, j_logo_observer_, j_logo, |
305 config_from_cache); | 308 config_from_cache); |
306 } | 309 } |
307 | 310 |
308 // static | 311 // static |
309 bool RegisterLogoBridge(JNIEnv* env) { | 312 bool RegisterLogoBridge(JNIEnv* env) { |
310 return RegisterNativesImpl(env); | 313 return RegisterNativesImpl(env); |
311 } | 314 } |
OLD | NEW |