weblayer_client_side_detection_host_delegate.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_SAFE_BROWSING_WEBLAYER_CLIENT_SIDE_DETECTION_HOST_DELEGATE_H_
  5. #define WEBLAYER_BROWSER_SAFE_BROWSING_WEBLAYER_CLIENT_SIDE_DETECTION_HOST_DELEGATE_H_
  6. #include "base/memory/raw_ptr.h"
  7. #include "components/safe_browsing/content/browser/client_side_detection_host.h"
  8. #include "components/safe_browsing/core/common/proto/csd.pb.h"
  9. #include "url/gurl.h"
  10. namespace content {
  11. struct GlobalRenderFrameHostId;
  12. } // namespace content
  13. namespace weblayer {
  14. class WebLayerClientSideDetectionHostDelegate
  15. : public safe_browsing::ClientSideDetectionHost::Delegate {
  16. public:
  17. explicit WebLayerClientSideDetectionHostDelegate(
  18. content::WebContents* web_contents);
  19. WebLayerClientSideDetectionHostDelegate(
  20. const WebLayerClientSideDetectionHostDelegate&) = delete;
  21. WebLayerClientSideDetectionHostDelegate& operator=(
  22. const WebLayerClientSideDetectionHostDelegate&) = delete;
  23. ~WebLayerClientSideDetectionHostDelegate() override;
  24. // ClientSideDetectionHost::Delegate implementation.
  25. bool HasSafeBrowsingUserInteractionObserver() override;
  26. PrefService* GetPrefs() override;
  27. scoped_refptr<safe_browsing::SafeBrowsingDatabaseManager>
  28. GetSafeBrowsingDBManager() override;
  29. scoped_refptr<safe_browsing::BaseUIManager> GetSafeBrowsingUIManager()
  30. override;
  31. base::WeakPtr<safe_browsing::ClientSideDetectionService>
  32. GetClientSideDetectionService() override;
  33. void AddReferrerChain(safe_browsing::ClientPhishingRequest* verdict,
  34. GURL current_url,
  35. const content::GlobalRenderFrameHostId&
  36. current_outermost_main_frame_id) override;
  37. raw_ptr<safe_browsing::VerdictCacheManager> GetCacheManager() override;
  38. private:
  39. raw_ptr<content::WebContents> web_contents_;
  40. };
  41. } // namespace weblayer
  42. #endif // WEBLAYER_BROWSER_SAFE_BROWSING_WEBLAYER_CLIENT_SIDE_DETECTION_HOST_DELEGATE_H_