| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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/supervised_user_whitelist_installer.h
" | 5 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h
" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "base/files/file_enumerator.h" | 12 #include "base/files/file_enumerator.h" |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 14 #include "base/files/important_file_writer.h" | 15 #include "base/files/important_file_writer.h" |
| 15 #include "base/location.h" | 16 #include "base/location.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 void SupervisedUserWhitelistInstallerImpl::RegisterComponent( | 347 void SupervisedUserWhitelistInstallerImpl::RegisterComponent( |
| 347 const std::string& crx_id, | 348 const std::string& crx_id, |
| 348 const std::string& name, | 349 const std::string& name, |
| 349 const base::Closure& callback) { | 350 const base::Closure& callback) { |
| 350 scoped_ptr<ComponentInstallerTraits> traits( | 351 scoped_ptr<ComponentInstallerTraits> traits( |
| 351 new SupervisedUserWhitelistComponentInstallerTraits( | 352 new SupervisedUserWhitelistComponentInstallerTraits( |
| 352 crx_id, name, | 353 crx_id, name, |
| 353 base::Bind(&SupervisedUserWhitelistInstallerImpl::OnRawWhitelistReady, | 354 base::Bind(&SupervisedUserWhitelistInstallerImpl::OnRawWhitelistReady, |
| 354 weak_ptr_factory_.GetWeakPtr(), crx_id))); | 355 weak_ptr_factory_.GetWeakPtr(), crx_id))); |
| 355 scoped_refptr<DefaultComponentInstaller> installer( | 356 scoped_refptr<DefaultComponentInstaller> installer( |
| 356 new DefaultComponentInstaller(traits.Pass())); | 357 new DefaultComponentInstaller(std::move(traits))); |
| 357 installer->Register(cus_, callback); | 358 installer->Register(cus_, callback); |
| 358 } | 359 } |
| 359 | 360 |
| 360 void SupervisedUserWhitelistInstallerImpl::RegisterNewComponent( | 361 void SupervisedUserWhitelistInstallerImpl::RegisterNewComponent( |
| 361 const std::string& crx_id, | 362 const std::string& crx_id, |
| 362 const std::string& name) { | 363 const std::string& name) { |
| 363 RegisterComponent( | 364 RegisterComponent( |
| 364 crx_id, name, | 365 crx_id, name, |
| 365 base::Bind(&SupervisedUserWhitelistInstaller::TriggerComponentUpdate, | 366 base::Bind(&SupervisedUserWhitelistInstaller::TriggerComponentUpdate, |
| 366 &cus_->GetOnDemandUpdater(), crx_id)); | 367 &cus_->GetOnDemandUpdater(), crx_id)); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 573 |
| 573 // static | 574 // static |
| 574 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate( | 575 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate( |
| 575 OnDemandUpdater* updater, | 576 OnDemandUpdater* updater, |
| 576 const std::string& crx_id) { | 577 const std::string& crx_id) { |
| 577 const bool result = updater->OnDemandUpdate(crx_id); | 578 const bool result = updater->OnDemandUpdate(crx_id); |
| 578 DCHECK(result); | 579 DCHECK(result); |
| 579 } | 580 } |
| 580 | 581 |
| 581 } // namespace component_updater | 582 } // namespace component_updater |
| OLD | NEW |