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" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 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 // Shows the dialog with a new SingleWebContentsDialogManager. The dialog will | 45 // Shows the dialog with a new SingleWebContentsDialogManager. The dialog will |
| 46 // notify via WillClose() when it is being destroyed. | 46 // notify via WillClose() when it is being destroyed. |
| 47 void ShowModalDialog(gfx::NativeWindow dialog, | 47 void ShowModalDialog(gfx::NativeWindow dialog, |
| 48 content::WebContents* web_contents); | 48 content::WebContents* web_contents); |
| 49 | 49 |
| 50 // Shows the dialog with a new SingleWebContentsDialogManager in a non clipped | |
| 51 // display (not confined to the bounds of the parent window) if this is | |
| 52 // supported by the platform (currently Chrome OS and Mac only). The dialog will | |
| 53 // notify via WillClose() when it is being destroyed. | |
| 54 void ShowNonClippedModalDialog(gfx::NativeWindow dialog, | |
| 55 content::WebContents* web_contents); | |
| 56 | |
| 50 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. | 57 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. |
| 51 views::Widget* ShowWebModalDialogViews( | 58 views::Widget* ShowWebModalDialogViews( |
| 52 views::WidgetDelegate* dialog, | 59 views::WidgetDelegate* dialog, |
| 53 content::WebContents* initiator_web_contents); | 60 content::WebContents* initiator_web_contents); |
| 54 | 61 |
| 62 // Calls CreateWebModalDialogViews, shows the dialog as a non-clipped dialog | |
| 63 // (bounds not constrained by the parent window) and returns its widget. For | |
| 64 // platforms that do not support unclipped dialogs and for Mac, which has | |
| 65 // nonclipped dialogs by default, this has the same behavior as | |
|
Lei Zhang
2016/08/19 03:28:47
non-clipped
rbpotter
2016/08/19 16:59:42
Done.
| |
| 66 // ShowWebModalDialogViews. Currently, unclipped dialogs are only supported on | |
| 67 // Chrome OS and Mac (Mac dialogs are always non clipped). | |
| 68 views::Widget* ShowNonClippedWebModalDialogViews( | |
| 69 views::WidgetDelegate* dialog, | |
| 70 content::WebContents* initiator_web_contents); | |
| 71 | |
| 55 // Create a widget for |dialog| that is modal to |web_contents|. | 72 // Create a widget for |dialog| that is modal to |web_contents|. |
| 56 // The modal type of |dialog->GetModalType()| must be ui::MODAL_TYPE_CHILD. | 73 // The modal type of |dialog->GetModalType()| must be ui::MODAL_TYPE_CHILD. |
| 57 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, | 74 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, |
| 58 content::WebContents* web_contents); | 75 content::WebContents* web_contents); |
| 59 | 76 |
| 60 // Create a widget for |dialog| that has a modality given by | 77 // Create a widget for |dialog| that has a modality given by |
| 61 // |dialog->GetModalType()|. The modal type must be either | 78 // |dialog->GetModalType()|. The modal type must be either |
| 62 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the | 79 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the |
| 63 // dialog appropriately if |parent| is a valid browser window. | 80 // dialog appropriately if |parent| is a valid browser window. |
| 64 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, | 81 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, |
| 65 gfx::NativeWindow parent); | 82 gfx::NativeWindow parent); |
| 66 | 83 |
| 67 } // namespace constrained_window | 84 } // namespace constrained_window |
| 68 | 85 |
| 69 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ | 86 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
| OLD | NEW |