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

Unified Diff: athena/wm/window_manager_impl.cc

Issue 527313002: a Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | 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 2b539612ea6b4ccb29957c61bc33fcae2226d33a..e22543d019818b0880926de4b1cec57c79100460 100644
--- a/athena/wm/window_manager_impl.cc
+++ b/athena/wm/window_manager_impl.cc
@@ -181,18 +181,34 @@ void WindowManagerImpl::SetInOverview(bool active) {
bezel_controller_->set_left_right_delegate(
active ? NULL : split_view_controller_.get());
+
+ aura::Window::Windows window_list = window_list_provider_->GetWindowList();
if (active) {
FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnOverviewModeEnter());
// Re-stack all windows in the order defined by window_list_provider_.
- aura::Window::Windows window_list = window_list_provider_->GetWindowList();
- aura::Window::Windows::iterator it;
- for (it = window_list.begin(); it != window_list.end(); ++it)
+ for (aura::Window::Windows::iterator it = window_list.begin();
+ it != window_list.end();
+ ++it) {
container_->StackChildAtTop(*it);
+
+ if (wm::IsActiveWindow(*it))
+ wm::ActivateWindow(NULL);
+ }
overview_ = WindowOverviewMode::Create(
container_.get(), window_list_provider_.get(),
split_view_controller_.get(), this);
} else {
+ // Select the topmost window in |window_list| if no member of |window_list|
+ // is active upon exiting overview mode.
+ aura::client::ActivationClient* activation_client =
+ aura::client::GetActivationClient(container_->GetRootWindow());
+ aura::Window* active = activation_client->GetActiveWindow();
+ aura::Window::Windows::iterator it =
+ std::find(window_list.begin(), window_list.end(), active);
+ if (it == window_list.end())
+ OnSelectWindow(*window_list.rbegin());
+
overview_.reset();
FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnOverviewModeExit());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698