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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 300 |
300 static base::FilePath install_dir() { | 301 static base::FilePath install_dir() { |
301 // The base directory on windows looks like: | 302 // The base directory on windows looks like: |
302 // <profile>\AppData\Local\Google\Chrome\User Data\SwReporter\. | 303 // <profile>\AppData\Local\Google\Chrome\User Data\SwReporter\. |
303 base::FilePath result; | 304 base::FilePath result; |
304 PathService::Get(DIR_SW_REPORTER, &result); | 305 PathService::Get(DIR_SW_REPORTER, &result); |
305 return result; | 306 return result; |
306 } | 307 } |
307 | 308 |
308 static std::string ID() { | 309 static std::string ID() { |
309 CrxComponent component; | 310 update_client::CrxComponent component; |
310 component.version = Version("0.0.0.0"); | 311 component.version = Version("0.0.0.0"); |
311 GetPkHash(&component.pk_hash); | 312 GetPkHash(&component.pk_hash); |
312 return component_updater::GetCrxComponentID(component); | 313 return update_client::GetCrxComponentID(component); |
313 } | 314 } |
314 | 315 |
315 static base::FilePath VersionPath() { return base::FilePath(version_dir_); } | 316 static base::FilePath VersionPath() { return base::FilePath(version_dir_); } |
316 | 317 |
317 private: | 318 private: |
318 static void GetPkHash(std::vector<uint8_t>* hash) { | 319 static void GetPkHash(std::vector<uint8_t>* hash) { |
319 DCHECK(hash); | 320 DCHECK(hash); |
320 hash->assign(kSha256Hash, kSha256Hash + sizeof(kSha256Hash)); | 321 hash->assign(kSha256Hash, kSha256Hash + sizeof(kSha256Hash)); |
321 } | 322 } |
322 | 323 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 -1, | 413 -1, |
413 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 414 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
414 | 415 |
415 registry->RegisterStringPref( | 416 registry->RegisterStringPref( |
416 prefs::kSwReporterPromptVersion, | 417 prefs::kSwReporterPromptVersion, |
417 "", | 418 "", |
418 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 419 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
419 } | 420 } |
420 | 421 |
421 } // namespace component_updater | 422 } // namespace component_updater |
OLD | NEW |