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

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

Issue 502173002: Move more metrics classes to metrics namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test compile. Created 6 years, 4 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
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/metrics_service_accessor.h" 5 #include "chrome/browser/metrics/metrics_service_accessor.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "components/metrics/metrics_service.h" 8 #include "components/metrics/metrics_service.h"
9 #include "components/metrics/metrics_service_observer.h" 9 #include "components/metrics/metrics_service_observer.h"
10 10
11 // TODO(asvitkine): Remove when this class is moved to metrics namespace.
12 using metrics::MetricsService;
13 using metrics::MetricsServiceObserver;
14 using metrics::SyntheticTrialGroup;
15
11 // static 16 // static
12 void MetricsServiceAccessor::AddMetricsServiceObserver( 17 void MetricsServiceAccessor::AddMetricsServiceObserver(
13 MetricsServiceObserver* observer) { 18 MetricsServiceObserver* observer) {
14 MetricsService* metrics_service = g_browser_process->metrics_service(); 19 MetricsService* metrics_service = g_browser_process->metrics_service();
15 if (metrics_service) 20 if (metrics_service)
16 metrics_service->AddObserver(observer); 21 metrics_service->AddObserver(observer);
17 } 22 }
18 23
19 void MetricsServiceAccessor::RemoveMetricsServiceObserver( 24 void MetricsServiceAccessor::RemoveMetricsServiceObserver(
20 MetricsServiceObserver* observer) { 25 MetricsServiceObserver* observer) {
21 MetricsService* metrics_service = g_browser_process->metrics_service(); 26 MetricsService* metrics_service = g_browser_process->metrics_service();
22 if (metrics_service) 27 if (metrics_service)
23 metrics_service->RemoveObserver(observer); 28 metrics_service->RemoveObserver(observer);
24 } 29 }
25 30
26 // static 31 // static
27 bool MetricsServiceAccessor::RegisterSyntheticFieldTrial( 32 bool MetricsServiceAccessor::RegisterSyntheticFieldTrial(
28 MetricsService* metrics_service, 33 MetricsService* metrics_service,
29 uint32_t trial_name_hash, 34 uint32_t trial_name_hash,
30 uint32_t group_name_hash) { 35 uint32_t group_name_hash) {
31 if (!metrics_service) 36 if (!metrics_service)
32 return false; 37 return false;
33 38
34 SyntheticTrialGroup trial_group(trial_name_hash, group_name_hash); 39 SyntheticTrialGroup trial_group(trial_name_hash, group_name_hash);
35 metrics_service->RegisterSyntheticFieldTrial(trial_group); 40 metrics_service->RegisterSyntheticFieldTrial(trial_group);
36 return true; 41 return true;
37 } 42 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/metrics_service_accessor.h ('k') | chrome/browser/metrics/metrics_services_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698