[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" |
[email protected] | 4b4892b | 2014-05-22 15:06:15 | [diff] [blame] | 9 | |
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 10 | namespace metrics { |
11 | |||||
[email protected] | 09dee82d | 2014-05-22 14:00:53 | [diff] [blame] | 12 | // static |
13 | const char TestMetricsServiceClient::kBrandForTesting[] = "brand_for_testing"; | ||||
14 | |||||
[email protected] | 91b1d91 | 2014-06-05 10:52:08 | [diff] [blame] | 15 | TestMetricsServiceClient::TestMetricsServiceClient() |
[email protected] | bfb77b5 | 2014-06-07 01:54:01 | [diff] [blame^] | 16 | : install_date_(0), |
17 | version_string_("5.0.322.0-64-devel") { | ||||
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 18 | } |
19 | |||||
20 | TestMetricsServiceClient::~TestMetricsServiceClient() { | ||||
21 | } | ||||
22 | |||||
23 | void TestMetricsServiceClient::SetClientID(const std::string& client_id) { | ||||
24 | client_id_ = client_id; | ||||
25 | } | ||||
26 | |||||
27 | bool TestMetricsServiceClient::IsOffTheRecordSessionActive() { | ||||
28 | return false; | ||||
29 | } | ||||
30 | |||||
31 | std::string TestMetricsServiceClient::GetApplicationLocale() { | ||||
32 | return "en-US"; | ||||
33 | } | ||||
34 | |||||
35 | bool TestMetricsServiceClient::GetBrand(std::string* brand_code) { | ||||
[email protected] | 09dee82d | 2014-05-22 14:00:53 | [diff] [blame] | 36 | *brand_code = kBrandForTesting; |
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 37 | return true; |
38 | } | ||||
39 | |||||
40 | SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() { | ||||
41 | return SystemProfileProto::CHANNEL_BETA; | ||||
42 | } | ||||
43 | |||||
44 | std::string TestMetricsServiceClient::GetVersionString() { | ||||
[email protected] | bfb77b5 | 2014-06-07 01:54:01 | [diff] [blame^] | 45 | return version_string_; |
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 46 | } |
47 | |||||
[email protected] | 91b1d91 | 2014-06-05 10:52:08 | [diff] [blame] | 48 | int64 TestMetricsServiceClient::GetInstallDate() { |
49 | return install_date_; | ||||
50 | } | ||||
51 | |||||
[email protected] | 7392942 | 2014-05-22 08:19:05 | [diff] [blame] | 52 | void TestMetricsServiceClient::OnLogUploadComplete() { |
53 | } | ||||
54 | |||||
[email protected] | 06c1083 | 2014-05-23 10:55:55 | [diff] [blame] | 55 | void TestMetricsServiceClient::StartGatheringMetrics( |
56 | const base::Closure& done_callback) { | ||||
57 | done_callback.Run(); | ||||
58 | } | ||||
59 | |||||
[email protected] | 4b4892b | 2014-05-22 15:06:15 | [diff] [blame] | 60 | void TestMetricsServiceClient::CollectFinalMetrics( |
61 | const base::Closure& done_callback) { | ||||
62 | done_callback.Run(); | ||||
63 | } | ||||
64 | |||||
[email protected] | 0d5a61a8 | 2014-05-31 22:28:34 | [diff] [blame] | 65 | scoped_ptr<MetricsLogUploader> TestMetricsServiceClient::CreateUploader( |
66 | const std::string& server_url, | ||||
67 | const std::string& mime_type, | ||||
68 | const base::Callback<void(int)>& on_upload_complete) { | ||||
69 | return scoped_ptr<MetricsLogUploader>(); | ||||
70 | } | ||||
71 | |||||
[email protected] | 728de07 | 2014-05-21 09:20:32 | [diff] [blame] | 72 | } // namespace metrics |