OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_DIALOG_HOST_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_DIALOG_HOST_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_DIALOG_HOST_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_DIALOG_HOST_COCOA_H_ |
7 | 7 |
| 8 #include "base/macros.h" |
8 #include "components/web_modal/web_contents_modal_dialog_host.h" | 9 #include "components/web_modal/web_contents_modal_dialog_host.h" |
9 | 10 |
10 @class ConstrainedWindowSheetController; | 11 @class ConstrainedWindowSheetController; |
11 | 12 |
12 // In a Cocoa browser, the modal dialog host is a simple bridge to the | 13 // 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 // ConstrainedWindowSheetController to get the dialog size and parent window. |
14 class WebContentsModalDialogHostCocoa | 15 class WebContentsModalDialogHostCocoa |
15 : public web_modal::WebContentsModalDialogHost { | 16 : public web_modal::WebContentsModalDialogHost { |
16 public: | 17 public: |
17 explicit WebContentsModalDialogHostCocoa( | 18 explicit WebContentsModalDialogHostCocoa( |
18 ConstrainedWindowSheetController* sheet_controller); | 19 ConstrainedWindowSheetController* sheet_controller); |
19 ~WebContentsModalDialogHostCocoa() override; | 20 ~WebContentsModalDialogHostCocoa() override; |
20 | 21 |
21 // web_modal::ModalDialogHost: | 22 // web_modal::ModalDialogHost: |
22 gfx::NativeView GetHostView() const override; | 23 gfx::NativeView GetHostView() const override; |
23 gfx::Point GetDialogPosition(const gfx::Size& size) override; | 24 gfx::Point GetDialogPosition(const gfx::Size& size) override; |
24 void AddObserver(web_modal::ModalDialogHostObserver* observer) override; | 25 void AddObserver(web_modal::ModalDialogHostObserver* observer) override; |
25 void RemoveObserver(web_modal::ModalDialogHostObserver* observer) override; | 26 void RemoveObserver(web_modal::ModalDialogHostObserver* observer) override; |
26 | 27 |
27 // web_modal::WebContentsModalDialogHost: | 28 // web_modal::WebContentsModalDialogHost: |
28 gfx::Size GetMaximumDialogSize() override; | 29 gfx::Size GetMaximumDialogSize() override; |
29 | 30 |
30 private: | 31 private: |
31 ConstrainedWindowSheetController* sheet_controller_; // Weak. Owns |this|. | 32 ConstrainedWindowSheetController* sheet_controller_; // Weak. Owns |this|. |
32 | 33 |
33 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHostCocoa); | 34 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHostCocoa); |
34 }; | 35 }; |
35 | 36 |
36 #endif // CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_DIALOG_HOST_COCOA_H_ | 37 #endif // CHROME_BROWSER_UI_COCOA_WEB_CONTENTS_DIALOG_HOST_COCOA_H_ |
OLD | NEW |