aw_safe_browsing_error_page_controller_delegate_impl.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 ANDROID_WEBVIEW_RENDERER_AW_SAFE_BROWSING_ERROR_PAGE_CONTROLLER_DELEGATE_IMPL_H_
  5. #define ANDROID_WEBVIEW_RENDERER_AW_SAFE_BROWSING_ERROR_PAGE_CONTROLLER_DELEGATE_IMPL_H_
  6. #include "components/security_interstitials/content/renderer/security_interstitial_page_controller.h"
  7. #include "components/security_interstitials/core/controller_client.h"
  8. #include "content/public/renderer/render_frame_observer.h"
  9. #include "content/public/renderer/render_frame_observer_tracker.h"
  10. namespace content {
  11. class RenderFrame;
  12. } // namespace content
  13. namespace android_webview {
  14. class AwSafeBrowsingErrorPageControllerDelegateImpl
  15. : public content::RenderFrameObserver,
  16. public content::RenderFrameObserverTracker<
  17. AwSafeBrowsingErrorPageControllerDelegateImpl> {
  18. public:
  19. explicit AwSafeBrowsingErrorPageControllerDelegateImpl(
  20. content::RenderFrame* render_frame);
  21. // Disallow copy and assign
  22. AwSafeBrowsingErrorPageControllerDelegateImpl(
  23. const AwSafeBrowsingErrorPageControllerDelegateImpl&) = delete;
  24. AwSafeBrowsingErrorPageControllerDelegateImpl& operator=(
  25. const AwSafeBrowsingErrorPageControllerDelegateImpl&) = delete;
  26. ~AwSafeBrowsingErrorPageControllerDelegateImpl() override;
  27. // Notifies us that a navigation error has occurred and will be committed
  28. void PrepareForErrorPage();
  29. // content::RenderFrameObserver:
  30. void OnDestruct() override;
  31. void DidCommitProvisionalLoad(ui::PageTransition transition) override;
  32. void DidFinishLoad() override;
  33. private:
  34. // Whether there is an error page pending to be committed.
  35. bool pending_error_ = false;
  36. // Whether the committed page is an error page.
  37. bool committed_error_ = false;
  38. };
  39. } // namespace android_webview
  40. #endif // ANDROID_WEBVIEW_RENDERER_AW_SAFE_BROWSING_ERROR_PAGE_CONTROLLER_DELEGATE_IMPL_H_