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

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

Issue 1059903002: Allow Alt-Tab to move the focus to docked windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/wm/overview/window_selector_controller.h" 5 #include "ash/wm/overview/window_selector_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/metrics/user_metrics_recorder.h" 9 #include "ash/metrics/user_metrics_recorder.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 void WindowSelectorController::ToggleOverview() { 41 void WindowSelectorController::ToggleOverview() {
42 if (IsSelecting()) { 42 if (IsSelecting()) {
43 OnSelectionEnded(); 43 OnSelectionEnded();
44 } else { 44 } else {
45 // Don't start overview if window selection is not allowed. 45 // Don't start overview if window selection is not allowed.
46 if (!CanSelect()) 46 if (!CanSelect())
47 return; 47 return;
48 48
49 std::vector<aura::Window*> windows = ash::Shell::GetInstance()-> 49 aura::Window::Windows windows =
50 mru_window_tracker()->BuildMruWindowList(); 50 ash::Shell::GetInstance()->mru_window_tracker()->BuildMruWindowList();
51
52 for (aura::Window::Windows::iterator iter = windows.begin();
flackr 2015/04/07 15:08:39 Use std::remove_if for linear runtime?
oshima 2015/04/07 18:00:32 This is linear too. To use remove_if, I need to ch
flackr 2015/04/07 18:10:33 aura::Window::Windows looks to be a vector making
oshima 2015/04/07 20:35:29 You're absolutely right, sorry. Updated.
53 iter != windows.end();) {
54 if (WindowSelector::IsSelectable(*iter))
55 ++iter;
56 else
57 iter = windows.erase(iter);
58 }
59
51 // Don't enter overview mode with no windows. 60 // Don't enter overview mode with no windows.
52 if (windows.empty()) 61 if (windows.empty())
53 return; 62 return;
54 63
55 Shell::GetInstance()->OnOverviewModeStarting(); 64 Shell::GetInstance()->OnOverviewModeStarting();
56 window_selector_.reset(new WindowSelector(this)); 65 window_selector_.reset(new WindowSelector(this));
57 window_selector_->Init(windows); 66 window_selector_->Init(windows);
58 OnSelectionStarted(); 67 OnSelectionStarted();
59 } 68 }
60 } 69 }
(...skipping 18 matching lines...) Expand all
79 88
80 void WindowSelectorController::OnSelectionStarted() { 89 void WindowSelectorController::OnSelectionStarted() {
81 if (!last_selection_time_.is_null()) { 90 if (!last_selection_time_.is_null()) {
82 UMA_HISTOGRAM_LONG_TIMES( 91 UMA_HISTOGRAM_LONG_TIMES(
83 "Ash.WindowSelector.TimeBetweenUse", 92 "Ash.WindowSelector.TimeBetweenUse",
84 base::Time::Now() - last_selection_time_); 93 base::Time::Now() - last_selection_time_);
85 } 94 }
86 } 95 }
87 96
88 } // namespace ash 97 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698