| Index: athena/wm/window_manager_impl.cc
|
| diff --git a/athena/wm/window_manager_impl.cc b/athena/wm/window_manager_impl.cc
|
| index 4bb04501ff7acfe574fbfccb9318cd8dfdef771e..12e907f3ded00a6225f11bd2c6910f37f654916c 100644
|
| --- a/athena/wm/window_manager_impl.cc
|
| +++ b/athena/wm/window_manager_impl.cc
|
| @@ -39,6 +39,9 @@ class WindowManagerImpl : public WindowManager,
|
| COMMAND_TOGGLE_OVERVIEW,
|
| };
|
|
|
| + // Sets whether overview mode is active.
|
| + void SetInOverview(bool active);
|
| +
|
| void InstallAccelerators();
|
|
|
| // WindowManager:
|
| @@ -112,6 +115,7 @@ WindowManagerImpl::~WindowManagerImpl() {
|
| void WindowManagerImpl::Layout() {
|
| if (!container_)
|
| return;
|
| + SetInOverview(false);
|
| gfx::Rect bounds = gfx::Rect(container_->bounds().size());
|
| const aura::Window::Windows& children = container_->children();
|
| for (aura::Window::Windows::const_iterator iter = children.begin();
|
| @@ -124,14 +128,22 @@ void WindowManagerImpl::Layout() {
|
| }
|
|
|
| void WindowManagerImpl::ToggleOverview() {
|
| - if (overview_) {
|
| - overview_.reset();
|
| - FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
|
| - OnOverviewModeExit());
|
| - } else {
|
| + SetInOverview(overview_.get() == NULL);
|
| +}
|
| +
|
| +void WindowManagerImpl::SetInOverview(bool active) {
|
| + bool in_overview = !!overview_;
|
| + if (active == in_overview)
|
| + return;
|
| +
|
| + if (active) {
|
| overview_ = WindowOverviewMode::Create(container_.get(), this);
|
| FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
|
| OnOverviewModeEnter());
|
| + } else {
|
| + overview_.reset();
|
| + FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
|
| + OnOverviewModeExit());
|
| }
|
| }
|
|
|
| @@ -156,9 +168,7 @@ void WindowManagerImpl::OnSelectWindow(aura::Window* window) {
|
| CHECK_EQ(container_.get(), window->parent());
|
| container_->StackChildAtTop(window);
|
| wm::ActivateWindow(window);
|
| - overview_.reset();
|
| - FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
|
| - OnOverviewModeExit());
|
| + SetInOverview(false);
|
| }
|
|
|
| void WindowManagerImpl::OnWindowDestroying(aura::Window* window) {
|
|
|