| 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 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/common/metrics/metrics_service_base.h" | 28 #include "chrome/common/metrics/metrics_service_base.h" |
| 29 #include "chrome/installer/util/google_update_settings.h" | 29 #include "chrome/installer/util/google_update_settings.h" |
| 30 #include "content/public/browser/browser_child_process_observer.h" | 30 #include "content/public/browser/browser_child_process_observer.h" |
| 31 #include "content/public/browser/notification_observer.h" | 31 #include "content/public/browser/notification_observer.h" |
| 32 #include "content/public/browser/notification_registrar.h" | 32 #include "content/public/browser/notification_registrar.h" |
| 33 #include "content/public/browser/user_metrics.h" | 33 #include "content/public/browser/user_metrics.h" |
| 34 #include "net/url_request/url_fetcher_delegate.h" | 34 #include "net/url_request/url_fetcher_delegate.h" |
| 35 | 35 |
| 36 #if defined(OS_ANDROID) | 36 #if defined(OS_ANDROID) |
| 37 #include "chrome/browser/android/activity_type_ids.h" | 37 #include "chrome/browser/android/activity_type_ids.h" |
| 38 #elif defined(OS_CHROMEOS) | |
| 39 #include "chrome/browser/chromeos/external_metrics.h" | |
| 40 #endif | 38 #endif |
| 41 | 39 |
| 42 class ChromeBrowserMetricsServiceObserver; | 40 class ChromeBrowserMetricsServiceObserver; |
| 43 class MetricsReportingScheduler; | 41 class MetricsReportingScheduler; |
| 44 class PrefService; | 42 class PrefService; |
| 45 class PrefRegistrySimple; | 43 class PrefRegistrySimple; |
| 46 class Profile; | 44 class Profile; |
| 47 class TemplateURLService; | 45 class TemplateURLService; |
| 48 | 46 |
| 49 namespace { | 47 namespace { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // This count is eventually send via UMA logs. | 246 // This count is eventually send via UMA logs. |
| 249 void RecordBreakpadHasDebugger(bool has_debugger); | 247 void RecordBreakpadHasDebugger(bool has_debugger); |
| 250 | 248 |
| 251 #if defined(OS_WIN) | 249 #if defined(OS_WIN) |
| 252 // Counts (and removes) the browser crash dump attempt signals left behind by | 250 // Counts (and removes) the browser crash dump attempt signals left behind by |
| 253 // any previous browser processes which generated a crash dump. | 251 // any previous browser processes which generated a crash dump. |
| 254 void CountBrowserCrashDumpAttempts(); | 252 void CountBrowserCrashDumpAttempts(); |
| 255 #endif // OS_WIN | 253 #endif // OS_WIN |
| 256 | 254 |
| 257 #if defined(OS_CHROMEOS) | 255 #if defined(OS_CHROMEOS) |
| 258 // Start the external metrics service, which collects metrics from Chrome OS | |
| 259 // and passes them to UMA. | |
| 260 void StartExternalMetrics(); | |
| 261 | |
| 262 // Records a Chrome OS crash. | 256 // Records a Chrome OS crash. |
| 263 void LogChromeOSCrash(const std::string &crash_type); | 257 void LogChromeOSCrash(const std::string &crash_type); |
| 264 #endif | 258 #endif |
| 265 | 259 |
| 266 bool recording_active() const; | 260 bool recording_active() const; |
| 267 bool reporting_active() const; | 261 bool reporting_active() const; |
| 268 | 262 |
| 269 void LogPluginLoadingError(const base::FilePath& plugin_path); | 263 void LogPluginLoadingError(const base::FilePath& plugin_path); |
| 270 | 264 |
| 271 // Redundant test to ensure that we are notified of a clean exit. | 265 // Redundant test to ensure that we are notified of a clean exit. |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 // The scheduler for determining when uploads should happen. | 560 // The scheduler for determining when uploads should happen. |
| 567 scoped_ptr<MetricsReportingScheduler> scheduler_; | 561 scoped_ptr<MetricsReportingScheduler> scheduler_; |
| 568 | 562 |
| 569 // Indicates that an asynchronous reporting step is running. | 563 // Indicates that an asynchronous reporting step is running. |
| 570 // This is used only for debugging. | 564 // This is used only for debugging. |
| 571 bool waiting_for_asynchronous_reporting_step_; | 565 bool waiting_for_asynchronous_reporting_step_; |
| 572 | 566 |
| 573 // Number of async histogram fetch requests in progress. | 567 // Number of async histogram fetch requests in progress. |
| 574 int num_async_histogram_fetches_in_progress_; | 568 int num_async_histogram_fetches_in_progress_; |
| 575 | 569 |
| 576 #if defined(OS_CHROMEOS) | |
| 577 // The external metric service is used to log ChromeOS UMA events. | |
| 578 scoped_refptr<chromeos::ExternalMetrics> external_metrics_; | |
| 579 #endif | |
| 580 | |
| 581 // Stores the time of the first call to |GetUptimes()|. | 570 // Stores the time of the first call to |GetUptimes()|. |
| 582 base::TimeTicks first_updated_time_; | 571 base::TimeTicks first_updated_time_; |
| 583 | 572 |
| 584 // Stores the time of the last call to |GetUptimes()|. | 573 // Stores the time of the last call to |GetUptimes()|. |
| 585 base::TimeTicks last_updated_time_; | 574 base::TimeTicks last_updated_time_; |
| 586 | 575 |
| 587 // Execution phase the browser is in. | 576 // Execution phase the browser is in. |
| 588 static ExecutionPhase execution_phase_; | 577 static ExecutionPhase execution_phase_; |
| 589 | 578 |
| 590 // Reduntant marker to check that we completed our shutdown, and set the | 579 // Reduntant marker to check that we completed our shutdown, and set the |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 | 629 |
| 641 // Registers/unregisters |observer| to receive MetricsLog notifications | 630 // Registers/unregisters |observer| to receive MetricsLog notifications |
| 642 // from metrics service. | 631 // from metrics service. |
| 643 static void AddMetricsServiceObserver(MetricsServiceObserver* observer); | 632 static void AddMetricsServiceObserver(MetricsServiceObserver* observer); |
| 644 static void RemoveMetricsServiceObserver(MetricsServiceObserver* observer); | 633 static void RemoveMetricsServiceObserver(MetricsServiceObserver* observer); |
| 645 | 634 |
| 646 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 635 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 647 }; | 636 }; |
| 648 | 637 |
| 649 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 638 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |