1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Use of this source code is governed by a BSD-style license that can be
3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// found in the LICENSE file.
4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_
6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_
7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "ui/gfx/native_widget_types.h"
9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querunamespace content {
11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass WebContents;
12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querunamespace views {
15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass DialogDelegate;
16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass Widget;
17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass WidgetDelegate;
18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querunamespace web_modal {
21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass ModalDialogHost;
22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass WebContentsModalDialogHost;
23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Update the position of dialog |widget| against |dialog_host|. This is used to
26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// reposition widgets e.g. when the host dimensions change.
27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid UpdateWebContentsModalDialogPosition(
28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    views::Widget* widget,
29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    web_modal::WebContentsModalDialogHost* dialog_host);
30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruvoid UpdateBrowserModalDialogPosition(
32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    views::Widget* widget,
33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    web_modal::ModalDialogHost* dialog_host);
34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Calls CreateWebModalDialogViews, shows the dialog, and returns its widget.
36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruviews::Widget* ShowWebModalDialogViews(
37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    views::WidgetDelegate* dialog,
38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    content::WebContents* initiator_web_contents);
39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Create a widget for |dialog| that is modal to |web_contents|.
41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruviews::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog,
42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                         content::WebContents* web_contents);
43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// Create a widget for |dialog| that is modal to the browser window |parent|.
45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru// This places the dialog appropriately if |parent| is a valid browser window.
46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruviews::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                             gfx::NativeWindow parent);
48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif  // CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_
50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru