| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/overview/window_selector_item.h" | 5 #include "ash/wm/overview/window_selector_item.h" |
| 6 #include "base/auto_reset.h" | 6 #include "base/auto_reset.h" |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 | 8 |
| 9 namespace ash { | 9 namespace ash { |
| 10 | 10 |
| 11 WindowSelectorItem::WindowSelectorItem() | 11 WindowSelectorItem::WindowSelectorItem() |
| 12 : root_window_(NULL), | 12 : root_window_(NULL), |
| 13 in_bounds_update_(false) { | 13 in_bounds_update_(false) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 WindowSelectorItem::~WindowSelectorItem() { | 16 WindowSelectorItem::~WindowSelectorItem() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 void WindowSelectorItem::SetBounds(aura::RootWindow* root_window, | 19 void WindowSelectorItem::SetBounds(aura::Window* root_window, |
| 20 const gfx::Rect& target_bounds) { | 20 const gfx::Rect& target_bounds) { |
| 21 if (in_bounds_update_) | 21 if (in_bounds_update_) |
| 22 return; | 22 return; |
| 23 base::AutoReset<bool> auto_reset_in_bounds_update(&in_bounds_update_, true); | 23 base::AutoReset<bool> auto_reset_in_bounds_update(&in_bounds_update_, true); |
| 24 root_window_ = root_window; | 24 root_window_ = root_window; |
| 25 target_bounds_ = target_bounds; | 25 target_bounds_ = target_bounds; |
| 26 SetItemBounds(root_window, target_bounds, true); | 26 SetItemBounds(root_window, target_bounds, true); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void WindowSelectorItem::RecomputeWindowTransforms() { | 29 void WindowSelectorItem::RecomputeWindowTransforms() { |
| 30 if (in_bounds_update_ || target_bounds_.IsEmpty()) | 30 if (in_bounds_update_ || target_bounds_.IsEmpty()) |
| 31 return; | 31 return; |
| 32 DCHECK(root_window_); | 32 DCHECK(root_window_); |
| 33 base::AutoReset<bool> auto_reset_in_bounds_update(&in_bounds_update_, true); | 33 base::AutoReset<bool> auto_reset_in_bounds_update(&in_bounds_update_, true); |
| 34 SetItemBounds(root_window_, target_bounds_, false); | 34 SetItemBounds(root_window_, target_bounds_, false); |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace ash | 37 } // namespace ash |
| OLD | NEW |