safety_tips_component_installer.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_COMPONENT_UPDATER_INSTALLER_POLICIES_SAFETY_TIPS_COMPONENT_INSTALLER_H_
  5. #define COMPONENTS_COMPONENT_UPDATER_INSTALLER_POLICIES_SAFETY_TIPS_COMPONENT_INSTALLER_H_
  6. #include <memory>
  7. #include <string>
  8. #include <vector>
  9. #include "components/component_updater/component_installer.h"
  10. namespace base {
  11. class FilePath;
  12. } // namespace base
  13. namespace component_updater {
  14. class SafetyTipsComponentInstallerPolicy : public ComponentInstallerPolicy {
  15. public:
  16. SafetyTipsComponentInstallerPolicy();
  17. SafetyTipsComponentInstallerPolicy(
  18. const SafetyTipsComponentInstallerPolicy&) = delete;
  19. SafetyTipsComponentInstallerPolicy& operator=(
  20. const SafetyTipsComponentInstallerPolicy&) = delete;
  21. ~SafetyTipsComponentInstallerPolicy() override;
  22. private:
  23. // ComponentInstallerPolicy methods:
  24. bool SupportsGroupPolicyEnabledComponentUpdates() const override;
  25. bool RequiresNetworkEncryption() const override;
  26. update_client::CrxInstaller::Result OnCustomInstall(
  27. const base::Value& manifest,
  28. const base::FilePath& install_dir) override;
  29. void OnCustomUninstall() override;
  30. bool VerifyInstallation(const base::Value& manifest,
  31. const base::FilePath& install_dir) const override;
  32. void ComponentReady(const base::Version& version,
  33. const base::FilePath& install_dir,
  34. base::Value manifest) override;
  35. base::FilePath GetRelativeInstallDir() const override;
  36. void GetHash(std::vector<uint8_t>* hash) const override;
  37. std::string GetName() const override;
  38. update_client::InstallerAttributes GetInstallerAttributes() const override;
  39. static base::FilePath GetInstalledPath(const base::FilePath& base);
  40. };
  41. void RegisterSafetyTipsComponent(ComponentUpdateService* cus);
  42. } // namespace component_updater
  43. #endif // COMPONENTS_COMPONENT_UPDATER_INSTALLER_POLICIES_SAFETY_TIPS_COMPONENT_INSTALLER_H_