| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_METRICS_METRICS_SERVICE_H_ | 8 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_H_ |
| 9 #define COMPONENTS_METRICS_METRICS_SERVICE_H_ | 9 #define COMPONENTS_METRICS_METRICS_SERVICE_H_ |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/metrics/field_trial.h" | 20 #include "base/metrics/field_trial.h" |
| 21 #include "base/metrics/histogram_flattener.h" | 21 #include "base/metrics/histogram_flattener.h" |
| 22 #include "base/metrics/histogram_snapshot_manager.h" | 22 #include "base/metrics/histogram_snapshot_manager.h" |
| 23 #include "base/metrics/user_metrics.h" | 23 #include "base/metrics/user_metrics.h" |
| 24 #include "base/time/time.h" | 24 #include "base/time/time.h" |
| 25 #include "components/metrics/clean_exit_beacon.h" |
| 25 #include "components/metrics/metrics_log.h" | 26 #include "components/metrics/metrics_log.h" |
| 26 #include "components/metrics/metrics_log_manager.h" | 27 #include "components/metrics/metrics_log_manager.h" |
| 27 #include "components/metrics/metrics_provider.h" | 28 #include "components/metrics/metrics_provider.h" |
| 28 #include "components/variations/active_field_trials.h" | 29 #include "components/variations/active_field_trials.h" |
| 29 | 30 |
| 30 class MetricsServiceAccessor; | 31 class MetricsServiceAccessor; |
| 31 class PrefService; | 32 class PrefService; |
| 32 class PrefRegistrySimple; | 33 class PrefRegistrySimple; |
| 33 | 34 |
| 34 namespace base { | 35 namespace base { |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 380 |
| 380 // Used to interact with the embedder. Weak pointer; must outlive |this| | 381 // Used to interact with the embedder. Weak pointer; must outlive |this| |
| 381 // instance. | 382 // instance. |
| 382 MetricsServiceClient* const client_; | 383 MetricsServiceClient* const client_; |
| 383 | 384 |
| 384 // Registered metrics providers. | 385 // Registered metrics providers. |
| 385 ScopedVector<MetricsProvider> metrics_providers_; | 386 ScopedVector<MetricsProvider> metrics_providers_; |
| 386 | 387 |
| 387 PrefService* local_state_; | 388 PrefService* local_state_; |
| 388 | 389 |
| 390 CleanExitBeacon clean_exit_beacon_; |
| 391 |
| 389 base::ActionCallback action_callback_; | 392 base::ActionCallback action_callback_; |
| 390 | 393 |
| 391 // Indicate whether recording and reporting are currently happening. | 394 // Indicate whether recording and reporting are currently happening. |
| 392 // These should not be set directly, but by calling SetRecording and | 395 // These should not be set directly, but by calling SetRecording and |
| 393 // SetReporting. | 396 // SetReporting. |
| 394 bool recording_active_; | 397 bool recording_active_; |
| 395 bool reporting_active_; | 398 bool reporting_active_; |
| 396 | 399 |
| 397 // Indicate whether test mode is enabled, where the initial log should never | 400 // Indicate whether test mode is enabled, where the initial log should never |
| 398 // be cut, and logs are neither persisted nor uploaded. | 401 // be cut, and logs are neither persisted nor uploaded. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, | 459 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, |
| 457 PermutedEntropyCacheClearedWhenLowEntropyReset); | 460 PermutedEntropyCacheClearedWhenLowEntropyReset); |
| 458 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial); | 461 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial); |
| 459 | 462 |
| 460 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 463 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
| 461 }; | 464 }; |
| 462 | 465 |
| 463 } // namespace metrics | 466 } // namespace metrics |
| 464 | 467 |
| 465 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ | 468 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |