| 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 <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 NOTREACHED(); | 226 NOTREACHED(); |
| 227 return; | 227 return; |
| 228 } | 228 } |
| 229 | 229 |
| 230 update_client::CrxComponent recovery; | 230 update_client::CrxComponent recovery; |
| 231 recovery.name = "recovery"; | 231 recovery.name = "recovery"; |
| 232 recovery.installer = new RecoveryComponentInstaller(version, prefs); | 232 recovery.installer = new RecoveryComponentInstaller(version, prefs); |
| 233 recovery.version = version; | 233 recovery.version = version; |
| 234 recovery.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]); | 234 recovery.pk_hash.assign(kSha2Hash, &kSha2Hash[sizeof(kSha2Hash)]); |
| 235 recovery.supports_group_policy_enable_component_updates = true; | 235 recovery.supports_group_policy_enable_component_updates = true; |
| 236 recovery.requires_network_encryption = false; |
| 236 if (!cus->RegisterComponent(recovery)) { | 237 if (!cus->RegisterComponent(recovery)) { |
| 237 NOTREACHED() << "Recovery component registration failed."; | 238 NOTREACHED() << "Recovery component registration failed."; |
| 238 } | 239 } |
| 239 } | 240 } |
| 240 | 241 |
| 241 void RecoveryUpdateVersionHelper( | 242 void RecoveryUpdateVersionHelper( |
| 242 const base::Version& version, PrefService* prefs) { | 243 const base::Version& version, PrefService* prefs) { |
| 243 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 244 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 244 prefs->SetString(prefs::kRecoveryComponentVersion, version.GetString()); | 245 prefs->SetString(prefs::kRecoveryComponentVersion, version.GetString()); |
| 245 } | 246 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 #endif // OS_WIN | 443 #endif // OS_WIN |
| 443 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); | 444 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); |
| 444 } | 445 } |
| 445 | 446 |
| 446 void DeclinedElevatedRecoveryInstall(PrefService* prefs) { | 447 void DeclinedElevatedRecoveryInstall(PrefService* prefs) { |
| 447 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 448 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 448 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); | 449 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); |
| 449 } | 450 } |
| 450 | 451 |
| 451 } // namespace component_updater | 452 } // namespace component_updater |
| OLD | NEW |