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

Unified Diff: athena/wm/window_manager_impl.cc

Issue 546123002: Ensure that an activity is activated when overview mode is exited (Closed) 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 | « athena/wm/window_manager_impl.h ('k') | athena/wm/window_manager_unittest.cc » ('j') | 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 9797422ecba0da460f1de66b1ac7a9956fba91dc..9bac4bb8e5114edfef62ca18a9caf444dcd548cd 100644
--- a/athena/wm/window_manager_impl.cc
+++ b/athena/wm/window_manager_impl.cc
@@ -101,7 +101,9 @@ void AthenaContainerLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
aura::Window::Windows list = instance->window_list_provider_->GetWindowList();
if (std::find(list.begin(), list.end(), child) == list.end())
return;
- if (instance->split_view_controller_->IsSplitViewModeActive()) {
+
+ if (instance->split_view_controller_->IsSplitViewModeActive() &&
+ !instance->IsOverviewModeActive()) {
instance->split_view_controller_->ReplaceWindow(
instance->split_view_controller_->left_window(), child);
} else {
@@ -109,6 +111,12 @@ void AthenaContainerLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().work_area().size();
child->SetBounds(gfx::Rect(size));
}
+
+ if (instance->IsOverviewModeActive()) {
+ // TODO(pkotwicz|oshima). Creating a new window should only exit overview
+ // mode if the new window is activated.
sadrul 2014/09/17 18:04:44 Or the window should position itself correctly in
pkotwicz 2014/09/17 20:14:37 Done.
+ instance->OnSelectWindow(child);
+ }
}
void AthenaContainerLayoutManager::OnWillRemoveWindowFromLayout(
@@ -167,7 +175,19 @@ WindowManagerImpl::~WindowManagerImpl() {
}
void WindowManagerImpl::ToggleOverview() {
- SetInOverview(overview_.get() == NULL);
+ if (IsOverviewModeActive()) {
+ SetInOverview(false);
oshima 2014/09/17 22:07:30 It's probably cleaner if we can have two methods
pkotwicz 2014/09/17 22:24:16 It is doable. There are several ways of doing what
oshima 2014/09/17 22:32:40 Great, thanks!
+
+ // Activate the window which was active prior to entering overview.
+ const aura::Window::Windows windows =
+ window_list_provider_->GetWindowList();
+ if (!windows.empty()) {
+ windows.back()->Show();
sadrul 2014/09/17 18:04:44 Why do we need to explicitly Show() here?
pkotwicz 2014/09/17 20:14:37 During unit tests, SetInOverview(false) immediatel
+ wm::ActivateWindow(windows.back());
+ }
+ } else {
+ SetInOverview(true);
+ }
}
bool WindowManagerImpl::IsOverviewModeActive() {
@@ -223,12 +243,15 @@ WindowListProvider* WindowManagerImpl::GetWindowListProvider() {
}
void WindowManagerImpl::OnSelectWindow(aura::Window* window) {
+ SetInOverview(false);
+
+ window->Show();
+ wm::ActivateWindow(window);
sadrul 2014/09/17 18:04:44 ditto
+
if (split_view_controller_->IsSplitViewModeActive()) {
split_view_controller_->DeactivateSplitMode();
FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnSplitViewModeExit());
}
- wm::ActivateWindow(window);
- SetInOverview(false);
// If |window| does not have the size of the work-area, then make sure it is
// resized.
const gfx::Size work_area =
@@ -241,7 +264,6 @@ void WindowManagerImpl::OnSelectWindow(aura::Window* window) {
desired_bounds.y() - window_bounds.y());
transform.Scale(desired_bounds.width() / window_bounds.width(),
desired_bounds.height() / window_bounds.height());
- window->layer()->GetAnimator()->AbortAllAnimations();
ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
settings.SetPreemptionStrategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
@@ -254,18 +276,13 @@ void WindowManagerImpl::OnSelectWindow(aura::Window* window) {
}
}
-void WindowManagerImpl::OnSplitViewMode(aura::Window* left,
- aura::Window* right) {
+void WindowManagerImpl::OnSelectSplitViewWindow(aura::Window* left,
+ aura::Window* right,
+ aura::Window* to_activate) {
SetInOverview(false);
FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnSplitViewModeEnter());
split_view_controller_->ActivateSplitMode(left, right);
-}
-
-void WindowManagerImpl::OnWindowAdded(aura::Window* new_window) {
- // TODO(oshima): Creating a new window should updates the ovewview mode
- // instead of exitting.
- if (new_window->type() == ui::wm::WINDOW_TYPE_NORMAL)
- SetInOverview(false);
+ wm::ActivateWindow(to_activate);
}
void WindowManagerImpl::OnWindowDestroying(aura::Window* window) {
« no previous file with comments | « athena/wm/window_manager_impl.h ('k') | athena/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698