diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-28 00:13:10 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-28 00:13:10 +0000 |
commit | c2e0448ff6ac368e06173f07adffb9764f0cf32f (patch) | |
tree | a81f66d130c5118d43d59eefa8a5933b69742dd4 /ash/wm | |
parent | 1b6d3034ebda8f329593c7a9e8f962b6f4dfbc13 (diff) | |
download | chromium_src-c2e0448ff6ac368e06173f07adffb9764f0cf32f.zip chromium_src-c2e0448ff6ac368e06173f07adffb9764f0cf32f.tar.gz chromium_src-c2e0448ff6ac368e06173f07adffb9764f0cf32f.tar.bz2 |
Call LayoutStatusArea() in CompactStatusAreaLayoutManager::SetChildBounds
BUG=108501
TEST=See issue. Also generally test status area in compact mode.
Review URL: http://codereview.chromium.org/9027022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm')
-rw-r--r-- | ash/wm/compact_status_area_layout_manager.cc | 7 | ||||
-rw-r--r-- | ash/wm/compact_status_area_layout_manager.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ash/wm/compact_status_area_layout_manager.cc b/ash/wm/compact_status_area_layout_manager.cc index fb6b5d5..fb36a27 100644 --- a/ash/wm/compact_status_area_layout_manager.cc +++ b/ash/wm/compact_status_area_layout_manager.cc @@ -4,6 +4,7 @@ #include "ash/wm/compact_status_area_layout_manager.h" +#include "base/auto_reset.h" #include "ui/gfx/rect.h" #include "ui/gfx/screen.h" #include "ui/views/widget/widget.h" @@ -21,7 +22,8 @@ namespace internal { CompactStatusAreaLayoutManager::CompactStatusAreaLayoutManager( views::Widget* status_widget) - : status_widget_(status_widget) { + : in_layout_(false), + status_widget_(status_widget) { } CompactStatusAreaLayoutManager::~CompactStatusAreaLayoutManager() { @@ -50,12 +52,15 @@ void CompactStatusAreaLayoutManager::OnChildWindowVisibilityChanged( void CompactStatusAreaLayoutManager::SetChildBounds( aura::Window* child, const gfx::Rect& requested_bounds) { SetChildBoundsDirect(child, requested_bounds); + if (!in_layout_) + LayoutStatusArea(); } //////////////////////////////////////////////////////////////////////////////// // CompactStatusAreaLayoutManager, private: void CompactStatusAreaLayoutManager::LayoutStatusArea() { + AutoReset<bool> auto_reset_in_layout(&in_layout_, true); // Place the widget in the top-right corner of the screen. gfx::Rect monitor_bounds = gfx::Screen::GetPrimaryMonitorBounds(); gfx::Rect widget_bounds = status_widget_->GetRestoredBounds(); diff --git a/ash/wm/compact_status_area_layout_manager.h b/ash/wm/compact_status_area_layout_manager.h index 5ac7bb2..cd676d8 100644 --- a/ash/wm/compact_status_area_layout_manager.h +++ b/ash/wm/compact_status_area_layout_manager.h @@ -37,6 +37,7 @@ class CompactStatusAreaLayoutManager : public aura::LayoutManager { // Place the status area widget in the corner of the screen. void LayoutStatusArea(); + bool in_layout_; views::Widget* status_widget_; DISALLOW_COPY_AND_ASSIGN(CompactStatusAreaLayoutManager); |