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" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Update the position of dialog |widget| against |dialog_host|. This is used to | 35 // Update the position of dialog |widget| against |dialog_host|. This is used to |
36 // reposition widgets e.g. when the host dimensions change. | 36 // reposition widgets e.g. when the host dimensions change. |
37 void UpdateWebContentsModalDialogPosition( | 37 void UpdateWebContentsModalDialogPosition( |
38 views::Widget* widget, | 38 views::Widget* widget, |
39 web_modal::WebContentsModalDialogHost* dialog_host); | 39 web_modal::WebContentsModalDialogHost* dialog_host); |
40 | 40 |
41 void UpdateWidgetModalDialogPosition( | 41 void UpdateWidgetModalDialogPosition( |
42 views::Widget* widget, | 42 views::Widget* widget, |
43 web_modal::ModalDialogHost* dialog_host); | 43 web_modal::ModalDialogHost* dialog_host); |
44 | 44 |
| 45 // Returns the top level WebContents of |initiator_web_contents|. |
| 46 content::WebContents* GetTopLevelWebContents( |
| 47 content::WebContents* initiator_web_contents); |
| 48 |
45 // Shows the dialog with a new SingleWebContentsDialogManager. The dialog will | 49 // Shows the dialog with a new SingleWebContentsDialogManager. The dialog will |
46 // notify via WillClose() when it is being destroyed. | 50 // notify via WillClose() when it is being destroyed. |
47 void ShowModalDialog(gfx::NativeWindow dialog, | 51 void ShowModalDialog(gfx::NativeWindow dialog, |
48 content::WebContents* web_contents); | 52 content::WebContents* web_contents); |
49 | 53 |
50 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. | 54 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. |
51 views::Widget* ShowWebModalDialogViews( | 55 views::Widget* ShowWebModalDialogViews( |
52 views::WidgetDelegate* dialog, | 56 views::WidgetDelegate* dialog, |
53 content::WebContents* initiator_web_contents); | 57 content::WebContents* initiator_web_contents); |
54 | 58 |
(...skipping 15 matching lines...) Expand all Loading... |
70 // Create a widget for |dialog| that has a modality given by | 74 // Create a widget for |dialog| that has a modality given by |
71 // |dialog->GetModalType()|. The modal type must be either | 75 // |dialog->GetModalType()|. The modal type must be either |
72 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the | 76 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the |
73 // dialog appropriately if |parent| is a valid browser window. | 77 // dialog appropriately if |parent| is a valid browser window. |
74 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, | 78 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, |
75 gfx::NativeWindow parent); | 79 gfx::NativeWindow parent); |
76 | 80 |
77 } // namespace constrained_window | 81 } // namespace constrained_window |
78 | 82 |
79 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ | 83 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
OLD | NEW |