Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/browser/metrics/chrome_metrics_service_client.cc

Issue 290343005: Pass MetricsServiceClient into MetricsService, and create a simple stubbed TestMetricsServiceClient… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/metrics/chrome_metrics_service_client.h" 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/google/google_util.h" 9 #include "chrome/browser/google/google_util.h"
10 #include "chrome/browser/ui/browser_otr_state.h" 10 #include "chrome/browser/ui/browser_otr_state.h"
(...skipping 15 matching lines...) Expand all
26 return metrics::SystemProfileProto::CHANNEL_BETA; 26 return metrics::SystemProfileProto::CHANNEL_BETA;
27 case chrome::VersionInfo::CHANNEL_STABLE: 27 case chrome::VersionInfo::CHANNEL_STABLE:
28 return metrics::SystemProfileProto::CHANNEL_STABLE; 28 return metrics::SystemProfileProto::CHANNEL_STABLE;
29 } 29 }
30 NOTREACHED(); 30 NOTREACHED();
31 return metrics::SystemProfileProto::CHANNEL_UNKNOWN; 31 return metrics::SystemProfileProto::CHANNEL_UNKNOWN;
32 } 32 }
33 33
34 } // namespace 34 } // namespace
35 35
36 ChromeMetricsServiceClient::ChromeMetricsServiceClient() 36 ChromeMetricsServiceClient::ChromeMetricsServiceClient() {
37 : MetricsServiceClient() {
38 } 37 }
39 38
40 ChromeMetricsServiceClient::~ChromeMetricsServiceClient() { 39 ChromeMetricsServiceClient::~ChromeMetricsServiceClient() {
41 } 40 }
42 41
43 void ChromeMetricsServiceClient::SetClientID(const std::string& client_id) { 42 void ChromeMetricsServiceClient::SetClientID(const std::string& client_id) {
44 crash_keys::SetClientID(client_id); 43 crash_keys::SetClientID(client_id);
45 } 44 }
46 45
47 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { 46 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() {
48 return !chrome::IsOffTheRecordSessionActive(); 47 return !chrome::IsOffTheRecordSessionActive();
49 } 48 }
50 49
51 std::string ChromeMetricsServiceClient::GetApplicationLocale() { 50 std::string ChromeMetricsServiceClient::GetApplicationLocale() {
52 return g_browser_process->GetApplicationLocale(); 51 return g_browser_process->GetApplicationLocale();
53 } 52 }
54 53
55 bool ChromeMetricsServiceClient::GetBrand(std::string* brand_code) { 54 bool ChromeMetricsServiceClient::GetBrand(std::string* brand_code) {
56 return google_util::GetBrand(brand_code); 55 return google_util::GetBrand(brand_code);
57 } 56 }
58 57
59 metrics::SystemProfileProto::Channel ChromeMetricsServiceClient::GetChannel() { 58 metrics::SystemProfileProto::Channel ChromeMetricsServiceClient::GetChannel() {
60 return AsProtobufChannel(chrome::VersionInfo::GetChannel()); 59 return AsProtobufChannel(chrome::VersionInfo::GetChannel());
61 } 60 }
62 61
63 std::string ChromeMetricsServiceClient::GetVersionString() { 62 std::string ChromeMetricsServiceClient::GetVersionString() {
64 // TODO(asvitkine): Move over from metrics_log.cc 63 // TODO(asvitkine): Move over from metrics_log.cc
65 return std::string(); 64 return std::string();
66 } 65 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/chrome_metrics_service_client.h ('k') | chrome/browser/metrics/metrics_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698