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