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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
| 11 #include <utility> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/base_paths.h" | 14 #include "base/base_paths.h" |
14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
16 #include "base/logging.h" | 17 #include "base/logging.h" |
17 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
18 #include "base/metrics/sparse_histogram.h" | 19 #include "base/metrics/sparse_histogram.h" |
19 #include "base/path_service.h" | 20 #include "base/path_service.h" |
20 #include "base/strings/string_tokenizer.h" | 21 #include "base/strings/string_tokenizer.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 SRTHasCompleted(SRT_COMPLETED_LATER); | 232 SRTHasCompleted(SRT_COMPLETED_LATER); |
232 cleaner_key.DeleteValue(safe_browsing::kEndTimeValueName); | 233 cleaner_key.DeleteValue(safe_browsing::kEndTimeValueName); |
233 } | 234 } |
234 } | 235 } |
235 } | 236 } |
236 | 237 |
237 // Install the component. | 238 // Install the component. |
238 scoped_ptr<ComponentInstallerTraits> traits(new SwReporterInstallerTraits()); | 239 scoped_ptr<ComponentInstallerTraits> traits(new SwReporterInstallerTraits()); |
239 // |cus| will take ownership of |installer| during installer->Register(cus). | 240 // |cus| will take ownership of |installer| during installer->Register(cus). |
240 DefaultComponentInstaller* installer = | 241 DefaultComponentInstaller* installer = |
241 new DefaultComponentInstaller(traits.Pass()); | 242 new DefaultComponentInstaller(std::move(traits)); |
242 installer->Register(cus, base::Closure()); | 243 installer->Register(cus, base::Closure()); |
243 } | 244 } |
244 | 245 |
245 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry) { | 246 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry) { |
246 registry->RegisterInt64Pref(prefs::kSwReporterLastTimeTriggered, 0); | 247 registry->RegisterInt64Pref(prefs::kSwReporterLastTimeTriggered, 0); |
247 registry->RegisterIntegerPref(prefs::kSwReporterLastExitCode, -1); | 248 registry->RegisterIntegerPref(prefs::kSwReporterLastExitCode, -1); |
248 registry->RegisterBooleanPref(prefs::kSwReporterPendingPrompt, false); | 249 registry->RegisterBooleanPref(prefs::kSwReporterPendingPrompt, false); |
249 } | 250 } |
250 | 251 |
251 void RegisterProfilePrefsForSwReporter( | 252 void RegisterProfilePrefsForSwReporter( |
252 user_prefs::PrefRegistrySyncable* registry) { | 253 user_prefs::PrefRegistrySyncable* registry) { |
253 registry->RegisterStringPref(prefs::kSwReporterPromptVersion, ""); | 254 registry->RegisterStringPref(prefs::kSwReporterPromptVersion, ""); |
254 | 255 |
255 registry->RegisterStringPref(prefs::kSwReporterPromptSeed, ""); | 256 registry->RegisterStringPref(prefs::kSwReporterPromptSeed, ""); |
256 } | 257 } |
257 | 258 |
258 } // namespace component_updater | 259 } // namespace component_updater |
OLD | NEW |