Chromium Code Reviews| 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 COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ | 5 #ifndef COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
| 6 #define COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ | 6 #define COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class WebContents; | 13 class WebContents; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace views { | 16 namespace views { |
| 17 class DialogDelegate; | 17 class DialogDelegate; |
| 18 class Widget; | 18 class Widget; |
| 19 class WidgetDelegate; | 19 class WidgetDelegate; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace web_modal { | 22 namespace web_modal { |
| 23 class ModalDialogHost; | 23 class ModalDialogHost; |
| 24 class WebContentsModalDialogHost; | 24 class WebContentsModalDialogHost; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace constrained_window { | 27 namespace constrained_window { |
| 28 extern const char kHasIndependentBoundsKey[]; | |
| 28 | 29 |
| 29 class ConstrainedWindowViewsClient; | 30 class ConstrainedWindowViewsClient; |
| 30 | 31 |
| 31 // Sets the ConstrainedWindowClient impl. | 32 // Sets the ConstrainedWindowClient impl. |
| 32 void SetConstrainedWindowViewsClient( | 33 void SetConstrainedWindowViewsClient( |
| 33 std::unique_ptr<ConstrainedWindowViewsClient> client); | 34 std::unique_ptr<ConstrainedWindowViewsClient> client); |
| 34 | 35 |
| 35 // Update the position of dialog |widget| against |dialog_host|. This is used to | 36 // Update the position of dialog |widget| against |dialog_host|. This is used to |
| 36 // reposition widgets e.g. when the host dimensions change. | 37 // reposition widgets e.g. when the host dimensions change. |
| 37 void UpdateWebContentsModalDialogPosition( | 38 void UpdateWebContentsModalDialogPosition( |
| 38 views::Widget* widget, | 39 views::Widget* widget, |
| 39 web_modal::WebContentsModalDialogHost* dialog_host); | 40 web_modal::WebContentsModalDialogHost* dialog_host); |
| 40 | 41 |
| 41 void UpdateWidgetModalDialogPosition( | 42 void UpdateWidgetModalDialogPosition( |
| 42 views::Widget* widget, | 43 views::Widget* widget, |
| 43 web_modal::ModalDialogHost* dialog_host); | 44 web_modal::ModalDialogHost* dialog_host); |
| 44 | 45 |
| 45 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. | 46 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. |
| 46 views::Widget* ShowWebModalDialogViews( | 47 views::Widget* ShowWebModalDialogViews( |
| 47 views::WidgetDelegate* dialog, | 48 views::WidgetDelegate* dialog, |
| 48 content::WebContents* initiator_web_contents); | 49 content::WebContents* initiator_web_contents); |
| 49 | 50 |
| 51 views::Widget* ShowWebModalDialogWithIndBoundsViews( | |
|
Mike Wittman
2016/08/05 16:03:46
abbreviations in identifier names should be avoide
rbpotter
2016/08/12 16:36:07
Done.
| |
| 52 views::WidgetDelegate* dialog, | |
| 53 content::WebContents* initiator_web_contents, | |
| 54 bool * independent_bounds); | |
| 55 | |
| 56 | |
| 50 // Create a widget for |dialog| that is modal to |web_contents|. | 57 // Create a widget for |dialog| that is modal to |web_contents|. |
| 51 // The modal type of |dialog->GetModalType()| must be ui::MODAL_TYPE_CHILD. | 58 // The modal type of |dialog->GetModalType()| must be ui::MODAL_TYPE_CHILD. |
| 52 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, | 59 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, |
| 53 content::WebContents* web_contents); | 60 content::WebContents* web_contents); |
| 54 | 61 |
| 55 // Create a widget for |dialog| that has a modality given by | 62 // Create a widget for |dialog| that has a modality given by |
| 56 // |dialog->GetModalType()|. The modal type must be either | 63 // |dialog->GetModalType()|. The modal type must be either |
| 57 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the | 64 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the |
| 58 // dialog appropriately if |parent| is a valid browser window. | 65 // dialog appropriately if |parent| is a valid browser window. |
| 59 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, | 66 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, |
| 60 gfx::NativeWindow parent); | 67 gfx::NativeWindow parent); |
| 61 | 68 |
| 62 } // namespace constrained window | 69 } // namespace constrained window |
| 63 | 70 |
| 64 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ | 71 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
| OLD | NEW |