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 #include "components/metrics/proto/chrome_user_metrics_extension.pb.h" |
9 | 10 |
10 namespace metrics { | 11 namespace metrics { |
11 | 12 |
12 // static | 13 // static |
13 const char TestMetricsServiceClient::kBrandForTesting[] = "brand_for_testing"; | 14 const char TestMetricsServiceClient::kBrandForTesting[] = "brand_for_testing"; |
14 | 15 |
15 TestMetricsServiceClient::TestMetricsServiceClient() | 16 TestMetricsServiceClient::TestMetricsServiceClient() |
16 : version_string_("5.0.322.0-64-devel") { | 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::SetMetricsClientId( | 23 void TestMetricsServiceClient::SetMetricsClientId( |
23 const std::string& client_id) { | 24 const std::string& client_id) { |
24 client_id_ = client_id; | 25 client_id_ = client_id; |
25 } | 26 } |
26 | 27 |
27 bool TestMetricsServiceClient::IsOffTheRecordSessionActive() { | 28 bool TestMetricsServiceClient::IsOffTheRecordSessionActive() { |
28 return false; | 29 return false; |
29 } | 30 } |
30 | 31 |
| 32 int32 TestMetricsServiceClient::GetProduct() { |
| 33 return ChromeUserMetricsExtension::CHROME; |
| 34 } |
| 35 |
31 std::string TestMetricsServiceClient::GetApplicationLocale() { | 36 std::string TestMetricsServiceClient::GetApplicationLocale() { |
32 return "en-US"; | 37 return "en-US"; |
33 } | 38 } |
34 | 39 |
35 bool TestMetricsServiceClient::GetBrand(std::string* brand_code) { | 40 bool TestMetricsServiceClient::GetBrand(std::string* brand_code) { |
36 *brand_code = kBrandForTesting; | 41 *brand_code = kBrandForTesting; |
37 return true; | 42 return true; |
38 } | 43 } |
39 | 44 |
40 SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() { | 45 SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() { |
(...skipping 18 matching lines...) Expand all Loading... |
59 } | 64 } |
60 | 65 |
61 scoped_ptr<MetricsLogUploader> TestMetricsServiceClient::CreateUploader( | 66 scoped_ptr<MetricsLogUploader> TestMetricsServiceClient::CreateUploader( |
62 const std::string& server_url, | 67 const std::string& server_url, |
63 const std::string& mime_type, | 68 const std::string& mime_type, |
64 const base::Callback<void(int)>& on_upload_complete) { | 69 const base::Callback<void(int)>& on_upload_complete) { |
65 return scoped_ptr<MetricsLogUploader>(); | 70 return scoped_ptr<MetricsLogUploader>(); |
66 } | 71 } |
67 | 72 |
68 } // namespace metrics | 73 } // namespace metrics |
OLD | NEW |