Move render_view_context_menu.* and related files out of tab_contents.
[chromium-blink-merge.git] / ash / wm / overview / window_selector_item.cc
bloba2c25b617e9c872b1c2849209cc383ff59a14657
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"
9 namespace ash {
11 WindowSelectorItem::WindowSelectorItem()
12 : root_window_(NULL),
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_)
22 return;
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())
31 return;
32 DCHECK(root_window_);
33 base::AutoReset<bool> auto_reset_in_bounds_update(&in_bounds_update_, true);
34 SetItemBounds(root_window_, target_bounds_, false);
37 } // namespace ash