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

Side by Side Diff: ash/common/wm/window_cycle_list.h

Issue 2249583002: Revert "Enable ash window cycle UI by default." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/common/wm/window_cycle_controller.cc ('k') | ash/common/wm/window_cycle_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_COMMON_WM_WINDOW_CYCLE_LIST_H_ 5 #ifndef ASH_COMMON_WM_WINDOW_CYCLE_LIST_H_
6 #define ASH_COMMON_WM_WINDOW_CYCLE_LIST_H_ 6 #define ASH_COMMON_WM_WINDOW_CYCLE_LIST_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 24 matching lines...) Expand all
35 35
36 bool empty() const { return windows_.empty(); } 36 bool empty() const { return windows_.empty(); }
37 37
38 // Cycles to the next or previous window based on |direction|. 38 // Cycles to the next or previous window based on |direction|.
39 void Step(WindowCycleController::Direction direction); 39 void Step(WindowCycleController::Direction direction);
40 40
41 int current_index() const { return current_index_; } 41 int current_index() const { return current_index_; }
42 42
43 private: 43 private:
44 friend class WindowCycleControllerTest; 44 friend class WindowCycleControllerTest;
45
46 static void DisableInitialDelayForTesting();
47
48 const WindowList& windows() const { return windows_; } 45 const WindowList& windows() const { return windows_; }
49 46
50 // WmWindowObserver overrides: 47 // WmWindowObserver overrides:
51 // There is a chance a window is destroyed, for example by JS code. We need to 48 // There is a chance a window is destroyed, for example by JS code. We need to
52 // take care of that even if it is not intended for the user to close a window 49 // take care of that even if it is not intended for the user to close a window
53 // while window cycling. 50 // while window cycling.
54 void OnWindowDestroying(WmWindow* window) override; 51 void OnWindowDestroying(WmWindow* window) override;
55 52
56 // Returns true if the window list overlay should be shown. 53 // Returns true if the window list overlay should be shown.
57 bool ShouldShowUi(); 54 bool ShouldShowUi();
58 55
59 // Initializes and shows |cycle_view_|. 56 // Initializes and shows |cycle_view_|.
60 void InitWindowCycleView(); 57 void InitWindowCycleView();
61 58
62 // List of weak pointers to windows to use while cycling with the keyboard. 59 // List of weak pointers to windows to use while cycling with the keyboard.
63 // List is built when the user initiates the gesture (i.e. hits alt-tab the 60 // List is built when the user initiates the gesture (i.e. hits alt-tab the
64 // first time) and is emptied when the gesture is complete (i.e. releases the 61 // first time) and is emptied when the gesture is complete (i.e. releases the
65 // alt key). 62 // alt key).
66 WindowList windows_; 63 WindowList windows_;
67 64
68 // Current position in the |windows_|. Can be used to query selection depth, 65 // Current position in the |windows_|. Can be used to query selection depth,
69 // i.e., the position of an active window in a global MRU ordering. 66 // i.e., the position of an active window in a global MRU ordering.
70 int current_index_; 67 int current_index_;
71 68
72 // Wrapper for the window brought to the front. 69 // Wrapper for the window brought to the front.
73 // TODO(estade): remove ScopedShowWindow when we know we are happy launching
74 // the |cycle_view_| version.
75 std::unique_ptr<ScopedShowWindow> showing_window_; 70 std::unique_ptr<ScopedShowWindow> showing_window_;
76 71
77 // The top level View for the window cycle UI. May be null if the UI is not 72 // The top level View for the window cycle UI. May be null if the UI is not
78 // showing. 73 // showing.
79 WindowCycleView* cycle_view_; 74 WindowCycleView* cycle_view_;
80 75
81 // The widget that hosts the window cycle UI. 76 // The widget that hosts the window cycle UI.
82 std::unique_ptr<views::Widget> cycle_ui_widget_; 77 std::unique_ptr<views::Widget> cycle_ui_widget_;
83 78
84 // A timer to delay showing the UI. Quick Alt+Tab should not flash a UI. 79 // A timer to delay showing the UI. Quick Alt+Tab should not flash a UI.
85 base::OneShotTimer show_ui_timer_; 80 base::OneShotTimer show_ui_timer_;
86 81
87 DISALLOW_COPY_AND_ASSIGN(WindowCycleList); 82 DISALLOW_COPY_AND_ASSIGN(WindowCycleList);
88 }; 83 };
89 84
90 } // namespace ash 85 } // namespace ash
91 86
92 #endif // ASH_COMMON_WM_WINDOW_CYCLE_LIST_H_ 87 #endif // ASH_COMMON_WM_WINDOW_CYCLE_LIST_H_
OLDNEW
« no previous file with comments | « ash/common/wm/window_cycle_controller.cc ('k') | ash/common/wm/window_cycle_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698