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
3 // found in the LICENSE file.
5 #include "ash/wm/overview/window_selector_item.h"
6 #include "base/auto_reset.h"
7 #include "ui/aura/window.h"
11 WindowSelectorItem::WindowSelectorItem()
13 in_bounds_update_(false) {
16 WindowSelectorItem::~WindowSelectorItem() {
19 void WindowSelectorItem::SetBounds(aura::Window
* root_window
,
20 const gfx::Rect
& target_bounds
) {
21 if (in_bounds_update_
)
23 base::AutoReset
<bool> auto_reset_in_bounds_update(&in_bounds_update_
, true);
24 root_window_
= root_window
;
25 target_bounds_
= target_bounds
;
26 SetItemBounds(root_window
, target_bounds
, true);
29 void WindowSelectorItem::RecomputeWindowTransforms() {
30 if (in_bounds_update_
|| target_bounds_
.IsEmpty())
33 base::AutoReset
<bool> auto_reset_in_bounds_update(&in_bounds_update_
, true);
34 SetItemBounds(root_window_
, target_bounds_
, false);