cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / components / web_modal / web_contents_modal_dialog_host.h
blobb14c6e85afdd5d112911842d2c84d2e7dc5e7ffb
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.
5 #ifndef COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
6 #define COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
8 #include "ui/gfx/native_widget_types.h"
9 #include "ui/gfx/point.h"
10 #include "ui/gfx/size.h"
12 namespace web_modal {
14 // Observer to be implemented to update web contents modal dialogs when the host
15 // indicates their position needs to be changed.
16 class WebContentsModalDialogHostObserver {
17 public:
18 virtual ~WebContentsModalDialogHostObserver();
20 virtual void OnPositionRequiresUpdate() = 0;
21 virtual void OnHostDestroying() = 0;
23 protected:
24 WebContentsModalDialogHostObserver();
26 private:
27 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHostObserver);
30 // Interface for supporting positioning of web contents modal dialogs over a
31 // window/widget.
32 class WebContentsModalDialogHost {
33 public:
34 virtual ~WebContentsModalDialogHost();
36 // Returns the view against which the dialog is positioned and parented.
37 virtual gfx::NativeView GetHostView() const = 0;
38 // Gets the position for the dialog in coordinates relative to the host
39 // view.
40 virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0;
42 // Add/remove observer.
43 virtual void AddObserver(WebContentsModalDialogHostObserver* observer) = 0;
44 virtual void RemoveObserver(WebContentsModalDialogHostObserver* observer) = 0;
46 protected:
47 WebContentsModalDialogHost();
49 private:
50 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHost);
53 } // namespace web_modal
55 #endif // COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_HOST_H_