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 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
31 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 31 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
32 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
33 #include "chrome/browser/safe_browsing/srt_global_error_win.h" | 33 #include "chrome/browser/safe_browsing/srt_global_error_win.h" |
34 #include "chrome/browser/ui/browser_finder.h" | 34 #include "chrome/browser/ui/browser_finder.h" |
35 #include "chrome/browser/ui/global_error/global_error_service.h" | 35 #include "chrome/browser/ui/global_error/global_error_service.h" |
36 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 36 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
37 #include "chrome/common/pref_names.h" | 37 #include "chrome/common/pref_names.h" |
38 #include "components/component_updater/component_updater_paths.h" | 38 #include "components/component_updater/component_updater_paths.h" |
39 #include "components/component_updater/component_updater_service.h" | 39 #include "components/component_updater/component_updater_service.h" |
40 #include "components/component_updater/component_updater_utils.h" | |
41 #include "components/component_updater/default_component_installer.h" | 40 #include "components/component_updater/default_component_installer.h" |
42 #include "components/component_updater/pref_names.h" | 41 #include "components/component_updater/pref_names.h" |
43 #include "components/pref_registry/pref_registry_syncable.h" | 42 #include "components/pref_registry/pref_registry_syncable.h" |
| 43 #include "components/update_client/update_client.h" |
| 44 #include "components/update_client/utils.h" |
44 #include "content/public/browser/browser_thread.h" | 45 #include "content/public/browser/browser_thread.h" |
45 | 46 |
46 using content::BrowserThread; | 47 using content::BrowserThread; |
47 | 48 |
48 namespace component_updater { | 49 namespace component_updater { |
49 | 50 |
50 namespace { | 51 namespace { |
51 | 52 |
52 // These values are used to send UMA information and are replicated in the | 53 // These values are used to send UMA information and are replicated in the |
53 // histograms.xml file, so the order MUST NOT CHANGE. | 54 // histograms.xml file, so the order MUST NOT CHANGE. |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 298 |
298 static base::FilePath install_dir() { | 299 static base::FilePath install_dir() { |
299 // The base directory on windows looks like: | 300 // The base directory on windows looks like: |
300 // <profile>\AppData\Local\Google\Chrome\User Data\SwReporter\. | 301 // <profile>\AppData\Local\Google\Chrome\User Data\SwReporter\. |
301 base::FilePath result; | 302 base::FilePath result; |
302 PathService::Get(DIR_SW_REPORTER, &result); | 303 PathService::Get(DIR_SW_REPORTER, &result); |
303 return result; | 304 return result; |
304 } | 305 } |
305 | 306 |
306 static std::string ID() { | 307 static std::string ID() { |
307 CrxComponent component; | 308 update_client::CrxComponent component; |
308 component.version = Version("0.0.0.0"); | 309 component.version = Version("0.0.0.0"); |
309 GetPkHash(&component.pk_hash); | 310 GetPkHash(&component.pk_hash); |
310 return component_updater::GetCrxComponentID(component); | 311 return update_client::GetCrxComponentID(component); |
311 } | 312 } |
312 | 313 |
313 static base::FilePath VersionPath() { return base::FilePath(version_dir_); } | 314 static base::FilePath VersionPath() { return base::FilePath(version_dir_); } |
314 | 315 |
315 private: | 316 private: |
316 static void GetPkHash(std::vector<uint8_t>* hash) { | 317 static void GetPkHash(std::vector<uint8_t>* hash) { |
317 DCHECK(hash); | 318 DCHECK(hash); |
318 hash->assign(kSha256Hash, kSha256Hash + sizeof(kSha256Hash)); | 319 hash->assign(kSha256Hash, kSha256Hash + sizeof(kSha256Hash)); |
319 } | 320 } |
320 | 321 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 -1, | 399 -1, |
399 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 400 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
400 | 401 |
401 registry->RegisterStringPref( | 402 registry->RegisterStringPref( |
402 prefs::kSwReporterPromptVersion, | 403 prefs::kSwReporterPromptVersion, |
403 "", | 404 "", |
404 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 405 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
405 } | 406 } |
406 | 407 |
407 } // namespace component_updater | 408 } // namespace component_updater |
OLD | NEW |