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

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

Issue 1363243004: Allow embedders to share code to override UI strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment to test and class and fix typo Created 5 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/chrome_variations_service_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_services_manager.h" 5 #include "chrome/browser/metrics/metrics_services_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" 13 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
14 #include "chrome/browser/metrics/chrome_metrics_service_client.h" 14 #include "chrome/browser/metrics/chrome_metrics_service_client.h"
15 #include "chrome/browser/metrics/metrics_reporting_state.h" 15 #include "chrome/browser/metrics/metrics_reporting_state.h"
16 #include "chrome/browser/metrics/variations/chrome_variations_service_client.h" 16 #include "chrome/browser/metrics/variations/chrome_variations_service_client.h"
17 #include "chrome/browser/metrics/variations/generated_resources_map.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/profiles/profile_manager.h" 19 #include "chrome/browser/profiles/profile_manager.h"
19 #include "chrome/browser/ui/browser_otr_state.h" 20 #include "chrome/browser/ui/browser_otr_state.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/pref_names.h" 22 #include "chrome/common/pref_names.h"
22 #include "chrome/installer/util/google_update_settings.h" 23 #include "chrome/installer/util/google_update_settings.h"
23 #include "components/metrics/metrics_service.h" 24 #include "components/metrics/metrics_service.h"
24 #include "components/metrics/metrics_state_manager.h" 25 #include "components/metrics/metrics_state_manager.h"
25 #include "components/rappor/rappor_service.h" 26 #include "components/rappor/rappor_service.h"
26 #include "components/variations/service/variations_service.h" 27 #include "components/variations/service/variations_service.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 rappor_service_->Initialize(g_browser_process->system_request_context()); 61 rappor_service_->Initialize(g_browser_process->system_request_context());
61 } 62 }
62 return rappor_service_.get(); 63 return rappor_service_.get();
63 } 64 }
64 65
65 variations::VariationsService* MetricsServicesManager::GetVariationsService() { 66 variations::VariationsService* MetricsServicesManager::GetVariationsService() {
66 DCHECK(thread_checker_.CalledOnValidThread()); 67 DCHECK(thread_checker_.CalledOnValidThread());
67 if (!variations_service_) { 68 if (!variations_service_) {
68 variations_service_ = variations::VariationsService::Create( 69 variations_service_ = variations::VariationsService::Create(
69 make_scoped_ptr(new ChromeVariationsServiceClient()), local_state_, 70 make_scoped_ptr(new ChromeVariationsServiceClient()), local_state_,
70 GetMetricsStateManager(), switches::kDisableBackgroundNetworking); 71 GetMetricsStateManager(), switches::kDisableBackgroundNetworking,
72 variations::UIStringOverrider(chrome_variations::kResourceHashes,
73 chrome_variations::kResourceIndices,
74 chrome_variations::kNumResources));
71 } 75 }
72 return variations_service_.get(); 76 return variations_service_.get();
73 } 77 }
74 78
75 void MetricsServicesManager::OnPluginLoadingError( 79 void MetricsServicesManager::OnPluginLoadingError(
76 const base::FilePath& plugin_path) { 80 const base::FilePath& plugin_path) {
77 GetChromeMetricsServiceClient()->LogPluginLoadingError(plugin_path); 81 GetChromeMetricsServiceClient()->LogPluginLoadingError(plugin_path);
78 } 82 }
79 83
80 ChromeMetricsServiceClient* 84 ChromeMetricsServiceClient*
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 recording_groups |= rappor::SAFEBROWSING_RAPPOR_GROUP; 170 recording_groups |= rappor::SAFEBROWSING_RAPPOR_GROUP;
167 #endif // defined(GOOGLE_CHROME_BUILD) 171 #endif // defined(GOOGLE_CHROME_BUILD)
168 GetRapporService()->Update(recording_groups, may_upload_); 172 GetRapporService()->Update(recording_groups, may_upload_);
169 } 173 }
170 174
171 void MetricsServicesManager::UpdateUploadPermissions(bool may_upload) { 175 void MetricsServicesManager::UpdateUploadPermissions(bool may_upload) {
172 return UpdatePermissions( 176 return UpdatePermissions(
173 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(), 177 ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(),
174 may_upload); 178 may_upload);
175 } 179 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/variations/chrome_variations_service_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698