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

Unified Diff: components/constrained_window/constrained_window_views.cc

Issue 2441403003: Use a standard message box for DesktopCastingWarningView. (Closed)
Patch Set: msw review 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
« no previous file with comments | « chrome/browser/ui/views/simple_message_box_views.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1568c72dde694ea6257cbdc271024b2cfc5a567e 100644
--- a/components/constrained_window/constrained_window_views.cc
+++ b/components/constrained_window/constrained_window_views.cc
@@ -28,7 +28,7 @@ using web_modal::ModalDialogHostObserver;
namespace constrained_window {
namespace {
-ConstrainedWindowViewsClient* constrained_window_views_client = NULL;
+ConstrainedWindowViewsClient* constrained_window_views_client = nullptr;
// The name of a key to store on the window handle to associate
// WidgetModalDialogHostObserverViews with the Widget.
@@ -56,7 +56,7 @@ class WidgetModalDialogHostObserverViews
if (host_)
host_->RemoveObserver(this);
target_widget_->RemoveObserver(this);
- target_widget_->SetNativeWindowProperty(native_window_property_, NULL);
+ target_widget_->SetNativeWindowProperty(native_window_property_, nullptr);
}
// WidgetObserver overrides
@@ -69,7 +69,7 @@ class WidgetModalDialogHostObserverViews
void OnHostDestroying() override {
host_->RemoveObserver(this);
- host_ = NULL;
+ host_ = nullptr;
}
private:
@@ -200,13 +200,13 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
gfx::NativeWindow parent) {
DCHECK_NE(ui::MODAL_TYPE_CHILD, dialog->GetModalType());
DCHECK_NE(ui::MODAL_TYPE_NONE, dialog->GetModalType());
+ DCHECK(!parent || constrained_window_views_client);
- DCHECK(constrained_window_views_client);
gfx::NativeView parent_view =
parent ? constrained_window_views_client->GetDialogHostView(parent)
: nullptr;
views::Widget* widget =
- views::DialogDelegate::CreateDialogWidget(dialog, NULL, parent_view);
+ views::DialogDelegate::CreateDialogWidget(dialog, nullptr, parent_view);
bool requires_positioning = dialog->ShouldUseCustomFrame();
@@ -219,8 +219,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)
+ : nullptr;
if (host) {
DCHECK_EQ(parent_view, host->GetHostView());
ModalDialogHostObserver* dialog_host_observer =
« no previous file with comments | « 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