Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / components / web_modal / modal_dialog_host.h
blobc7842b3da32f9f9e3995c3f84e73e62471756533
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.
5 #ifndef COMPONENTS_WEB_MODAL_MODAL_DIALOG_HOST_H_
6 #define COMPONENTS_WEB_MODAL_MODAL_DIALOG_HOST_H_
8 #include "ui/gfx/native_widget_types.h"
10 namespace gfx {
11 class Point;
12 class Size;
13 } // namespace gfx
15 namespace web_modal {
17 // Observer to be implemented to update modal dialogs when the host indicates
18 // their position needs to be changed.
19 class ModalDialogHostObserver {
20 public:
21 virtual ~ModalDialogHostObserver();
23 virtual void OnPositionRequiresUpdate() = 0;
24 virtual void OnHostDestroying() = 0;
27 // Interface for supporting positioning of modal dialogs over a window/widget.
28 class ModalDialogHost {
29 public:
30 virtual ~ModalDialogHost();
32 // Returns the view against which the dialog is positioned and parented.
33 virtual gfx::NativeView GetHostView() const = 0;
34 // Gets the position for the dialog in coordinates relative to the host view.
35 virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0;
37 // Add/remove observer.
38 virtual void AddObserver(ModalDialogHostObserver* observer) = 0;
39 virtual void RemoveObserver(ModalDialogHostObserver* observer) = 0;
42 } // namespace web_modal
44 #endif // COMPONENTS_WEB_MODAL_MODAL_DIALOG_HOST_H_