OLD | NEW |
| (Empty) |
1 // Copyright (c) 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 | |
5 #ifndef CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_HOST_H_ | |
6 #define CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_HOST_H_ | |
7 | |
8 #include "ui/gfx/point.h" | |
9 #include "ui/gfx/size.h" | |
10 | |
11 // Observer to be implemented to update web contents modal dialogs when the host | |
12 // indicates their position needs to be changed. | |
13 class WebContentsModalDialogHostObserver { | |
14 public: | |
15 virtual ~WebContentsModalDialogHostObserver(); | |
16 | |
17 virtual void OnPositionRequiresUpdate() = 0; | |
18 | |
19 protected: | |
20 WebContentsModalDialogHostObserver(); | |
21 | |
22 private: | |
23 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHostObserver); | |
24 }; | |
25 | |
26 // Interface for supporting positioning of web contents modal dialogs over a | |
27 // window/widget. | |
28 class WebContentsModalDialogHost { | |
29 public: | |
30 virtual ~WebContentsModalDialogHost(); | |
31 | |
32 virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0; | |
33 | |
34 // Add/remove observer. | |
35 virtual void AddObserver(WebContentsModalDialogHostObserver* observer) = 0; | |
36 virtual void RemoveObserver(WebContentsModalDialogHostObserver* observer) = 0; | |
37 | |
38 protected: | |
39 WebContentsModalDialogHost(); | |
40 | |
41 private: | |
42 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHost); | |
43 }; | |
44 | |
45 #endif // CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_HOST_H_ | |
OLD | NEW |