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 #include "components/metrics/test_metrics_service_client.h" | 5 #include "components/metrics/test_metrics_service_client.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "components/metrics/metrics_log_uploader.h" | 8 #include "components/metrics/metrics_log_uploader.h" |
9 | 9 |
10 namespace metrics { | 10 namespace metrics { |
11 | 11 |
12 // static | 12 // static |
13 const char TestMetricsServiceClient::kBrandForTesting[] = "brand_for_testing"; | 13 const char TestMetricsServiceClient::kBrandForTesting[] = "brand_for_testing"; |
14 | 14 |
15 TestMetricsServiceClient::TestMetricsServiceClient() | 15 TestMetricsServiceClient::TestMetricsServiceClient() |
16 : install_date_(0) { | 16 : install_date_(0), |
| 17 version_string_("5.0.322.0-64-devel") { |
17 } | 18 } |
18 | 19 |
19 TestMetricsServiceClient::~TestMetricsServiceClient() { | 20 TestMetricsServiceClient::~TestMetricsServiceClient() { |
20 } | 21 } |
21 | 22 |
22 void TestMetricsServiceClient::SetClientID(const std::string& client_id) { | 23 void TestMetricsServiceClient::SetClientID(const std::string& client_id) { |
23 client_id_ = client_id; | 24 client_id_ = client_id; |
24 } | 25 } |
25 | 26 |
26 bool TestMetricsServiceClient::IsOffTheRecordSessionActive() { | 27 bool TestMetricsServiceClient::IsOffTheRecordSessionActive() { |
27 return false; | 28 return false; |
28 } | 29 } |
29 | 30 |
30 std::string TestMetricsServiceClient::GetApplicationLocale() { | 31 std::string TestMetricsServiceClient::GetApplicationLocale() { |
31 return "en-US"; | 32 return "en-US"; |
32 } | 33 } |
33 | 34 |
34 bool TestMetricsServiceClient::GetBrand(std::string* brand_code) { | 35 bool TestMetricsServiceClient::GetBrand(std::string* brand_code) { |
35 *brand_code = kBrandForTesting; | 36 *brand_code = kBrandForTesting; |
36 return true; | 37 return true; |
37 } | 38 } |
38 | 39 |
39 SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() { | 40 SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() { |
40 return SystemProfileProto::CHANNEL_BETA; | 41 return SystemProfileProto::CHANNEL_BETA; |
41 } | 42 } |
42 | 43 |
43 std::string TestMetricsServiceClient::GetVersionString() { | 44 std::string TestMetricsServiceClient::GetVersionString() { |
44 return "5.0.322.0-64-devel"; | 45 return version_string_; |
45 } | 46 } |
46 | 47 |
47 int64 TestMetricsServiceClient::GetInstallDate() { | 48 int64 TestMetricsServiceClient::GetInstallDate() { |
48 return install_date_; | 49 return install_date_; |
49 } | 50 } |
50 | 51 |
51 void TestMetricsServiceClient::OnLogUploadComplete() { | 52 void TestMetricsServiceClient::OnLogUploadComplete() { |
52 } | 53 } |
53 | 54 |
54 void TestMetricsServiceClient::StartGatheringMetrics( | 55 void TestMetricsServiceClient::StartGatheringMetrics( |
55 const base::Closure& done_callback) { | 56 const base::Closure& done_callback) { |
56 done_callback.Run(); | 57 done_callback.Run(); |
57 } | 58 } |
58 | 59 |
59 void TestMetricsServiceClient::CollectFinalMetrics( | 60 void TestMetricsServiceClient::CollectFinalMetrics( |
60 const base::Closure& done_callback) { | 61 const base::Closure& done_callback) { |
61 done_callback.Run(); | 62 done_callback.Run(); |
62 } | 63 } |
63 | 64 |
64 scoped_ptr<MetricsLogUploader> TestMetricsServiceClient::CreateUploader( | 65 scoped_ptr<MetricsLogUploader> TestMetricsServiceClient::CreateUploader( |
65 const std::string& server_url, | 66 const std::string& server_url, |
66 const std::string& mime_type, | 67 const std::string& mime_type, |
67 const base::Callback<void(int)>& on_upload_complete) { | 68 const base::Callback<void(int)>& on_upload_complete) { |
68 return scoped_ptr<MetricsLogUploader>(); | 69 return scoped_ptr<MetricsLogUploader>(); |
69 } | 70 } |
70 | 71 |
71 } // namespace metrics | 72 } // namespace metrics |
OLD | NEW |