Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Unified Diff: components/constrained_window/constrained_window_views.cc

Issue 2441403003: Use a standard message box for DesktopCastingWarningView. (Closed)
Patch Set: all good Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/constrained_window/constrained_window_views.cc
diff --git a/components/constrained_window/constrained_window_views.cc b/components/constrained_window/constrained_window_views.cc
index ccdfdd1606700fa05b4f4d4cfdd5ab52e98489c2..fa581988e9ba8ea105eee3f28c1b3af82065f053 100644
--- a/components/constrained_window/constrained_window_views.cc
+++ b/components/constrained_window/constrained_window_views.cc
@@ -201,7 +201,8 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
DCHECK_NE(ui::MODAL_TYPE_CHILD, dialog->GetModalType());
DCHECK_NE(ui::MODAL_TYPE_NONE, dialog->GetModalType());
- DCHECK(constrained_window_views_client);
+ if (parent)
+ DCHECK(constrained_window_views_client);
gfx::NativeView parent_view =
parent ? constrained_window_views_client->GetDialogHostView(parent)
: nullptr;
@@ -219,8 +220,9 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
if (!requires_positioning)
return widget;
- ModalDialogHost* host = constrained_window_views_client->
- GetModalDialogHost(parent);
+ ModalDialogHost* host =
+ parent ? constrained_window_views_client->GetModalDialogHost(parent)
Evan Stade 2016/10/27 16:36:47 note that this is not a behavioral change as the c
+ : nullptr;
if (host) {
DCHECK_EQ(parent_view, host->GetHostView());
ModalDialogHostObserver* dialog_host_observer =
« chrome/browser/ui/simple_message_box.h ('K') | « chrome/browser/ui/views/simple_message_box_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698