| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file defines a service that collects information about the user | 5 // This file defines a service that collects information about the user |
| 6 // experience in order to help improve future versions of the app. | 6 // experience in order to help improve future versions of the app. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/metrics/metrics_log.h" | 22 #include "chrome/browser/metrics/metrics_log.h" |
| 23 #include "chrome/browser/metrics/tracking_synchronizer_observer.h" | 23 #include "chrome/browser/metrics/tracking_synchronizer_observer.h" |
| 24 #include "chrome/common/metrics/metrics_service_base.h" | 24 #include "chrome/common/metrics/metrics_service_base.h" |
| 25 #include "chrome/installer/util/google_update_settings.h" | 25 #include "chrome/installer/util/google_update_settings.h" |
| 26 #include "content/public/browser/browser_child_process_observer.h" | 26 #include "content/public/browser/browser_child_process_observer.h" |
| 27 #include "content/public/browser/notification_observer.h" | 27 #include "content/public/browser/notification_observer.h" |
| 28 #include "content/public/browser/notification_registrar.h" | 28 #include "content/public/browser/notification_registrar.h" |
| 29 #include "content/public/browser/user_metrics.h" | 29 #include "content/public/browser/user_metrics.h" |
| 30 #include "net/url_request/url_fetcher_delegate.h" | 30 #include "net/url_request/url_fetcher_delegate.h" |
| 31 | 31 |
| 32 #if defined(OS_CHROMEOS) | 32 #if defined(OS_ANDROID) |
| 33 #include "chrome/browser/android/activity_type_ids.h" |
| 34 #elif defined(OS_CHROMEOS) |
| 33 #include "chrome/browser/chromeos/external_metrics.h" | 35 #include "chrome/browser/chromeos/external_metrics.h" |
| 34 #endif | 36 #endif |
| 35 | 37 |
| 36 class MetricsReportingScheduler; | 38 class MetricsReportingScheduler; |
| 37 class PrefService; | 39 class PrefService; |
| 38 class PrefRegistrySimple; | 40 class PrefRegistrySimple; |
| 39 class Profile; | 41 class Profile; |
| 40 class TemplateURLService; | 42 class TemplateURLService; |
| 41 | 43 |
| 42 namespace base { | 44 namespace base { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 const content::NotificationDetails& details) OVERRIDE; | 185 const content::NotificationDetails& details) OVERRIDE; |
| 184 | 186 |
| 185 // Invoked when we get a WM_SESSIONEND. This places a value in prefs that is | 187 // Invoked when we get a WM_SESSIONEND. This places a value in prefs that is |
| 186 // reset when RecordCompletedSessionEnd is invoked. | 188 // reset when RecordCompletedSessionEnd is invoked. |
| 187 void RecordStartOfSessionEnd(); | 189 void RecordStartOfSessionEnd(); |
| 188 | 190 |
| 189 // This should be called when the application is shutting down. It records | 191 // This should be called when the application is shutting down. It records |
| 190 // that session end was successful. | 192 // that session end was successful. |
| 191 void RecordCompletedSessionEnd(); | 193 void RecordCompletedSessionEnd(); |
| 192 | 194 |
| 195 #if defined(OS_ANDROID) |
| 196 // Called to record histograms. |
| 197 void RecordAndroidStabilityHistograms(); |
| 198 |
| 199 // Called when the Activity that the user interacts with is swapped out. |
| 200 void OnForegroundActivityChanged(ActivityTypeIds::Type type); |
| 201 #endif // defined(OS_ANDROID) |
| 202 |
| 193 #if defined(OS_ANDROID) || defined(OS_IOS) | 203 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 194 // Called when the application is going into background mode. | 204 // Called when the application is going into background mode. |
| 195 void OnAppEnterBackground(); | 205 void OnAppEnterBackground(); |
| 196 | 206 |
| 197 // Called when the application is coming out of background mode. | 207 // Called when the application is coming out of background mode. |
| 198 void OnAppEnterForeground(); | 208 void OnAppEnterForeground(); |
| 199 #else | 209 #else |
| 200 // Set the dirty flag, which will require a later call to LogCleanShutdown(). | 210 // Set the dirty flag, which will require a later call to LogCleanShutdown(). |
| 201 static void LogNeedForCleanShutdown(); | 211 static void LogNeedForCleanShutdown(); |
| 202 #endif // defined(OS_ANDROID) || defined(OS_IOS) | 212 #endif // defined(OS_ANDROID) || defined(OS_IOS) |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 friend class extensions::ExtensionDownloader; | 594 friend class extensions::ExtensionDownloader; |
| 585 friend class extensions::ManifestFetchData; | 595 friend class extensions::ManifestFetchData; |
| 586 | 596 |
| 587 // Returns true if prefs::kMetricsReportingEnabled is set. | 597 // Returns true if prefs::kMetricsReportingEnabled is set. |
| 588 static bool IsMetricsReportingEnabled(); | 598 static bool IsMetricsReportingEnabled(); |
| 589 | 599 |
| 590 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 600 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 591 }; | 601 }; |
| 592 | 602 |
| 593 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 603 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |