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

Unified Diff: ash/wm/overview/window_selector_item.cc

Issue 256413004: Relayout windows in overview when display size changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge and remove extra newline. Created 6 years, 8 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 | « ash/wm/overview/window_selector_item.h ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/window_selector_item.cc
diff --git a/ash/wm/overview/window_selector_item.cc b/ash/wm/overview/window_selector_item.cc
index 9866185cd9ca4487170bd80234c3fa7e483f7cc0..9cf029f02b711605379157456861b3c41d3d9d4d 100644
--- a/ash/wm/overview/window_selector_item.cc
+++ b/ash/wm/overview/window_selector_item.cc
@@ -81,15 +81,16 @@ WindowSelectorItem::~WindowSelectorItem() {
}
void WindowSelectorItem::SetBounds(aura::Window* root_window,
- const gfx::Rect& target_bounds) {
+ const gfx::Rect& target_bounds,
+ bool animate) {
if (in_bounds_update_)
return;
base::AutoReset<bool> auto_reset_in_bounds_update(&in_bounds_update_, true);
root_window_ = root_window;
target_bounds_ = target_bounds;
- SetItemBounds(root_window, target_bounds, true);
+ SetItemBounds(root_window, target_bounds, animate);
// TODO(nsatragno): Handle window title updates.
- UpdateWindowLabels(target_bounds, root_window);
+ UpdateWindowLabels(target_bounds, root_window, animate);
}
void WindowSelectorItem::RecomputeWindowTransforms() {
@@ -101,7 +102,8 @@ void WindowSelectorItem::RecomputeWindowTransforms() {
}
void WindowSelectorItem::UpdateWindowLabels(const gfx::Rect& window_bounds,
- aura::Window* root_window) {
+ aura::Window* root_window,
+ bool animate) {
gfx::Rect converted_bounds = ScreenUtil::ConvertRectFromScreen(root_window,
window_bounds);
gfx::Rect label_bounds(converted_bounds.x(),
@@ -139,15 +141,19 @@ void WindowSelectorItem::UpdateWindowLabels(const gfx::Rect& window_bounds,
kFadeInMilliseconds));
layer->SetOpacity(1);
} else {
- ui::ScopedLayerAnimationSettings settings(
- window_label_->GetNativeWindow()->layer()->GetAnimator());
- settings.SetPreemptionStrategy(
- ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
- settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
- ScopedTransformOverviewWindow::kTransitionMilliseconds));
label_bounds.set_height(window_label_->
GetContentsView()->GetPreferredSize().height());
- window_label_->GetNativeWindow()->SetBounds(label_bounds);
+ if (animate) {
+ ui::ScopedLayerAnimationSettings settings(
+ window_label_->GetNativeWindow()->layer()->GetAnimator());
+ settings.SetPreemptionStrategy(
+ ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
+ settings.SetTransitionDuration(base::TimeDelta::FromMilliseconds(
+ ScopedTransformOverviewWindow::kTransitionMilliseconds));
+ window_label_->GetNativeWindow()->SetBounds(label_bounds);
+ } else {
+ window_label_->GetNativeWindow()->SetBounds(label_bounds);
+ }
}
}
« no previous file with comments | « ash/wm/overview/window_selector_item.h ('k') | ash/wm/overview/window_selector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698