Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: ash/wm/window_selector.h

Issue 20415002: Add window overview mode behind --ash-enable-overview-mode flag to F5 key. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove implicit cast to bool. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/wm/window_selector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 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_WINDOW_SELECTOR_H_
6 #define ASH_WM_WINDOW_SELECTOR_H_
7
8 #include <vector>
9
10 #include "base/compiler_specific.h"
11 #include "ui/aura/window_observer.h"
12 #include "ui/base/events/event_handler.h"
13 #include "ui/gfx/transform.h"
14
15 namespace aura {
16 class RootWindow;
17 }
18
19 namespace ash {
20
21 class WindowSelectorDelegate;
22
23 // The WindowSelector shows a grid of all of your windows and allows selecting
24 // a window by clicking or tapping on it.
25 class WindowSelector : public ui::EventHandler,
26 public aura::WindowObserver {
27 public:
28 typedef std::vector<aura::Window*> WindowList;
29
30 WindowSelector(const WindowList& windows,
31 WindowSelectorDelegate* delegate);
32 virtual ~WindowSelector();
33
34 // ui::EventHandler:
35 virtual void OnEvent(ui::Event* event) OVERRIDE;
36 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
37 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
38
39 // aura::WindowObserver:
40 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE;
41
42 private:
43 struct WindowDetails {
44 WindowDetails() : window(NULL), minimized(false) {}
45
46 bool operator==(const aura::Window* other_window) const {
47 return window == other_window;
48 }
49
50 // A weak pointer to the window.
51 aura::Window* window;
52
53 // If true, the window was minimized and this should be restored if the
54 // window was not selected.
55 bool minimized;
56
57 // The original transform of the window before entering overview mode.
58 gfx::Transform original_transform;
59 };
60
61 void HandleSelectionEvent(ui::Event* event);
62 void PositionWindows();
63 void PositionWindowsOnRoot(aura::RootWindow* root_window);
64
65 void SelectWindow(aura::Window*);
66
67 // List of weak pointers of windows to select from.
68 std::vector<WindowDetails> windows_;
69
70 // Weak pointer to the selector delegate which will be called when a
71 // selection is made.
72 WindowSelectorDelegate* delegate_;
73
74 DISALLOW_COPY_AND_ASSIGN(WindowSelector);
75 };
76
77 } // namespace ash
78
79 #endif // ASH_WM_WINDOW_SELECTOR_H_
OLDNEW
« no previous file with comments | « ash/shell_delegate.h ('k') | ash/wm/window_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698