OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/recovery_component_installer.h" | 5 #include "chrome/browser/component_updater/recovery_component_installer.h" |
6 | 6 |
| 7 #include <stdint.h> |
7 #include <string> | 8 #include <string> |
8 | 9 |
9 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
14 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
15 #include "base/logging.h" | 16 #include "base/logging.h" |
16 #include "base/path_service.h" | 17 #include "base/path_service.h" |
17 #include "base/prefs/pref_registry_simple.h" | 18 #include "base/prefs/pref_registry_simple.h" |
18 #include "base/prefs/pref_service.h" | 19 #include "base/prefs/pref_service.h" |
19 #include "base/process/launch.h" | 20 #include "base/process/launch.h" |
20 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
21 #include "base/values.h" | 22 #include "base/values.h" |
22 #include "components/component_updater/component_updater_paths.h" | 23 #include "components/component_updater/component_updater_paths.h" |
23 #include "components/component_updater/component_updater_service.h" | 24 #include "components/component_updater/component_updater_service.h" |
24 #include "components/component_updater/pref_names.h" | 25 #include "components/component_updater/pref_names.h" |
25 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
26 | 27 |
27 using content::BrowserThread; | 28 using content::BrowserThread; |
28 | 29 |
29 namespace component_updater { | 30 namespace component_updater { |
30 | 31 |
31 namespace { | 32 namespace { |
32 | 33 |
33 // CRX hash. The extension id is: npdjjkjlcidkjlamlmmdelcjbcpdjocm. | 34 // CRX hash. The extension id is: npdjjkjlcidkjlamlmmdelcjbcpdjocm. |
34 const uint8 kSha2Hash[] = {0xdf, 0x39, 0x9a, 0x9b, 0x28, 0x3a, 0x9b, 0x0c, | 35 const uint8_t kSha2Hash[] = {0xdf, 0x39, 0x9a, 0x9b, 0x28, 0x3a, 0x9b, 0x0c, |
35 0xbc, 0xc3, 0x4b, 0x29, 0x12, 0xf3, 0x9e, 0x2c, | 36 0xbc, 0xc3, 0x4b, 0x29, 0x12, 0xf3, 0x9e, 0x2c, |
36 0x19, 0x7a, 0x71, 0x4b, 0x0a, 0x7c, 0x80, 0x1c, | 37 0x19, 0x7a, 0x71, 0x4b, 0x0a, 0x7c, 0x80, 0x1c, |
37 0xf6, 0x29, 0x7c, 0x0a, 0x5f, 0xea, 0x67, 0xb7}; | 38 0xf6, 0x29, 0x7c, 0x0a, 0x5f, 0xea, 0x67, 0xb7}; |
38 | 39 |
39 // File name of the recovery binary on different platforms. | 40 // File name of the recovery binary on different platforms. |
40 const base::FilePath::CharType kRecoveryFileName[] = | 41 const base::FilePath::CharType kRecoveryFileName[] = |
41 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
42 FILE_PATH_LITERAL("ChromeRecovery.exe"); | 43 FILE_PATH_LITERAL("ChromeRecovery.exe"); |
43 #else // OS_LINUX, OS_MACOSX, etc. | 44 #else // OS_LINUX, OS_MACOSX, etc. |
44 FILE_PATH_LITERAL("ChromeRecovery"); | 45 FILE_PATH_LITERAL("ChromeRecovery"); |
45 #endif | 46 #endif |
46 | 47 |
47 const char kRecoveryManifestName[] = "ChromeRecovery"; | 48 const char kRecoveryManifestName[] = "ChromeRecovery"; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 base::Bind(&RecoveryRegisterHelper, cus, prefs), | 168 base::Bind(&RecoveryRegisterHelper, cus, prefs), |
168 base::TimeDelta::FromSeconds(6)); | 169 base::TimeDelta::FromSeconds(6)); |
169 #endif | 170 #endif |
170 } | 171 } |
171 | 172 |
172 void RegisterPrefsForRecoveryComponent(PrefRegistrySimple* registry) { | 173 void RegisterPrefsForRecoveryComponent(PrefRegistrySimple* registry) { |
173 registry->RegisterStringPref(prefs::kRecoveryComponentVersion, "0.0.0.0"); | 174 registry->RegisterStringPref(prefs::kRecoveryComponentVersion, "0.0.0.0"); |
174 } | 175 } |
175 | 176 |
176 } // namespace component_updater | 177 } // namespace component_updater |
OLD | NEW |