| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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/uma_session_stats.h" | 5 #include "chrome/browser/android/metrics/uma_session_stats.h" |
| 6 | 6 |
| 7 #include "base/android/jni_array.h" | 7 #include "base/android/jni_array.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 14 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 14 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "chrome/installer/util/google_update_settings.h" | 17 #include "chrome/installer/util/google_update_settings.h" |
| 18 #include "components/metrics/metrics_pref_names.h" | 18 #include "components/metrics/metrics_pref_names.h" |
| 19 #include "components/metrics/metrics_service.h" | 19 #include "components/metrics/metrics_service.h" |
| 20 #include "components/metrics_services_manager/metrics_services_manager.h" | 20 #include "components/metrics_services_manager/metrics_services_manager.h" |
| 21 #include "components/prefs/pref_service.h" | 21 #include "components/prefs/pref_service.h" |
| 22 #include "components/variations/metrics_util.h" | 22 #include "components/variations/metrics_util.h" |
| 23 #include "components/variations/variations_associated_data.h" | 23 #include "components/variations/variations_associated_data.h" |
| 24 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
| 25 #include "content/public/browser/user_metrics.h" | 25 #include "content/public/browser/user_metrics.h" |
| 26 #include "jni/UmaSessionStats_jni.h" | 26 #include "jni/UmaSessionStats_jni.h" |
| 27 | 27 |
| 28 using base::android::ConvertJavaStringToUTF8; | 28 using base::android::ConvertJavaStringToUTF8; |
| 29 using base::android::JavaParamRef; |
| 29 using base::UserMetricsAction; | 30 using base::UserMetricsAction; |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| 32 UmaSessionStats* g_uma_session_stats = NULL; | 33 UmaSessionStats* g_uma_session_stats = NULL; |
| 33 } // namespace | 34 } // namespace |
| 34 | 35 |
| 35 UmaSessionStats::UmaSessionStats() | 36 UmaSessionStats::UmaSessionStats() |
| 36 : active_session_count_(0) { | 37 : active_session_count_(0) { |
| 37 } | 38 } |
| 38 | 39 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // We should have only one UmaSessionStats instance. | 212 // We should have only one UmaSessionStats instance. |
| 212 DCHECK(!g_uma_session_stats); | 213 DCHECK(!g_uma_session_stats); |
| 213 g_uma_session_stats = new UmaSessionStats(); | 214 g_uma_session_stats = new UmaSessionStats(); |
| 214 return reinterpret_cast<intptr_t>(g_uma_session_stats); | 215 return reinterpret_cast<intptr_t>(g_uma_session_stats); |
| 215 } | 216 } |
| 216 | 217 |
| 217 // Register native methods | 218 // Register native methods |
| 218 bool RegisterUmaSessionStats(JNIEnv* env) { | 219 bool RegisterUmaSessionStats(JNIEnv* env) { |
| 219 return RegisterNativesImpl(env); | 220 return RegisterNativesImpl(env); |
| 220 } | 221 } |
| OLD | NEW |