diff options
Diffstat (limited to 'chromium/components/constrained_window')
3 files changed, 5 insertions, 1 deletions
diff --git a/chromium/components/constrained_window/constrained_window_views.cc b/chromium/components/constrained_window/constrained_window_views.cc index d41a6964eb3..d8011608da4 100644 --- a/chromium/components/constrained_window/constrained_window_views.cc +++ b/chromium/components/constrained_window/constrained_window_views.cc @@ -66,6 +66,7 @@ class WidgetModalDialogHostObserverViews host_->RemoveObserver(this); target_widget_->RemoveObserver(this); target_widget_->SetNativeWindowProperty(native_window_property_, nullptr); + CHECK(!IsInObserverList()); } // WidgetObserver overrides diff --git a/chromium/components/constrained_window/constrained_window_views.h b/chromium/components/constrained_window/constrained_window_views.h index cb7fcc5a492..eac3f7e6b21 100644 --- a/chromium/components/constrained_window/constrained_window_views.h +++ b/chromium/components/constrained_window/constrained_window_views.h @@ -82,7 +82,9 @@ views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, // ui::MODAL_TYPE_SYSTEM or ui::MODAL_TYPE_WINDOW. This places the dialog // appropriately if |parent| is a valid browser window. Currently, |parent| may // be null for MODAL_TYPE_WINDOW, but that's a bug and callers shouldn't rely on -// that working. See http://crbug.com/657293. +// that working. See http://crbug.com/657293. Instead of calling this function +// with null |parent| and MODAL_TYPE_WINDOW, consider calling views:: +// DialogDelegate::CreateDialogWidget(dialog, nullptr, nullptr) instead. // For dialogs that may appear without direct user interaction (i.e., that may // appear while a user is busily accomplishing some other task in the browser), // consider providing an override of GetDefaultDialogButton on |dialog| to diff --git a/chromium/components/constrained_window/native_web_contents_modal_dialog_manager_views.cc b/chromium/components/constrained_window/native_web_contents_modal_dialog_manager_views.cc index 2056cf3c60e..faa685406d9 100644 --- a/chromium/components/constrained_window/native_web_contents_modal_dialog_manager_views.cc +++ b/chromium/components/constrained_window/native_web_contents_modal_dialog_manager_views.cc @@ -50,6 +50,7 @@ NativeWebContentsModalDialogManagerViews:: for (auto* widget : observed_widgets_) widget->RemoveObserver(this); + CHECK(!IsInObserverList()); } void NativeWebContentsModalDialogManagerViews::ManageDialog() { |