diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-20 00:38:03 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-20 00:38:03 +0000 |
commit | b4819aeeb47089eabecc3212be6670f24db081db (patch) | |
tree | 55d8239f2ee55a8e996d14d4a65f263a64fac068 /ui | |
parent | f0d583dfa0a622cf3c6b7c494a91bc9f0e1fc959 (diff) | |
download | chromium_src-b4819aeeb47089eabecc3212be6670f24db081db.zip chromium_src-b4819aeeb47089eabecc3212be6670f24db081db.tar.gz chromium_src-b4819aeeb47089eabecc3212be6670f24db081db.tar.bz2 |
* Call LayoutManager::OnChildWindowVisibilityChanged first
because LayoutManager is responsible for updating the show state.
* Show the gained_window only if it wasn't visible.
While investigating DCHECK failure in BaseLayoutManager::OnWindowActivated (168383), I found the following:
a) The window's show status is managed and updated by WorkspaceLayoutManager.
b) OnWindowTargetVisibilityChanged sets the focus to the content area, which
eventually activate the browser window.
c) b) invokes BaseLayoutManager::OnWindowActivated. At this point, the
window's state is still minimized, but it's already shown. so showing it again
doesn't change the state, thus hit DCHECK.
Strictly speaking, only base_layout_manager.cc change is necessary to fix
the DCHECK failure. I changed the OnChildWindowVisiblityChanged because
I think the delegate should see the latest state updated by the ash WM.
BUG=168383
TEST=covered by test.
Review URL: https://chromiumcodereview.appspot.com/11867011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/aura/window.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 9eec35c..a71ce2e 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -698,11 +698,12 @@ void Window::SetVisible(bool visible) { } visible_ = visible; SchedulePaint(); + if (parent_ && parent_->layout_manager_.get()) + parent_->layout_manager_->OnChildWindowVisibilityChanged(this, visible); + if (delegate_) delegate_->OnWindowTargetVisibilityChanged(visible); - if (parent_ && parent_->layout_manager_.get()) - parent_->layout_manager_->OnChildWindowVisibilityChanged(this, visible); FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowVisibilityChanged(this, visible)); |