| OLD | NEW |
| 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 "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "chrome/browser/android/shortcut_info.h" | 11 #include "chrome/browser/android/shortcut_info.h" |
| 12 #include "chrome/browser/banners/app_banner_settings_helper.h" | 12 #include "chrome/browser/banners/app_banner_settings_helper.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/engagement/site_engagement_service.h" | 14 #include "chrome/browser/engagement/site_engagement_service.h" |
| 15 #include "chrome/browser/prefs/pref_metrics_service.h" | 15 #include "chrome/browser/prefs/pref_metrics_service.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "components/rappor/rappor_utils.h" | 17 #include "components/rappor/rappor_utils.h" |
| 18 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 19 #include "jni/LaunchMetrics_jni.h" | 19 #include "jni/LaunchMetrics_jni.h" |
| 20 #include "url/gurl.h" | 20 #include "url/gurl.h" |
| 21 | 21 |
| 22 using base::android::JavaParamRef; |
| 23 |
| 22 namespace metrics { | 24 namespace metrics { |
| 23 | 25 |
| 24 enum HomeScreenLaunch { | 26 enum HomeScreenLaunch { |
| 25 HOME_SCREEN_LAUNCH_STANDALONE = 0, | 27 HOME_SCREEN_LAUNCH_STANDALONE = 0, |
| 26 HOME_SCREEN_LAUNCH_SHORTCUT = 1, | 28 HOME_SCREEN_LAUNCH_SHORTCUT = 1, |
| 27 HOME_SCREEN_LAUNCH_COUNT = 2 | 29 HOME_SCREEN_LAUNCH_COUNT = 2 |
| 28 }; | 30 }; |
| 29 | 31 |
| 30 bool RegisterLaunchMetrics(JNIEnv* env) { | 32 bool RegisterLaunchMetrics(JNIEnv* env) { |
| 31 return RegisterNativesImpl(env); | 33 return RegisterNativesImpl(env); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 jboolean homepage_is_ntp, | 97 jboolean homepage_is_ntp, |
| 96 const JavaParamRef<jstring>& jhomepage_url) { | 98 const JavaParamRef<jstring>& jhomepage_url) { |
| 97 GURL homepage_url(base::android::ConvertJavaStringToUTF8(env, jhomepage_url)); | 99 GURL homepage_url(base::android::ConvertJavaStringToUTF8(env, jhomepage_url)); |
| 98 PrefMetricsService::RecordHomePageLaunchMetrics( | 100 PrefMetricsService::RecordHomePageLaunchMetrics( |
| 99 show_home_button, | 101 show_home_button, |
| 100 homepage_is_ntp, | 102 homepage_is_ntp, |
| 101 homepage_url); | 103 homepage_url); |
| 102 } | 104 } |
| 103 | 105 |
| 104 }; // namespace metrics | 106 }; // namespace metrics |
| OLD | NEW |