| 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 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 const std::string& crx_id, | 243 const std::string& crx_id, |
| 244 const std::string& name, | 244 const std::string& name, |
| 245 const RawWhitelistReadyCallback& callback) | 245 const RawWhitelistReadyCallback& callback) |
| 246 : crx_id_(crx_id), name_(name), callback_(callback) {} | 246 : crx_id_(crx_id), name_(name), callback_(callback) {} |
| 247 ~SupervisedUserWhitelistComponentInstallerTraits() override {} | 247 ~SupervisedUserWhitelistComponentInstallerTraits() override {} |
| 248 | 248 |
| 249 private: | 249 private: |
| 250 // ComponentInstallerTraits overrides: | 250 // ComponentInstallerTraits overrides: |
| 251 bool VerifyInstallation(const base::DictionaryValue& manifest, | 251 bool VerifyInstallation(const base::DictionaryValue& manifest, |
| 252 const base::FilePath& install_dir) const override; | 252 const base::FilePath& install_dir) const override; |
| 253 bool CanAutoUpdate() const override; | 253 bool SupportsGroupPolicyEnabledComponentUpdates() const override; |
| 254 bool RequiresNetworkEncryption() const override; | 254 bool RequiresNetworkEncryption() const override; |
| 255 bool OnCustomInstall(const base::DictionaryValue& manifest, | 255 bool OnCustomInstall(const base::DictionaryValue& manifest, |
| 256 const base::FilePath& install_dir) override; | 256 const base::FilePath& install_dir) override; |
| 257 void ComponentReady(const base::Version& version, | 257 void ComponentReady(const base::Version& version, |
| 258 const base::FilePath& install_dir, | 258 const base::FilePath& install_dir, |
| 259 std::unique_ptr<base::DictionaryValue> manifest) override; | 259 std::unique_ptr<base::DictionaryValue> manifest) override; |
| 260 base::FilePath GetRelativeInstallDir() const override; | 260 base::FilePath GetRelativeInstallDir() const override; |
| 261 void GetHash(std::vector<uint8_t>* hash) const override; | 261 void GetHash(std::vector<uint8_t>* hash) const override; |
| 262 std::string GetName() const override; | 262 std::string GetName() const override; |
| 263 update_client::InstallerAttributes GetInstallerAttributes() const override; | 263 update_client::InstallerAttributes GetInstallerAttributes() const override; |
| 264 std::vector<std::string> GetMimeTypes() const override; | 264 std::vector<std::string> GetMimeTypes() const override; |
| 265 | 265 |
| 266 std::string crx_id_; | 266 std::string crx_id_; |
| 267 std::string name_; | 267 std::string name_; |
| 268 RawWhitelistReadyCallback callback_; | 268 RawWhitelistReadyCallback callback_; |
| 269 | 269 |
| 270 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWhitelistComponentInstallerTraits); | 270 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWhitelistComponentInstallerTraits); |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 bool SupervisedUserWhitelistComponentInstallerTraits::VerifyInstallation( | 273 bool SupervisedUserWhitelistComponentInstallerTraits::VerifyInstallation( |
| 274 const base::DictionaryValue& manifest, | 274 const base::DictionaryValue& manifest, |
| 275 const base::FilePath& install_dir) const { | 275 const base::FilePath& install_dir) const { |
| 276 // Check whether the whitelist exists at the path specified by the manifest. | 276 // Check whether the whitelist exists at the path specified by the manifest. |
| 277 // This does not check whether the whitelist is wellformed. | 277 // This does not check whether the whitelist is wellformed. |
| 278 return base::PathExists(GetRawWhitelistPath(manifest, install_dir)); | 278 return base::PathExists(GetRawWhitelistPath(manifest, install_dir)); |
| 279 } | 279 } |
| 280 | 280 |
| 281 bool SupervisedUserWhitelistComponentInstallerTraits::CanAutoUpdate() const { | 281 bool SupervisedUserWhitelistComponentInstallerTraits:: |
| 282 return true; | 282 SupportsGroupPolicyEnabledComponentUpdates() const { |
| 283 return false; |
| 283 } | 284 } |
| 284 | 285 |
| 285 bool SupervisedUserWhitelistComponentInstallerTraits:: | 286 bool SupervisedUserWhitelistComponentInstallerTraits:: |
| 286 RequiresNetworkEncryption() const { | 287 RequiresNetworkEncryption() const { |
| 287 return true; | 288 return true; |
| 288 } | 289 } |
| 289 | 290 |
| 290 bool SupervisedUserWhitelistComponentInstallerTraits::OnCustomInstall( | 291 bool SupervisedUserWhitelistComponentInstallerTraits::OnCustomInstall( |
| 291 const base::DictionaryValue& manifest, | 292 const base::DictionaryValue& manifest, |
| 292 const base::FilePath& install_dir) { | 293 const base::FilePath& install_dir) { |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 | 640 |
| 640 // static | 641 // static |
| 641 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate( | 642 void SupervisedUserWhitelistInstaller::TriggerComponentUpdate( |
| 642 OnDemandUpdater* updater, | 643 OnDemandUpdater* updater, |
| 643 const std::string& crx_id) { | 644 const std::string& crx_id) { |
| 644 const bool result = updater->OnDemandUpdate(crx_id); | 645 const bool result = updater->OnDemandUpdate(crx_id); |
| 645 DCHECK(result); | 646 DCHECK(result); |
| 646 } | 647 } |
| 647 | 648 |
| 648 } // namespace component_updater | 649 } // namespace component_updater |
| OLD | NEW |