| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ | 5 #ifndef COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ | 6 #define COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 8 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 9 | 10 |
| 10 namespace content { | 11 namespace content { |
| 11 class WebContents; | 12 class WebContents; |
| 12 } | 13 } |
| 13 | 14 |
| 14 namespace views { | 15 namespace views { |
| 15 class DialogDelegate; | 16 class DialogDelegate; |
| 16 class Widget; | 17 class Widget; |
| 17 class WidgetDelegate; | 18 class WidgetDelegate; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace web_modal { | 21 namespace web_modal { |
| 21 class ModalDialogHost; | 22 class ModalDialogHost; |
| 22 class WebContentsModalDialogHost; | 23 class WebContentsModalDialogHost; |
| 23 } | 24 } |
| 24 | 25 |
| 26 class ConstrainedWindowViewsClient; |
| 27 |
| 28 // Sets the ConstrainedWindowClient impl. |
| 29 void SetConstrainedWindowViewsClient( |
| 30 scoped_ptr<ConstrainedWindowViewsClient> client); |
| 31 |
| 25 // Update the position of dialog |widget| against |dialog_host|. This is used to | 32 // Update the position of dialog |widget| against |dialog_host|. This is used to |
| 26 // reposition widgets e.g. when the host dimensions change. | 33 // reposition widgets e.g. when the host dimensions change. |
| 27 void UpdateWebContentsModalDialogPosition( | 34 void UpdateWebContentsModalDialogPosition( |
| 28 views::Widget* widget, | 35 views::Widget* widget, |
| 29 web_modal::WebContentsModalDialogHost* dialog_host); | 36 web_modal::WebContentsModalDialogHost* dialog_host); |
| 30 | 37 |
| 31 void UpdateBrowserModalDialogPosition( | 38 void UpdateWidgetModalDialogPosition( |
| 32 views::Widget* widget, | 39 views::Widget* widget, |
| 33 web_modal::ModalDialogHost* dialog_host); | 40 web_modal::ModalDialogHost* dialog_host); |
| 34 | 41 |
| 35 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. | 42 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. |
| 36 views::Widget* ShowWebModalDialogViews( | 43 views::Widget* ShowWebModalDialogViews( |
| 37 views::WidgetDelegate* dialog, | 44 views::WidgetDelegate* dialog, |
| 38 content::WebContents* initiator_web_contents); | 45 content::WebContents* initiator_web_contents); |
| 39 | 46 |
| 40 // Create a widget for |dialog| that is modal to |web_contents|. | 47 // Create a widget for |dialog| that is modal to |web_contents|. |
| 41 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, | 48 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, |
| 42 content::WebContents* web_contents); | 49 content::WebContents* web_contents); |
| 43 | 50 |
| 44 // Create a widget for |dialog| that is modal to the browser window |parent|. | 51 // Create a widget for |dialog| that is modal to the browser window |parent|. |
| 45 // This places the dialog appropriately if |parent| is a valid browser window. | 52 // This places the dialog appropriately if |parent| is a valid browser window. |
| 46 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, | 53 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, |
| 47 gfx::NativeWindow parent); | 54 gfx::NativeWindow parent); |
| 48 | 55 |
| 49 #endif // CHROME_BROWSER_UI_VIEWS_CONSTRAINED_WINDOW_VIEWS_H_ | 56 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
| OLD | NEW |