Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: athena/wm/window_manager_impl.cc

Issue 411813002: Exit overview mode when a new activity is opened in athena (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/home/home_card_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d818416954c18b605a864f8c9779e3703c6f7fcb 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:
@@ -101,6 +104,7 @@ WindowManagerImpl::WindowManagerImpl() {
}
WindowManagerImpl::~WindowManagerImpl() {
+ overview_.reset();
if (container_) {
container_->RemoveObserver(this);
container_->RemovePreTargetHandler(bezel_controller_.get());
@@ -112,6 +116,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 +129,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 +169,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) {
« no previous file with comments | « athena/home/home_card_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698