client_side_phishing_component_loader_policy.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2021 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 WEBLAYER_BROWSER_COMPONENT_UPDATER_CLIENT_SIDE_PHISHING_COMPONENT_LOADER_POLICY_H_
  5. #define WEBLAYER_BROWSER_COMPONENT_UPDATER_CLIENT_SIDE_PHISHING_COMPONENT_LOADER_POLICY_H_
  6. #include <stdint.h>
  7. #include <memory>
  8. #include <string>
  9. #include <vector>
  10. #include "base/containers/flat_map.h"
  11. #include "base/files/scoped_file.h"
  12. #include "components/component_updater/android/component_loader_policy.h"
  13. namespace base {
  14. class DictionaryValue;
  15. class Version;
  16. } // namespace base
  17. namespace weblayer {
  18. class ClientSidePhishingComponentLoaderPolicy
  19. : public component_updater::ComponentLoaderPolicy {
  20. public:
  21. ClientSidePhishingComponentLoaderPolicy() = default;
  22. ~ClientSidePhishingComponentLoaderPolicy() override = default;
  23. ClientSidePhishingComponentLoaderPolicy(
  24. const ClientSidePhishingComponentLoaderPolicy&) = delete;
  25. ClientSidePhishingComponentLoaderPolicy& operator=(
  26. const ClientSidePhishingComponentLoaderPolicy&) = delete;
  27. private:
  28. // The following methods override ComponentLoaderPolicy.
  29. void ComponentLoaded(
  30. const base::Version& version,
  31. base::flat_map<std::string, base::ScopedFD>& fd_map,
  32. std::unique_ptr<base::DictionaryValue> manifest) override;
  33. void ComponentLoadFailed(
  34. component_updater::ComponentLoadResult error) override;
  35. void GetHash(std::vector<uint8_t>* hash) const override;
  36. std::string GetMetricsSuffix() const override;
  37. };
  38. void LoadClientSidePhishingComponent(
  39. component_updater::ComponentLoaderPolicyVector& policies);
  40. } // namespace weblayer
  41. #endif // WEBLAYER_BROWSER_COMPONENT_UPDATER_CLIENT_SIDE_PHISHING_COMPONENT_LOADER_POLICY_H_