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

Side by Side Diff: chrome/browser/android/metrics/launch_metrics.cc

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/metrics/launch_metrics.h" 5 #include "chrome/browser/android/metrics/launch_metrics.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/metrics/user_metrics.h" 9 #include "base/metrics/user_metrics.h"
10 #include "chrome/browser/android/shortcut_info.h" 10 #include "chrome/browser/android/shortcut_info.h"
(...skipping 11 matching lines...) Expand all
22 HOME_SCREEN_LAUNCH_SHORTCUT = 1, 22 HOME_SCREEN_LAUNCH_SHORTCUT = 1,
23 HOME_SCREEN_LAUNCH_COUNT = 2 23 HOME_SCREEN_LAUNCH_COUNT = 2
24 }; 24 };
25 25
26 bool RegisterLaunchMetrics(JNIEnv* env) { 26 bool RegisterLaunchMetrics(JNIEnv* env) {
27 return RegisterNativesImpl(env); 27 return RegisterNativesImpl(env);
28 } 28 }
29 29
30 static void RecordLaunch(JNIEnv* env, jclass caller, jboolean standalone, 30 static void RecordLaunch(JNIEnv* env, jclass caller, jboolean standalone,
31 jstring jurl, int source, jobject jweb_contents) { 31 jstring jurl, int source, jobject jweb_contents) {
32 #if !defined(USE_AURA)
32 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl)); 33 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl));
33 34
34 content::WebContents* web_contents = 35 content::WebContents* web_contents =
35 content::WebContents::FromJavaWebContents(jweb_contents); 36 content::WebContents::FromJavaWebContents(jweb_contents);
36 if (web_contents && source == ShortcutInfo::SOURCE_APP_BANNER) { 37 if (web_contents && source == ShortcutInfo::SOURCE_APP_BANNER) {
37 // What a user has installed on the Home screen can become disconnected from 38 // What a user has installed on the Home screen can become disconnected from
38 // what Chrome believes is on the Home screen if the user clears their data. 39 // what Chrome believes is on the Home screen if the user clears their data.
39 // Use the launch as a signal that the shortcut still exists. 40 // Use the launch as a signal that the shortcut still exists.
40 AppBannerSettingsHelper::RecordBannerEvent( 41 AppBannerSettingsHelper::RecordBannerEvent(
41 web_contents, url, url.spec(), 42 web_contents, url, url.spec(),
(...skipping 22 matching lines...) Expand all
64 int action = standalone ? HOME_SCREEN_LAUNCH_STANDALONE 65 int action = standalone ? HOME_SCREEN_LAUNCH_STANDALONE
65 : HOME_SCREEN_LAUNCH_SHORTCUT; 66 : HOME_SCREEN_LAUNCH_SHORTCUT;
66 std::string rappor_metric_action = standalone ? "Launch.HomeScreen.Standalone" 67 std::string rappor_metric_action = standalone ? "Launch.HomeScreen.Standalone"
67 : "Launch.HomeScreen.Shortcut"; 68 : "Launch.HomeScreen.Shortcut";
68 69
69 UMA_HISTOGRAM_ENUMERATION("Launch.HomeScreen", action, 70 UMA_HISTOGRAM_ENUMERATION("Launch.HomeScreen", action,
70 HOME_SCREEN_LAUNCH_COUNT); 71 HOME_SCREEN_LAUNCH_COUNT);
71 72
72 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), 73 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
73 rappor_metric_action, url); 74 rappor_metric_action, url);
75 #endif
74 } 76 }
75 77
76 }; // namespace metrics 78 }; // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698