weblayer_dependencies.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright 2022 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_AUTOFILL_ASSISTANT_WEBLAYER_DEPENDENCIES_H_
  5. #define WEBLAYER_BROWSER_AUTOFILL_ASSISTANT_WEBLAYER_DEPENDENCIES_H_
  6. #include "base/android/scoped_java_ref.h"
  7. #include "base/strings/string_piece.h"
  8. #include "components/autofill_assistant/browser/android/dependencies_android.h"
  9. #include "components/autofill_assistant/browser/assistant_field_trial_util.h"
  10. #include "components/autofill_assistant/browser/common_dependencies.h"
  11. #include "components/autofill_assistant/browser/platform_dependencies.h"
  12. #include "components/autofill_assistant/content/browser/annotate_dom_model_service.h"
  13. #include "components/metrics/metrics_service_accessor.h"
  14. #include "components/password_manager/core/browser/password_manager_client.h"
  15. #include "components/variations/service/variations_service.h"
  16. #include "content/public/browser/browser_context.h"
  17. #include "content/public/browser/web_contents.h"
  18. namespace weblayer {
  19. // Interface for platform delegates that provide platform-dependent features
  20. // and dependencies to the starter.
  21. // TODO(b/201964911): rename to make it consistent with the other dependencies
  22. // classes.
  23. class WebLayerDependencies : public ::autofill_assistant::DependenciesAndroid,
  24. public ::autofill_assistant::CommonDependencies,
  25. public ::autofill_assistant::PlatformDependencies {
  26. public:
  27. WebLayerDependencies(
  28. JNIEnv* env,
  29. const base::android::JavaParamRef<jobject>& jstatic_dependencies);
  30. // Overrides DependenciesAndroid
  31. const ::autofill_assistant::CommonDependencies* GetCommonDependencies()
  32. const override;
  33. const ::autofill_assistant::PlatformDependencies* GetPlatformDependencies()
  34. const override;
  35. // Overrides CommonDependencies
  36. std::unique_ptr<::autofill_assistant::AssistantFieldTrialUtil>
  37. CreateFieldTrialUtil() const override;
  38. autofill::PersonalDataManager* GetPersonalDataManager(
  39. content::BrowserContext* browser_context) const override;
  40. password_manager::PasswordManagerClient* GetPasswordManagerClient(
  41. content::WebContents* web_contents) const override;
  42. std::string GetLocale() const override;
  43. std::string GetCountryCode() const override;
  44. std::string GetSignedInEmail(
  45. content::BrowserContext* browser_context) const override;
  46. bool IsSupervisedUser(
  47. content::BrowserContext* browser_context) const override;
  48. ::autofill_assistant::AnnotateDomModelService*
  49. GetOrCreateAnnotateDomModelService(
  50. content::BrowserContext* browser_context) const override;
  51. bool IsWebLayer() const override;
  52. signin::IdentityManager* GetIdentityManager(
  53. content::BrowserContext* browser_context) const override;
  54. version_info::Channel GetChannel() const override;
  55. // Overrides PlatformDependencies
  56. bool IsCustomTab(const content::WebContents& web_contents) const override;
  57. };
  58. } // namespace weblayer
  59. #endif // WEBLAYER_BROWSER_AUTOFILL_ASSISTANT_WEBLAYER_DEPENDENCIES_H_