From 0922e066c27ada7d45acf8b92985f00f532f3e48 Mon Sep 17 00:00:00 2001 From: "oshima@chromium.org" Date: Wed, 8 Feb 2012 01:49:32 +0000 Subject: Close background widget synchronously when root window is deleted. Posting another task when destroying widget in posted CloseNow is too late. BUG=75023 TEST=none Review URL: https://chromiumcodereview.appspot.com/9339001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120901 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/shell.cc | 4 ++++ ash/wm/root_window_layout_manager.cc | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'ash') diff --git a/ash/shell.cc b/ash/shell.cc index ac9d079..0e2c11e 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -216,6 +216,10 @@ Shell::~Shell() { RemoveRootWindowEventFilter(window_modality_controller_.get()); RemoveRootWindowEventFilter(accelerator_filter_.get()); + // Close background widget now so that the focus manager of the + // widget gets deleted in the final message loop run. + root_window_layout_->SetBackgroundWidget(NULL); + // TooltipController needs a valid shell instance. We delete it before // deleting the shell |instance_|. RemoveRootWindowEventFilter(tooltip_controller_.get()); diff --git a/ash/wm/root_window_layout_manager.cc b/ash/wm/root_window_layout_manager.cc index 55acb16..56013f6 100644 --- a/ash/wm/root_window_layout_manager.cc +++ b/ash/wm/root_window_layout_manager.cc @@ -25,8 +25,9 @@ RootWindowLayoutManager::~RootWindowLayoutManager() { void RootWindowLayoutManager::SetBackgroundWidget(views::Widget* widget) { if (widget == background_widget_) return; + // Close now so that the focus manager will be deleted before shutdown. if (background_widget_) - background_widget_->Close(); + background_widget_->CloseNow(); background_widget_ = widget; } -- cgit v1.1