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 10 matching lines...) Expand all Loading... |
21 #include "base/prefs/pref_service.h" | 21 #include "base/prefs/pref_service.h" |
22 #include "base/process/kill.h" | 22 #include "base/process/kill.h" |
23 #include "base/process/launch.h" | 23 #include "base/process/launch.h" |
24 #include "base/task_runner_util.h" | 24 #include "base/task_runner_util.h" |
25 #include "base/threading/worker_pool.h" | 25 #include "base/threading/worker_pool.h" |
26 #include "base/win/registry.h" | 26 #include "base/win/registry.h" |
27 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
28 #include "chrome/browser/component_updater/component_updater_service.h" | 28 #include "chrome/browser/component_updater/component_updater_service.h" |
29 #include "chrome/browser/component_updater/component_updater_utils.h" | 29 #include "chrome/browser/component_updater/component_updater_utils.h" |
30 #include "chrome/browser/component_updater/default_component_installer.h" | 30 #include "chrome/browser/component_updater/default_component_installer.h" |
31 #include "chrome/common/chrome_paths.h" | 31 #include "components/component_updater/pref_names.h" |
32 #include "chrome/common/pref_names.h" | |
33 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
34 | 33 |
35 using content::BrowserThread; | 34 using content::BrowserThread; |
36 | 35 |
37 namespace component_updater { | 36 namespace component_updater { |
38 | 37 |
39 namespace { | 38 namespace { |
40 | 39 |
41 // These values are used to send UMA information and are replicated in the | 40 // These values are used to send UMA information and are replicated in the |
42 // histograms.xml file, so the order MUST NOT CHANGE. | 41 // histograms.xml file, so the order MUST NOT CHANGE. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 virtual base::FilePath GetBaseDirectory() const { return install_dir(); } | 154 virtual base::FilePath GetBaseDirectory() const { return install_dir(); } |
156 | 155 |
157 virtual void GetHash(std::vector<uint8>* hash) const { GetPkHash(hash); } | 156 virtual void GetHash(std::vector<uint8>* hash) const { GetPkHash(hash); } |
158 | 157 |
159 virtual std::string GetName() const { return "Software Reporter Tool"; } | 158 virtual std::string GetName() const { return "Software Reporter Tool"; } |
160 | 159 |
161 static base::FilePath install_dir() { | 160 static base::FilePath install_dir() { |
162 // The base directory on windows looks like: | 161 // The base directory on windows looks like: |
163 // <profile>\AppData\Local\Google\Chrome\User Data\SwReporter\. | 162 // <profile>\AppData\Local\Google\Chrome\User Data\SwReporter\. |
164 base::FilePath result; | 163 base::FilePath result; |
165 PathService::Get(chrome::DIR_USER_DATA, &result); | 164 PathService::Get(DIR_SW_REPORTER, &result); |
166 return result.Append(FILE_PATH_LITERAL("SwReporter")); | 165 return result; |
167 } | 166 } |
168 | 167 |
169 static std::string ID() { | 168 static std::string ID() { |
170 CrxComponent component; | 169 CrxComponent component; |
171 component.version = Version("0.0.0.0"); | 170 component.version = Version("0.0.0.0"); |
172 GetPkHash(&component.pk_hash); | 171 GetPkHash(&component.pk_hash); |
173 return component_updater::GetCrxComponentID(component); | 172 return component_updater::GetCrxComponentID(component); |
174 } | 173 } |
175 | 174 |
176 static base::FilePath VersionPath() { return base::FilePath(version_dir_); } | 175 static base::FilePath VersionPath() { return base::FilePath(version_dir_); } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 else | 271 else |
273 ReportUmaStep(SW_REPORTER_RETRIED_TOO_MANY_TIMES); | 272 ReportUmaStep(SW_REPORTER_RETRIED_TOO_MANY_TIMES); |
274 } | 273 } |
275 } | 274 } |
276 | 275 |
277 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry) { | 276 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry) { |
278 registry->RegisterIntegerPref(prefs::kSwReporterExecuteTryCount, 0); | 277 registry->RegisterIntegerPref(prefs::kSwReporterExecuteTryCount, 0); |
279 } | 278 } |
280 | 279 |
281 } // namespace component_updater | 280 } // namespace component_updater |
OLD | NEW |