1 // Copyright 2015 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.
5 #ifndef CHROME_TEST_BASE_DIALOG_TEST_BROWSER_WINDOW_H_
6 #define CHROME_TEST_BASE_DIALOG_TEST_BROWSER_WINDOW_H_
8 #include "chrome/test/base/test_browser_window.h"
9 #include "components/web_modal/web_contents_modal_dialog_host.h"
13 // Custom test browser window to provide a parent view to a modal dialog.
14 class DialogTestBrowserWindow
: public TestBrowserWindow
,
15 public web_modal::WebContentsModalDialogHost
{
17 DialogTestBrowserWindow();
18 ~DialogTestBrowserWindow() override
;
20 // BrowserWindow overrides
21 web_modal::WebContentsModalDialogHost
* GetWebContentsModalDialogHost()
24 // web_modal::WebContentsModalDialogHost overrides
25 gfx::NativeView
GetHostView() const override
;
26 gfx::Point
GetDialogPosition(const gfx::Size
& size
) override
;
27 gfx::Size
GetMaximumDialogSize() override
;
28 void AddObserver(web_modal::ModalDialogHostObserver
* observer
) override
;
29 void RemoveObserver(web_modal::ModalDialogHostObserver
* observer
) override
;
32 Browser
* FindBrowser() const;
34 DISALLOW_COPY_AND_ASSIGN(DialogTestBrowserWindow
);
37 #endif // CHROME_TEST_BASE_DIALOG_TEST_BROWSER_WINDOW_H_