[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "components/metrics/test_metrics_service_client.h" | ||||
6 | |||||
[email protected] | 4b4892b | 2014-05-22 15:06:15 | [diff] [blame] | 7 | #include "base/callback.h" |
[email protected] | 0d5a61a8 | 2014-05-31 22:28:34 | [diff] [blame] | 8 | #include "components/metrics/metrics_log_uploader.h" |
asvitkine | 4c1d1ef | 2014-09-29 20:57:32 | [diff] [blame] | 9 | #include "components/metrics/proto/chrome_user_metrics_extension.pb.h" |
[email protected] | 4b4892b | 2014-05-22 15:06:15 | [diff] [blame] | 10 | |
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 11 | namespace metrics { |
12 | |||||
[email protected] | 09dee82d | 2014-05-22 14:00:53 | [diff] [blame] | 13 | // static |
14 | const char TestMetricsServiceClient::kBrandForTesting[] = "brand_for_testing"; | ||||
15 | |||||
[email protected] | 91b1d91 | 2014-06-05 10:52:08 | [diff] [blame] | 16 | TestMetricsServiceClient::TestMetricsServiceClient() |
asvitkine | 4c1d1ef | 2014-09-29 20:57:32 | [diff] [blame] | 17 | : version_string_("5.0.322.0-64-devel"), |
18 | product_(ChromeUserMetricsExtension::CHROME) { | ||||
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 19 | } |
20 | |||||
21 | TestMetricsServiceClient::~TestMetricsServiceClient() { | ||||
22 | } | ||||
23 | |||||
blundell | fecea528d | 2015-10-21 10:10:22 | [diff] [blame^] | 24 | metrics::MetricsService* TestMetricsServiceClient::GetMetricsService() { |
25 | return nullptr; | ||||
26 | } | ||||
27 | |||||
[email protected] | 9d1b015 | 2014-07-09 18:53:22 | [diff] [blame] | 28 | void TestMetricsServiceClient::SetMetricsClientId( |
29 | const std::string& client_id) { | ||||
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 30 | client_id_ = client_id; |
31 | } | ||||
32 | |||||
Mark Mentovai | c67fa64f | 2015-03-24 14:00:06 | [diff] [blame] | 33 | void TestMetricsServiceClient::OnRecordingDisabled() { |
34 | } | ||||
35 | |||||
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 36 | bool TestMetricsServiceClient::IsOffTheRecordSessionActive() { |
37 | return false; | ||||
38 | } | ||||
39 | |||||
asvitkine | 4c1d1ef | 2014-09-29 20:57:32 | [diff] [blame] | 40 | int32_t TestMetricsServiceClient::GetProduct() { |
41 | return product_; | ||||
42 | } | ||||
43 | |||||
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 44 | std::string TestMetricsServiceClient::GetApplicationLocale() { |
45 | return "en-US"; | ||||
46 | } | ||||
47 | |||||
48 | bool TestMetricsServiceClient::GetBrand(std::string* brand_code) { | ||||
[email protected] | 09dee82d | 2014-05-22 14:00:53 | [diff] [blame] | 49 | *brand_code = kBrandForTesting; |
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 50 | return true; |
51 | } | ||||
52 | |||||
53 | SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() { | ||||
54 | return SystemProfileProto::CHANNEL_BETA; | ||||
55 | } | ||||
56 | |||||
57 | std::string TestMetricsServiceClient::GetVersionString() { | ||||
[email protected] | bfb77b5 | 2014-06-07 01:54:01 | [diff] [blame] | 58 | return version_string_; |
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 59 | } |
60 | |||||
[email protected] | 7392942 | 2014-05-22 08:19:05 | [diff] [blame] | 61 | void TestMetricsServiceClient::OnLogUploadComplete() { |
62 | } | ||||
63 | |||||
isherman | b670568 | 2015-08-29 00:01:00 | [diff] [blame] | 64 | void TestMetricsServiceClient::InitializeSystemProfileMetrics( |
[email protected] | 06c1083 | 2014-05-23 10:55:55 | [diff] [blame] | 65 | const base::Closure& done_callback) { |
66 | done_callback.Run(); | ||||
67 | } | ||||
68 | |||||
isherman | b670568 | 2015-08-29 00:01:00 | [diff] [blame] | 69 | void TestMetricsServiceClient::CollectFinalMetricsForLog( |
[email protected] | 4b4892b | 2014-05-22 15:06:15 | [diff] [blame] | 70 | const base::Closure& done_callback) { |
71 | done_callback.Run(); | ||||
72 | } | ||||
73 | |||||
[email protected] | 0d5a61a8 | 2014-05-31 22:28:34 | [diff] [blame] | 74 | scoped_ptr<MetricsLogUploader> TestMetricsServiceClient::CreateUploader( |
[email protected] | 0d5a61a8 | 2014-05-31 22:28:34 | [diff] [blame] | 75 | const base::Callback<void(int)>& on_upload_complete) { |
76 | return scoped_ptr<MetricsLogUploader>(); | ||||
77 | } | ||||
78 | |||||
gunsch | 7cbdcb2 | 2015-03-13 17:02:05 | [diff] [blame] | 79 | base::TimeDelta TestMetricsServiceClient::GetStandardUploadInterval() { |
80 | return base::TimeDelta::FromMinutes(5); | ||||
81 | } | ||||
82 | |||||
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 83 | } // namespace metrics |