test_web_contents_modal_dialog_manager_delegate.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2013 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 COMPONENTS_WEB_MODAL_TEST_WEB_CONTENTS_MODAL_DIALOG_MANAGER_DELEGATE_H_
  5. #define COMPONENTS_WEB_MODAL_TEST_WEB_CONTENTS_MODAL_DIALOG_MANAGER_DELEGATE_H_
  6. #include "base/memory/raw_ptr.h"
  7. #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
  8. #include "base/compiler_specific.h"
  9. namespace web_modal {
  10. class TestWebContentsModalDialogManagerDelegate
  11. : public WebContentsModalDialogManagerDelegate {
  12. public:
  13. TestWebContentsModalDialogManagerDelegate();
  14. TestWebContentsModalDialogManagerDelegate(
  15. const TestWebContentsModalDialogManagerDelegate&) = delete;
  16. TestWebContentsModalDialogManagerDelegate& operator=(
  17. const TestWebContentsModalDialogManagerDelegate&) = delete;
  18. // WebContentsModalDialogManagerDelegate overrides:
  19. void SetWebContentsBlocked(content::WebContents* web_contents,
  20. bool blocked) override;
  21. WebContentsModalDialogHost* GetWebContentsModalDialogHost() override;
  22. bool IsWebContentsVisible(content::WebContents* web_contents) override;
  23. void set_web_contents_visible(bool visible) {
  24. web_contents_visible_ = visible;
  25. }
  26. void set_web_contents_modal_dialog_host(WebContentsModalDialogHost* host) {
  27. web_contents_modal_dialog_host_ = host;
  28. }
  29. bool web_contents_blocked() const { return web_contents_blocked_; }
  30. private:
  31. bool web_contents_visible_;
  32. bool web_contents_blocked_;
  33. raw_ptr<WebContentsModalDialogHost>
  34. web_contents_modal_dialog_host_; // Not owned.
  35. };
  36. } // namespace web_modal
  37. #endif // COMPONENTS_WEB_MODAL_TEST_WEB_CONTENTS_MODAL_DIALOG_MANAGER_DELEGATE_H_