| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 132 } |
| 133 | 133 |
| 134 void SupervisedUserWhitelistInstallerImpl::RegisterWhitelist( | 134 void SupervisedUserWhitelistInstallerImpl::RegisterWhitelist( |
| 135 const std::string& crx_id, | 135 const std::string& crx_id, |
| 136 const std::string& name, | 136 const std::string& name, |
| 137 bool newly_added, | 137 bool newly_added, |
| 138 const WhitelistReadyCallback& callback) { | 138 const WhitelistReadyCallback& callback) { |
| 139 scoped_ptr<ComponentInstallerTraits> traits( | 139 scoped_ptr<ComponentInstallerTraits> traits( |
| 140 new SupervisedUserWhitelistComponentInstallerTraits(crx_id, name, | 140 new SupervisedUserWhitelistComponentInstallerTraits(crx_id, name, |
| 141 callback)); | 141 callback)); |
| 142 DefaultComponentInstaller* installer = | 142 scoped_refptr<DefaultComponentInstaller> installer( |
| 143 new DefaultComponentInstaller(traits.Pass()); | 143 new DefaultComponentInstaller(traits.Pass())); |
| 144 | 144 |
| 145 // Takes ownership of |installer|. | |
| 146 installer->Register(cus_); | 145 installer->Register(cus_); |
| 147 | 146 |
| 148 if (newly_added) | 147 if (newly_added) |
| 149 TriggerComponentUpdate(&cus_->GetOnDemandUpdater(), crx_id); | 148 TriggerComponentUpdate(&cus_->GetOnDemandUpdater(), crx_id); |
| 150 } | 149 } |
| 151 | 150 |
| 152 void SupervisedUserWhitelistInstallerImpl::UnregisterWhitelist( | 151 void SupervisedUserWhitelistInstallerImpl::UnregisterWhitelist( |
| 153 const std::string& id) { | 152 const std::string& id) { |
| 154 // TODO(bauerb): Implement! | 153 // TODO(bauerb): Implement! |
| 155 NOTIMPLEMENTED(); | 154 NOTIMPLEMENTED(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 186 } | 185 } |
| 187 | 186 |
| 188 // static | 187 // static |
| 189 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate( | 188 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate( |
| 190 OnDemandUpdater* updater, | 189 OnDemandUpdater* updater, |
| 191 const std::string& crx_id) { | 190 const std::string& crx_id) { |
| 192 updater->OnDemandUpdate(crx_id); | 191 updater->OnDemandUpdate(crx_id); |
| 193 } | 192 } |
| 194 | 193 |
| 195 } // namespace component_updater | 194 } // namespace component_updater |
| OLD | NEW |