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_BROWSER_UI_COCOA_WEB_CONTENTS_DIALOG_HOST_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_DIALOG_HOST_COCOA_H_
8 #include "components/web_modal/web_contents_modal_dialog_host.h"
10 @
class ConstrainedWindowSheetController
;
12 // In a Cocoa browser, the modal dialog host is a simple bridge to the
13 // ConstrainedWindowSheetController to get the dialog size and parent window.
14 class WebContentsModalDialogHostCocoa
15 : public web_modal::WebContentsModalDialogHost
{
17 explicit WebContentsModalDialogHostCocoa(
18 ConstrainedWindowSheetController
* sheet_controller
);
19 ~WebContentsModalDialogHostCocoa() override
;
21 // web_modal::ModalDialogHost:
22 gfx::NativeView
GetHostView() const override
;
23 gfx::Point
GetDialogPosition(const gfx::Size
& size
) override
;
24 void AddObserver(web_modal::ModalDialogHostObserver
* observer
) override
;
25 void RemoveObserver(web_modal::ModalDialogHostObserver
* observer
) override
;
27 // web_modal::WebContentsModalDialogHost:
28 gfx::Size
GetMaximumDialogSize() override
;
31 ConstrainedWindowSheetController
* sheet_controller_
; // Weak. Owns |this|.
33 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHostCocoa
);
36 #endif // CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_DIALOG_HOST_COCOA_H_