OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | |
6 #define ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "ui/gfx/rect.h" | |
10 | |
11 namespace aura { | |
12 class RootWindow; | |
13 class Window; | |
14 } | |
15 | |
16 namespace ash { | |
17 | |
18 // This class represents an item in overview mode. An item can have one or more | |
19 // windows, of which only one can be activated by keyboard (i.e. alt+tab) but | |
20 // any can be selected with a pointer (touch or mouse). | |
21 class WindowSelectorItem { | |
22 public: | |
23 WindowSelectorItem(); | |
24 virtual ~WindowSelectorItem(); | |
25 | |
26 // Returns the root window on which this item is shown. | |
27 virtual const aura::RootWindow* GetRootWindow() const = 0; | |
28 | |
29 // Returns the targeted window given the event |target| window. | |
30 // Returns NULL if no Window in this item was selected. | |
31 virtual aura::Window* TargetedWindow(const aura::Window* target) const = 0; | |
32 | |
33 // Restores |window| on exiting window overview rather than returning it | |
34 // to its previous state. | |
35 virtual void RestoreWindowOnExit(aura::Window* window) = 0; | |
36 | |
37 // Returns the |window| to activate on selecting of this item. | |
38 virtual aura::Window* SelectionWindow() const = 0; | |
39 | |
40 // Removes |window| from this item. Check empty() after calling this to see | |
41 // if the entire item is now empty. | |
42 virtual void RemoveWindow(const aura::Window* window) = 0; | |
43 | |
44 // Returns true if this item has no more selectable windows (i.e. after | |
45 // calling RemoveWindow for the last contained window). | |
46 virtual bool empty() const = 0; | |
47 | |
48 // Sets the bounds of this window selector item to |target_bounds| in the | |
49 // |root_window| root window. | |
50 virtual void SetBounds(aura::RootWindow* root_window, | |
51 const gfx::Rect& target_bounds); | |
52 | |
53 // Returns the current bounds of this selector item. | |
54 const gfx::Rect& bounds() { return fit_bounds_; } | |
sky
2013/09/13 21:46:44
either name this fit_bounds() to match member (sty
flackr
2013/09/13 22:28:38
Done.
| |
55 | |
56 private: | |
57 // The bounds this item is fit to. | |
58 gfx::Rect fit_bounds_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(WindowSelectorItem); | |
61 }; | |
62 | |
63 } // namespace ash | |
64 | |
65 #endif // ASH_WM_OVERVIEW_WINDOW_SELECTOR_ITEM_H_ | |
OLD | NEW |