OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/component_updater/sw_reporter_installer_win.h" | 5 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 static wchar_t version_dir_[_MAX_PATH]; | 217 static wchar_t version_dir_[_MAX_PATH]; |
218 }; | 218 }; |
219 | 219 |
220 wchar_t SwReporterInstallerTraits::version_dir_[] = {}; | 220 wchar_t SwReporterInstallerTraits::version_dir_[] = {}; |
221 | 221 |
222 } // namespace | 222 } // namespace |
223 | 223 |
224 void RegisterSwReporterComponent(ComponentUpdateService* cus, | 224 void RegisterSwReporterComponent(ComponentUpdateService* cus, |
225 PrefService* prefs) { | 225 PrefService* prefs) { |
226 // The Sw reporter shouldn't run if the user isn't reporting metrics. | 226 // The Sw reporter shouldn't run if the user isn't reporting metrics. |
227 if (!ChromeMetricsServiceAccessor::IsMetricsReportingEnabled() && false) | 227 if (!ChromeMetricsServiceAccessor::IsMetricsReportingEnabled()) |
228 return; | 228 return; |
229 | 229 |
230 // Install the component. | 230 // Install the component. |
231 scoped_ptr<ComponentInstallerTraits> traits( | 231 scoped_ptr<ComponentInstallerTraits> traits( |
232 new SwReporterInstallerTraits(prefs)); | 232 new SwReporterInstallerTraits(prefs)); |
233 // |cus| will take ownership of |installer| during installer->Register(cus). | 233 // |cus| will take ownership of |installer| during installer->Register(cus). |
234 DefaultComponentInstaller* installer = | 234 DefaultComponentInstaller* installer = |
235 new DefaultComponentInstaller(traits.Pass()); | 235 new DefaultComponentInstaller(traits.Pass()); |
236 installer->Register(cus); | 236 installer->Register(cus); |
237 } | 237 } |
238 | 238 |
239 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry) { | 239 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry) { |
240 registry->RegisterInt64Pref(prefs::kSwReporterLastTimeTriggered, 0); | 240 registry->RegisterInt64Pref(prefs::kSwReporterLastTimeTriggered, 0); |
241 } | 241 } |
242 | 242 |
243 } // namespace component_updater | 243 } // namespace component_updater |
OLD | NEW |