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

Side by Side Diff: chrome/browser/android/logo_bridge.cc

Issue 2762853003: [Doodle] Add UMA for doodle image downloads (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 JNIEnv* env = base::android::AttachCurrentThread(); 294 JNIEnv* env = base::android::AttachCurrentThread();
295 295
296 if (image.IsEmpty()) { 296 if (image.IsEmpty()) {
297 DLOG(WARNING) << "Failed to download doodle image"; 297 DLOG(WARNING) << "Failed to download doodle image";
298 Java_LogoObserver_onLogoAvailable(env, j_logo_observer_, 298 Java_LogoObserver_onLogoAvailable(env, j_logo_observer_,
299 ScopedJavaLocalRef<jobject>(), 299 ScopedJavaLocalRef<jobject>(),
300 config_from_cache); 300 config_from_cache);
301 return; 301 return;
302 } 302 }
303 303
304 UMA_HISTOGRAM_BOOLEAN("NewTabPage.LogoImageDownloaded",
305 metadata.from_http_cache);
306
304 ScopedJavaLocalRef<jobject> j_logo = MakeJavaLogo( 307 ScopedJavaLocalRef<jobject> j_logo = MakeJavaLogo(
305 env, image.ToSkBitmap(), on_click_url, alt_text, animated_image_url); 308 env, image.ToSkBitmap(), on_click_url, alt_text, animated_image_url);
306 Java_LogoObserver_onLogoAvailable(env, j_logo_observer_, j_logo, 309 Java_LogoObserver_onLogoAvailable(env, j_logo_observer_, j_logo,
307 config_from_cache); 310 config_from_cache);
308 } 311 }
309 312
310 // static 313 // static
311 bool RegisterLogoBridge(JNIEnv* env) { 314 bool RegisterLogoBridge(JNIEnv* env) {
312 return RegisterNativesImpl(env); 315 return RegisterNativesImpl(env);
313 } 316 }
OLDNEW
« no previous file with comments | « no previous file | components/search_provider_logos/logo_tracker.h » ('j') | components/search_provider_logos/logo_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698