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 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/aura/window_observer.h" | 10 #include "ui/aura/window_observer.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 namespace ash { | 23 namespace ash { |
24 class TransparentActivateWindowButton; | 24 class TransparentActivateWindowButton; |
25 | 25 |
26 // This class represents an item in overview mode. An item can have one or more | 26 // This class represents an item in overview mode. An item can have one or more |
27 // windows, of which only one can be activated by keyboard (i.e. alt+tab) but | 27 // windows, of which only one can be activated by keyboard (i.e. alt+tab) but |
28 // any can be selected with a pointer (touch or mouse). | 28 // any can be selected with a pointer (touch or mouse). |
29 class WindowSelectorItem : public views::ButtonListener, | 29 class WindowSelectorItem : public views::ButtonListener, |
30 public aura::WindowObserver { | 30 public aura::WindowObserver { |
31 public: | 31 public: |
32 WindowSelectorItem(); | 32 WindowSelectorItem(); |
33 virtual ~WindowSelectorItem(); | 33 ~WindowSelectorItem() override; |
34 | 34 |
35 // The time for the close buttons and labels to fade in when initially shown | 35 // The time for the close buttons and labels to fade in when initially shown |
36 // on entering overview mode. | 36 // on entering overview mode. |
37 static const int kFadeInMilliseconds; | 37 static const int kFadeInMilliseconds; |
38 | 38 |
39 // Returns the root window on which this item is shown. | 39 // Returns the root window on which this item is shown. |
40 virtual aura::Window* GetRootWindow() = 0; | 40 virtual aura::Window* GetRootWindow() = 0; |
41 | 41 |
42 // Returns true if the window selector item has |window| as a selectable | 42 // Returns true if the window selector item has |window| as a selectable |
43 // window. | 43 // window. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 // Sets if the item is dimmed in the overview. Changing the value will also | 82 // Sets if the item is dimmed in the overview. Changing the value will also |
83 // change the visibility of the transform windows. | 83 // change the visibility of the transform windows. |
84 virtual void SetDimmed(bool dimmed); | 84 virtual void SetDimmed(bool dimmed); |
85 bool dimmed() const { return dimmed_; } | 85 bool dimmed() const { return dimmed_; } |
86 | 86 |
87 const gfx::Rect& bounds() const { return bounds_; } | 87 const gfx::Rect& bounds() const { return bounds_; } |
88 const gfx::Rect& target_bounds() const { return target_bounds_; } | 88 const gfx::Rect& target_bounds() const { return target_bounds_; } |
89 | 89 |
90 // views::ButtonListener: | 90 // views::ButtonListener: |
91 virtual void ButtonPressed(views::Button* sender, | 91 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
92 const ui::Event& event) override; | |
93 | 92 |
94 // aura::WindowObserver: | 93 // aura::WindowObserver: |
95 virtual void OnWindowTitleChanged(aura::Window* window) override; | 94 void OnWindowTitleChanged(aura::Window* window) override; |
96 | 95 |
97 protected: | 96 protected: |
98 // Sets the bounds of this selector's items to |target_bounds| in | 97 // Sets the bounds of this selector's items to |target_bounds| in |
99 // |root_window|. If |animate| the windows are animated from their current | 98 // |root_window|. If |animate| the windows are animated from their current |
100 // location. | 99 // location. |
101 virtual void SetItemBounds(aura::Window* root_window, | 100 virtual void SetItemBounds(aura::Window* root_window, |
102 const gfx::Rect& target_bounds, | 101 const gfx::Rect& target_bounds, |
103 bool animate) = 0; | 102 bool animate) = 0; |
104 | 103 |
105 // Sets the bounds used by the selector item's windows. | 104 // Sets the bounds used by the selector item's windows. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Transparent window on top of the real windows in the overview that | 153 // Transparent window on top of the real windows in the overview that |
155 // activates them on click or tap. | 154 // activates them on click or tap. |
156 scoped_ptr<TransparentActivateWindowButton> activate_window_button_; | 155 scoped_ptr<TransparentActivateWindowButton> activate_window_button_; |
157 | 156 |
158 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | 157 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); |
159 }; | 158 }; |
160 | 159 |
161 } // namespace ash | 160 } // namespace ash |
162 | 161 |
163 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | 162 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ |
OLD | NEW |