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

Side by Side Diff: ash/wm/overview/window_grid.h

Issue 2918403006: CrOS Tablet Window management - Split Screen part I (Closed)
Patch Set: Fix failed tests. Created 3 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_GRID_H_ 5 #ifndef ASH_WM_OVERVIEW_WINDOW_GRID_H_
6 #define ASH_WM_OVERVIEW_WINDOW_GRID_H_ 6 #define ASH_WM_OVERVIEW_WINDOW_GRID_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 #include <vector> 12 #include <vector>
13 13
14 #include "ash/wm/overview/window_selector.h" 14 #include "ash/wm/overview/window_selector.h"
15 #include "ash/wm/window_state_observer.h" 15 #include "ash/wm/window_state_observer.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "base/scoped_observer.h" 17 #include "base/scoped_observer.h"
18 #include "ui/aura/window_observer.h" 18 #include "ui/aura/window_observer.h"
19 #include "ui/gfx/geometry/rect.h"
19 20
20 namespace views { 21 namespace views {
21 class Widget; 22 class Widget;
22 } 23 }
23 24
24 namespace wm { 25 namespace wm {
25 class Shadow; 26 class Shadow;
26 } 27 }
27 28
28 namespace ash { 29 namespace ash {
(...skipping 16 matching lines...) Expand all
45 // Example sequences: 46 // Example sequences:
46 // - Going right to left 47 // - Going right to left
47 // 0, 1, 2, 3, 4, 5, 6 48 // 0, 1, 2, 3, 4, 5, 6
48 // The selector is switched to the next window grid (if available) or wrapped if 49 // The selector is switched to the next window grid (if available) or wrapped if
49 // it reaches the end of its movement sequence. 50 // it reaches the end of its movement sequence.
50 class ASH_EXPORT WindowGrid : public aura::WindowObserver, 51 class ASH_EXPORT WindowGrid : public aura::WindowObserver,
51 public wm::WindowStateObserver { 52 public wm::WindowStateObserver {
52 public: 53 public:
53 WindowGrid(aura::Window* root_window, 54 WindowGrid(aura::Window* root_window,
54 const std::vector<aura::Window*>& window_list, 55 const std::vector<aura::Window*>& window_list,
55 WindowSelector* window_selector); 56 WindowSelector* window_selector,
57 const gfx::Rect& bounds_in_screen);
56 ~WindowGrid() override; 58 ~WindowGrid() override;
57 59
58 // Exits overview mode, fading out the |shield_widget_| if necessary. 60 // Exits overview mode, fading out the |shield_widget_| if necessary.
59 void Shutdown(); 61 void Shutdown();
60 62
61 // Prepares the windows in this grid for overview. This will restore all 63 // Prepares the windows in this grid for overview. This will restore all
62 // minimized windows and ensure they are visible. 64 // minimized windows and ensure they are visible.
63 void PrepareForOverview(); 65 void PrepareForOverview();
64 66
65 // Positions all the windows in rows of equal height scaling each window to 67 // Positions all the windows in rows of equal height scaling each window to
(...skipping 15 matching lines...) Expand all
81 // this window grid bounds. 83 // this window grid bounds.
82 bool Move(WindowSelector::Direction direction, bool animate); 84 bool Move(WindowSelector::Direction direction, bool animate);
83 85
84 // Returns the target selected window, or NULL if there is none selected. 86 // Returns the target selected window, or NULL if there is none selected.
85 WindowSelectorItem* SelectedWindow() const; 87 WindowSelectorItem* SelectedWindow() const;
86 88
87 // Returns true if a window is contained in any of the WindowSelectorItems 89 // Returns true if a window is contained in any of the WindowSelectorItems
88 // this grid owns. 90 // this grid owns.
89 bool Contains(const aura::Window* window) const; 91 bool Contains(const aura::Window* window) const;
90 92
93 // Remove window selector iten |selector_item| from the grid.
94 void RemoveItem(WindowSelectorItem* selector_item);
95
91 // Dims the items whose titles do not contain |pattern| and prevents their 96 // Dims the items whose titles do not contain |pattern| and prevents their
92 // selection. The pattern has its accents removed and is converted to 97 // selection. The pattern has its accents removed and is converted to
93 // lowercase in a l10n sensitive context. 98 // lowercase in a l10n sensitive context.
94 // If |pattern| is empty, no item is dimmed. 99 // If |pattern| is empty, no item is dimmed.
95 void FilterItems(const base::string16& pattern); 100 void FilterItems(const base::string16& pattern);
96 101
97 // Called when |window| is about to get closed. If the |window| is currently 102 // Called when |window| is about to get closed. If the |window| is currently
98 // selected the implementation fades out |selection_widget_| to transparent 103 // selected the implementation fades out |selection_widget_| to transparent
99 // opacity, effectively hiding the selector widget. 104 // opacity, effectively hiding the selector widget.
100 void WindowClosing(WindowSelectorItem* window); 105 void WindowClosing(WindowSelectorItem* window);
101 106
107 void SetBoundsInScreen(const gfx::Rect bounds);
oshima 2017/06/14 00:19:27 SetTotalBoundsInScreen/SetTotalGridBoundsInScreen?
xdai1 2017/06/15 22:11:41 Done.
108
102 // Returns true if the grid has no more windows. 109 // Returns true if the grid has no more windows.
103 bool empty() const { return window_list_.empty(); } 110 bool empty() const { return window_list_.empty(); }
104 111
105 // Returns how many window selector items are in the grid. 112 // Returns how many window selector items are in the grid.
106 size_t size() const { return window_list_.size(); } 113 size_t size() const { return window_list_.size(); }
107 114
108 // Returns true if the selection widget is active. 115 // Returns true if the selection widget is active.
109 bool is_selecting() const { return selection_widget_ != nullptr; } 116 bool is_selecting() const { return selection_widget_ != nullptr; }
110 117
111 // Returns the root window in which the grid displays the windows. 118 // Returns the root window in which the grid displays the windows.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 190
184 // Current selected window position. 191 // Current selected window position.
185 size_t selected_index_; 192 size_t selected_index_;
186 193
187 // Number of columns in the grid. 194 // Number of columns in the grid.
188 size_t num_columns_; 195 size_t num_columns_;
189 196
190 // True only after all windows have been prepared for overview. 197 // True only after all windows have been prepared for overview.
191 bool prepared_for_overview_; 198 bool prepared_for_overview_;
192 199
200 // The bound in screen coordinates for the window grid.
201 gfx::Rect bounds_;
202
193 DISALLOW_COPY_AND_ASSIGN(WindowGrid); 203 DISALLOW_COPY_AND_ASSIGN(WindowGrid);
194 }; 204 };
195 205
196 } // namespace ash 206 } // namespace ash
197 207
198 #endif // ASH_WM_OVERVIEW_WINDOW_GRID_H_ 208 #endif // ASH_WM_OVERVIEW_WINDOW_GRID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698