| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. | 50 // Calls CreateWebModalDialogViews, shows the dialog, and returns its widget. |
| 51 views::Widget* ShowWebModalDialogViews( | 51 views::Widget* ShowWebModalDialogViews( |
| 52 views::WidgetDelegate* dialog, | 52 views::WidgetDelegate* dialog, |
| 53 content::WebContents* initiator_web_contents); | 53 content::WebContents* initiator_web_contents); |
| 54 | 54 |
| 55 #if defined(OS_MACOSX) |
| 56 // Like ShowWebModalDialogViews, but used to show a native dialog "sheet" on |
| 57 // Mac. Sheets are always modal to their parent window. To make them tab-modal, |
| 58 // this provides an invisible tab-modal overlay window managed by |
| 59 // WebContentsModalDialogManager, which can host a dialog sheet. |
| 60 views::Widget* ShowWebModalDialogWithOverlayViews( |
| 61 views::WidgetDelegate* dialog, |
| 62 content::WebContents* initiator_web_contents); |
| 63 #endif |
| 64 |
| 55 // Create a widget for |dialog| that is modal to |web_contents|. | 65 // Create a widget for |dialog| that is modal to |web_contents|. |
| 56 // The modal type of |dialog->GetModalType()| must be ui::MODAL_TYPE_CHILD. | 66 // The modal type of |dialog->GetModalType()| must be ui::MODAL_TYPE_CHILD. |
| 57 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, | 67 views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, |
| 58 content::WebContents* web_contents); | 68 content::WebContents* web_contents); |
| 59 | 69 |
| 60 // Create a widget for |dialog| that has a modality given by | 70 // Create a widget for |dialog| that has a modality given by |
| 61 // |dialog->GetModalType()|. The modal type must be either | 71 // |dialog->GetModalType()|. The modal type must be either |
| 62 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the | 72 // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the |
| 63 // dialog appropriately if |parent| is a valid browser window. | 73 // dialog appropriately if |parent| is a valid browser window. |
| 64 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, | 74 views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, |
| 65 gfx::NativeWindow parent); | 75 gfx::NativeWindow parent); |
| 66 | 76 |
| 67 } // namespace constrained_window | 77 } // namespace constrained_window |
| 68 | 78 |
| 69 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ | 79 #endif // COMPONENTS_CONSTRAINED_WINDOW_CONSTRAINED_WINDOW_VIEWS_H_ |
| OLD | NEW |