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 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_WINDOW_H_
6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_WINDOW_H_
8 #include "ash/wm/overview/scoped_transform_overview_window.h"
9 #include "ash/wm/overview/window_selector_item.h"
10 #include "base/compiler_specific.h"
11 #include "ui/gfx/rect.h"
12 #include "ui/views/controls/button/button.h"
24 // This implements a window overview item with a single window which can be
26 class WindowSelectorWindow : public WindowSelectorItem,
27 public views::ButtonListener {
29 WindowSelectorWindow(aura::Window* window);
30 virtual ~WindowSelectorWindow();
32 // WindowSelectorItem:
33 virtual aura::Window* GetRootWindow() OVERRIDE;
34 virtual bool HasSelectableWindow(const aura::Window* window) OVERRIDE;
35 virtual aura::Window* TargetedWindow(const aura::Window* target) OVERRIDE;
36 virtual void RestoreWindowOnExit(aura::Window* window) OVERRIDE;
37 virtual aura::Window* SelectionWindow() OVERRIDE;
38 virtual void RemoveWindow(const aura::Window* window) OVERRIDE;
39 virtual bool empty() const OVERRIDE;
40 virtual void PrepareForOverview() OVERRIDE;
41 virtual void SetItemBounds(aura::Window* root_window,
42 const gfx::Rect& target_bounds,
43 bool animate) OVERRIDE;
45 // views::ButtonListener:
46 virtual void ButtonPressed(views::Button* sender,
47 const ui::Event& event) OVERRIDE;
49 // Creates the close button window if it does not exist and updates the bounds
50 // to match the window selector item.
51 void UpdateCloseButtonBounds(aura::Window* root_window, bool animate);
53 // The window with a scoped transform represented by this selector item.
54 ScopedTransformOverviewWindow transform_window_;
56 // An easy to access close button for the window in this item.
57 scoped_ptr<views::Widget> close_button_;
59 DISALLOW_COPY_AND_ASSIGN(WindowSelectorWindow);
64 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_WINDOW_H_