summaryrefslogtreecommitdiffstats
path: root/ash/wm/base_layout_manager.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-17 16:04:04 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-17 16:04:04 +0000
commitc96b981c0c43e0cf6e0ef0035706fbea869dd939 (patch)
tree940fd3b0f2fbf08c64ddf3f6e573c2043ac5925a /ash/wm/base_layout_manager.cc
parent3a6ec768208d2d056aa971e7e4bdc5305343db7b (diff)
downloadchromium_src-c96b981c0c43e0cf6e0ef0035706fbea869dd939.zip
chromium_src-c96b981c0c43e0cf6e0ef0035706fbea869dd939.tar.gz
chromium_src-c96b981c0c43e0cf6e0ef0035706fbea869dd939.tar.bz2
Removes worskpace 1 code. Will rename next.
BUG=none TEST=none R=ben@chromium.org,nkostylev@chromium.org TBR=nkostylev@chromium.org Review URL: https://codereview.chromium.org/11201002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162420 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/base_layout_manager.cc')
-rw-r--r--ash/wm/base_layout_manager.cc35
1 files changed, 5 insertions, 30 deletions
diff --git a/ash/wm/base_layout_manager.cc b/ash/wm/base_layout_manager.cc
index 2f2ffb4..1bf6434a 100644
--- a/ash/wm/base_layout_manager.cc
+++ b/ash/wm/base_layout_manager.cc
@@ -4,16 +4,13 @@
#include "ash/wm/base_layout_manager.h"
-#include "ash/ash_switches.h"
#include "ash/screen_ash.h"
#include "ash/shell.h"
#include "ash/wm/shelf_layout_manager.h"
#include "ash/wm/window_animations.h"
#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
-#include "ash/wm/workspace_controller.h"
#include "ash/wm/workspace/workspace_window_resizer.h"
-#include "base/command_line.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -71,7 +68,7 @@ void BaseLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
// Only update the bounds if the window has a show state that depends on the
// workspace area.
if (wm::IsWindowMaximized(child) || wm::IsWindowFullscreen(child))
- UpdateBoundsFromShowState(child, false);
+ UpdateBoundsFromShowState(child);
}
void BaseLayoutManager::OnWillRemoveWindowFromLayout(aura::Window* child) {
@@ -136,11 +133,7 @@ void BaseLayoutManager::OnWindowPropertyChanged(aura::Window* window,
old_state != ui::SHOW_STATE_MAXIMIZED))) {
SetRestoreBoundsInParent(window, window->bounds());
}
- // Minimized state handles its own animations.
- // TODO(sky): get animations to work with Workspace2.
- bool animate = (old_state != ui::SHOW_STATE_MINIMIZED) &&
- !WorkspaceController::IsWorkspace2Enabled();
- UpdateBoundsFromShowState(window, animate);
+ UpdateBoundsFromShowState(window);
ShowStateChanged(window, old_state);
}
}
@@ -177,8 +170,7 @@ void BaseLayoutManager::ShowStateChanged(aura::Window* window,
}
}
-void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window,
- bool animate) {
+void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window) {
switch (window->GetProperty(aura::client::kShowStateKey)) {
case ui::SHOW_STATE_DEFAULT:
case ui::SHOW_STATE_NORMAL: {
@@ -186,8 +178,7 @@ void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window,
if (restore) {
gfx::Rect bounds_in_parent =
ScreenAsh::ConvertRectFromScreen(window->parent(), *restore);
- MaybeAnimateToBounds(window,
- animate,
+ SetChildBoundsDirect(window,
BoundsWithScreenEdgeVisible(window,
bounds_in_parent));
}
@@ -196,8 +187,7 @@ void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window,
}
case ui::SHOW_STATE_MAXIMIZED:
- MaybeAnimateToBounds(window,
- animate,
+ SetChildBoundsDirect(window,
ScreenAsh::GetMaximizedWindowBoundsInParent(window));
break;
@@ -213,21 +203,6 @@ void BaseLayoutManager::UpdateBoundsFromShowState(aura::Window* window,
}
}
-void BaseLayoutManager::MaybeAnimateToBounds(aura::Window* window,
- bool animate,
- const gfx::Rect& new_bounds) {
- // Only animate visible windows.
- if (animate &&
- window->TargetVisibility() &&
- !window->GetProperty(aura::client::kAnimationsDisabledKey) &&
- !CommandLine::ForCurrentProcess()->HasSwitch(
- ash::switches::kAshWindowAnimationsDisabled)) {
- CrossFadeToBounds(window, new_bounds);
- return;
- }
- SetChildBoundsDirect(window, new_bounds);
-}
-
void BaseLayoutManager::AdjustWindowSizesForScreenChange() {
// If a user plugs an external display into a laptop running Aura the
// display size will change. Maximized windows need to resize to match.