Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: chrome/browser/component_updater/recovery_component_installer.cc

Issue 2273443002: Declare the binary components support the group policy to enable/disable them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (!version.IsValid()) { 225 if (!version.IsValid()) {
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 if (!cus->RegisterComponent(recovery)) { 236 if (!cus->RegisterComponent(recovery)) {
236 NOTREACHED() << "Recovery component registration failed."; 237 NOTREACHED() << "Recovery component registration failed.";
237 } 238 }
238 } 239 }
239 240
240 void RecoveryUpdateVersionHelper( 241 void RecoveryUpdateVersionHelper(
241 const base::Version& version, PrefService* prefs) { 242 const base::Version& version, PrefService* prefs) {
242 DCHECK_CURRENTLY_ON(BrowserThread::UI); 243 DCHECK_CURRENTLY_ON(BrowserThread::UI);
243 prefs->SetString(prefs::kRecoveryComponentVersion, version.GetString()); 244 prefs->SetString(prefs::kRecoveryComponentVersion, version.GetString());
244 } 245 }
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 #endif // OS_WIN 442 #endif // OS_WIN
442 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); 443 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false);
443 } 444 }
444 445
445 void DeclinedElevatedRecoveryInstall(PrefService* prefs) { 446 void DeclinedElevatedRecoveryInstall(PrefService* prefs) {
446 DCHECK_CURRENTLY_ON(BrowserThread::UI); 447 DCHECK_CURRENTLY_ON(BrowserThread::UI);
447 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false); 448 prefs->SetBoolean(prefs::kRecoveryComponentNeedsElevation, false);
448 } 449 }
449 450
450 } // namespace component_updater 451 } // namespace component_updater
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698