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

Side by Side Diff: ash/common/wm/overview/window_selector_controller.cc

Issue 2667293002: [ash-md] Adds support for gesture to move selection in overview mode (Closed)
Patch Set: [ash-md] Adds support for gesture to move selection in overview mode (no skipping 1st) Created 3 years, 10 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 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 #include "ash/common/wm/overview/window_selector_controller.h" 5 #include "ash/common/wm/overview/window_selector_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/system/tray/system_tray_delegate.h" 10 #include "ash/common/system/tray/system_tray_delegate.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 window_selector_->Init(windows); 68 window_selector_->Init(windows);
69 OnSelectionStarted(); 69 OnSelectionStarted();
70 } 70 }
71 return true; 71 return true;
72 } 72 }
73 73
74 bool WindowSelectorController::IsSelecting() const { 74 bool WindowSelectorController::IsSelecting() const {
75 return window_selector_.get() != NULL; 75 return window_selector_.get() != NULL;
76 } 76 }
77 77
78 void WindowSelectorController::IncrementSelection(int increment) {
79 DCHECK(IsSelecting());
80 window_selector_->IncrementSelection(increment);
81 }
82
83 bool WindowSelectorController::AcceptSelection() {
84 DCHECK(IsSelecting());
85 return window_selector_->AcceptSelection();
86 }
87
78 bool WindowSelectorController::IsRestoringMinimizedWindows() const { 88 bool WindowSelectorController::IsRestoringMinimizedWindows() const {
79 return window_selector_.get() != NULL && 89 return window_selector_.get() != NULL &&
80 window_selector_->restoring_minimized_windows(); 90 window_selector_->restoring_minimized_windows();
81 } 91 }
82 92
83 // TODO(flackr): Make WindowSelectorController observe the activation of 93 // TODO(flackr): Make WindowSelectorController observe the activation of
84 // windows, so we can remove WindowSelectorDelegate. 94 // windows, so we can remove WindowSelectorDelegate.
85 void WindowSelectorController::OnSelectionEnded() { 95 void WindowSelectorController::OnSelectionEnded() {
86 window_selector_->Shutdown(); 96 window_selector_->Shutdown();
87 window_selector_.reset(); 97 window_selector_.reset();
(...skipping 27 matching lines...) Expand all
115 } 125 }
116 126
117 void WindowSelectorController::OnSelectionStarted() { 127 void WindowSelectorController::OnSelectionStarted() {
118 if (!last_selection_time_.is_null()) { 128 if (!last_selection_time_.is_null()) {
119 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse", 129 UMA_HISTOGRAM_LONG_TIMES("Ash.WindowSelector.TimeBetweenUse",
120 base::Time::Now() - last_selection_time_); 130 base::Time::Now() - last_selection_time_);
121 } 131 }
122 } 132 }
123 133
124 } // namespace ash 134 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/overview/window_selector_controller.h ('k') | ash/wm/gestures/overview_gesture_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698