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 #ifndef COMPONENTS_METRICS_TEST_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef COMPONENTS_METRICS_TEST_METRICS_SERVICE_CLIENT_H_ |
6 #define COMPONENTS_METRICS_TEST_METRICS_SERVICE_CLIENT_H_ | 6 #define COMPONENTS_METRICS_TEST_METRICS_SERVICE_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "components/metrics/metrics_service_client.h" | 13 #include "components/metrics/metrics_service_client.h" |
14 | 14 |
15 namespace metrics { | 15 namespace metrics { |
16 | 16 |
17 // A simple concrete implementation of the MetricsServiceClient interface, for | 17 // A simple concrete implementation of the MetricsServiceClient interface, for |
18 // use in tests. | 18 // use in tests. |
19 class TestMetricsServiceClient : public MetricsServiceClient { | 19 class TestMetricsServiceClient : public MetricsServiceClient { |
20 public: | 20 public: |
21 static const char kBrandForTesting[]; | 21 static const char kBrandForTesting[]; |
22 | 22 |
23 TestMetricsServiceClient(); | 23 TestMetricsServiceClient(); |
24 ~TestMetricsServiceClient() override; | 24 ~TestMetricsServiceClient() override; |
25 | 25 |
26 // MetricsServiceClient: | 26 // MetricsServiceClient: |
27 metrics::MetricsService* GetMetricsService() override; | 27 metrics::MetricsService* GetMetricsService() override; |
28 void SetMetricsClientId(const std::string& client_id) override; | 28 void SetMetricsClientId(const std::string& client_id) override; |
29 bool IsOffTheRecordSessionActive() override; | |
30 int32_t GetProduct() override; | 29 int32_t GetProduct() override; |
31 std::string GetApplicationLocale() override; | 30 std::string GetApplicationLocale() override; |
32 bool GetBrand(std::string* brand_code) override; | 31 bool GetBrand(std::string* brand_code) override; |
33 SystemProfileProto::Channel GetChannel() override; | 32 SystemProfileProto::Channel GetChannel() override; |
34 std::string GetVersionString() override; | 33 std::string GetVersionString() override; |
35 void OnLogUploadComplete() override; | 34 void OnLogUploadComplete() override; |
36 void InitializeSystemProfileMetrics( | 35 void InitializeSystemProfileMetrics( |
37 const base::Closure& done_callback) override; | 36 const base::Closure& done_callback) override; |
38 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; | 37 void CollectFinalMetricsForLog(const base::Closure& done_callback) override; |
39 std::unique_ptr<MetricsLogUploader> CreateUploader( | 38 std::unique_ptr<MetricsLogUploader> CreateUploader( |
(...skipping 18 matching lines...) Expand all Loading... |
58 int32_t product_; | 57 int32_t product_; |
59 bool reporting_is_managed_; | 58 bool reporting_is_managed_; |
60 EnableMetricsDefault enable_default_; | 59 EnableMetricsDefault enable_default_; |
61 | 60 |
62 DISALLOW_COPY_AND_ASSIGN(TestMetricsServiceClient); | 61 DISALLOW_COPY_AND_ASSIGN(TestMetricsServiceClient); |
63 }; | 62 }; |
64 | 63 |
65 } // namespace metrics | 64 } // namespace metrics |
66 | 65 |
67 #endif // COMPONENTS_METRICS_TEST_METRICS_SERVICE_CLIENT_H_ | 66 #endif // COMPONENTS_METRICS_TEST_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |