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> |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 static base::FilePath install_dir() { | 209 static base::FilePath install_dir() { |
210 // The base directory on windows looks like: | 210 // The base directory on windows looks like: |
211 // <profile>\AppData\Local\Google\Chrome\User Data\SwReporter\. | 211 // <profile>\AppData\Local\Google\Chrome\User Data\SwReporter\. |
212 base::FilePath result; | 212 base::FilePath result; |
213 PathService::Get(DIR_SW_REPORTER, &result); | 213 PathService::Get(DIR_SW_REPORTER, &result); |
214 return result; | 214 return result; |
215 } | 215 } |
216 | 216 |
217 static std::string ID() { | 217 static std::string ID() { |
218 update_client::CrxComponent component; | 218 update_client::CrxComponent component; |
219 component.version = base::Version("0.0.0.0"); | 219 component.version = Version("0.0.0.0"); |
220 GetPkHash(&component.pk_hash); | 220 GetPkHash(&component.pk_hash); |
221 return update_client::GetCrxComponentID(component); | 221 return update_client::GetCrxComponentID(component); |
222 } | 222 } |
223 | 223 |
224 private: | 224 private: |
225 static void GetPkHash(std::vector<uint8_t>* hash) { | 225 static void GetPkHash(std::vector<uint8_t>* hash) { |
226 DCHECK(hash); | 226 DCHECK(hash); |
227 hash->assign(kSha256Hash, kSha256Hash + sizeof(kSha256Hash)); | 227 hash->assign(kSha256Hash, kSha256Hash + sizeof(kSha256Hash)); |
228 } | 228 } |
229 }; | 229 }; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 } | 322 } |
323 | 323 |
324 void RegisterProfilePrefsForSwReporter( | 324 void RegisterProfilePrefsForSwReporter( |
325 user_prefs::PrefRegistrySyncable* registry) { | 325 user_prefs::PrefRegistrySyncable* registry) { |
326 registry->RegisterStringPref(prefs::kSwReporterPromptVersion, ""); | 326 registry->RegisterStringPref(prefs::kSwReporterPromptVersion, ""); |
327 | 327 |
328 registry->RegisterStringPref(prefs::kSwReporterPromptSeed, ""); | 328 registry->RegisterStringPref(prefs::kSwReporterPromptSeed, ""); |
329 } | 329 } |
330 | 330 |
331 } // namespace component_updater | 331 } // namespace component_updater |
OLD | NEW |