page_info_delegate_impl.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Copyright 2020 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_URL_BAR_PAGE_INFO_DELEGATE_IMPL_H_
  5. #define WEBLAYER_BROWSER_URL_BAR_PAGE_INFO_DELEGATE_IMPL_H_
  6. #include <string>
  7. #include "base/memory/raw_ptr.h"
  8. #include "build/build_config.h"
  9. #include "components/browsing_data/content/local_shared_objects_container.h"
  10. #include "components/page_info/page_info.h"
  11. #include "components/page_info/page_info_delegate.h"
  12. #include "content/public/browser/web_contents.h"
  13. #include "content/public/browser/web_contents_user_data.h"
  14. #include "url/gurl.h"
  15. namespace weblayer {
  16. class PageInfoDelegateImpl : public PageInfoDelegate {
  17. public:
  18. explicit PageInfoDelegateImpl(content::WebContents* web_contents);
  19. ~PageInfoDelegateImpl() override = default;
  20. // PageInfoDelegate implementation
  21. permissions::ObjectPermissionContextBase* GetChooserContext(
  22. ContentSettingsType type) override;
  23. #if BUILDFLAG(FULL_SAFE_BROWSING)
  24. safe_browsing::PasswordProtectionService* GetPasswordProtectionService()
  25. const override;
  26. void OnUserActionOnPasswordUi(safe_browsing::WarningAction action) override;
  27. std::u16string GetWarningDetailText() override;
  28. #endif
  29. permissions::PermissionResult GetPermissionResult(
  30. blink::PermissionType permission,
  31. const url::Origin& origin) override;
  32. #if !BUILDFLAG(IS_ANDROID)
  33. bool CreateInfoBarDelegate() override;
  34. void ShowSiteSettings(const GURL& site_url) override;
  35. void ShowCookiesSettings() override;
  36. void OpenCookiesDialog() override;
  37. void OpenCertificateDialog(net::X509Certificate* certificate) override;
  38. void OpenConnectionHelpCenterPage(const ui::Event& event) override;
  39. void OpenSafetyTipHelpCenterPage() override;
  40. void OpenContentSettingsExceptions(
  41. ContentSettingsType content_settings_type) override;
  42. void OnPageInfoActionOccurred(PageInfo::PageInfoAction action) override;
  43. void OnUIClosing() override;
  44. #endif
  45. permissions::PermissionDecisionAutoBlocker* GetPermissionDecisionAutoblocker()
  46. override;
  47. StatefulSSLHostStateDelegate* GetStatefulSSLHostStateDelegate() override;
  48. HostContentSettingsMap* GetContentSettings() override;
  49. std::unique_ptr<content_settings::PageSpecificContentSettings::Delegate>
  50. GetPageSpecificContentSettingsDelegate() override;
  51. bool IsSubresourceFilterActivated(const GURL& site_url) override;
  52. bool IsContentDisplayedInVrHeadset() override;
  53. security_state::SecurityLevel GetSecurityLevel() override;
  54. security_state::VisibleSecurityState GetVisibleSecurityState() override;
  55. #if BUILDFLAG(IS_ANDROID)
  56. const std::u16string GetClientApplicationName() override;
  57. #endif
  58. private:
  59. content::BrowserContext* GetBrowserContext() const;
  60. raw_ptr<content::WebContents> web_contents_;
  61. };
  62. } // namespace weblayer
  63. #endif // WEBLAYER_BROWSER_URL_BAR_PAGE_INFO_DELEGATE_IMPL_H_