blob: b17d3d3549b1a04814a53d0422ada1bd60607c5d [file] [log] [blame]
[email protected]728de072014-05-21 09:20:321// 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]4b4892b2014-05-22 15:06:157#include "base/callback.h"
[email protected]0d5a61a82014-05-31 22:28:348#include "components/metrics/metrics_log_uploader.h"
[email protected]4b4892b2014-05-22 15:06:159
[email protected]728de072014-05-21 09:20:3210namespace metrics {
11
[email protected]09dee82d2014-05-22 14:00:5312// static
13const char TestMetricsServiceClient::kBrandForTesting[] = "brand_for_testing";
14
[email protected]91b1d912014-06-05 10:52:0815TestMetricsServiceClient::TestMetricsServiceClient()
16 : install_date_(0) {
[email protected]728de072014-05-21 09:20:3217}
18
19TestMetricsServiceClient::~TestMetricsServiceClient() {
20}
21
22void TestMetricsServiceClient::SetClientID(const std::string& client_id) {
23 client_id_ = client_id;
24}
25
26bool TestMetricsServiceClient::IsOffTheRecordSessionActive() {
27 return false;
28}
29
30std::string TestMetricsServiceClient::GetApplicationLocale() {
31 return "en-US";
32}
33
34bool TestMetricsServiceClient::GetBrand(std::string* brand_code) {
[email protected]09dee82d2014-05-22 14:00:5335 *brand_code = kBrandForTesting;
[email protected]728de072014-05-21 09:20:3236 return true;
37}
38
39SystemProfileProto::Channel TestMetricsServiceClient::GetChannel() {
40 return SystemProfileProto::CHANNEL_BETA;
41}
42
43std::string TestMetricsServiceClient::GetVersionString() {
44 return "5.0.322.0-64-devel";
45}
46
[email protected]91b1d912014-06-05 10:52:0847int64 TestMetricsServiceClient::GetInstallDate() {
48 return install_date_;
49}
50
[email protected]73929422014-05-22 08:19:0551void TestMetricsServiceClient::OnLogUploadComplete() {
52}
53
[email protected]06c10832014-05-23 10:55:5554void TestMetricsServiceClient::StartGatheringMetrics(
55 const base::Closure& done_callback) {
56 done_callback.Run();
57}
58
[email protected]4b4892b2014-05-22 15:06:1559void TestMetricsServiceClient::CollectFinalMetrics(
60 const base::Closure& done_callback) {
61 done_callback.Run();
62}
63
[email protected]0d5a61a82014-05-31 22:28:3464scoped_ptr<MetricsLogUploader> TestMetricsServiceClient::CreateUploader(
65 const std::string& server_url,
66 const std::string& mime_type,
67 const base::Callback<void(int)>& on_upload_complete) {
68 return scoped_ptr<MetricsLogUploader>();
69}
70
[email protected]728de072014-05-21 09:20:3271} // namespace metrics