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

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

Issue 844763006: Change overview mode to so that docked panel windows are not grouped together. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Polished after a self-review. Created 5 years, 11 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 std::vector<aura::Window*> windows = ash::Shell::GetInstance()->
50 mru_window_tracker()->BuildMruWindowList(); 50 mru_window_tracker()->BuildMruWindowList();
51 // Don't enter overview mode with no windows. 51 // Don't enter overview mode with no windows.
52 if (windows.empty()) 52 if (windows.empty())
53 return; 53 return;
54 54
55 window_selector_.reset(new WindowSelector(windows, this)); 55 window_selector_.reset(new WindowSelector(this));
56 window_selector_->Init(windows);
56 OnSelectionStarted(); 57 OnSelectionStarted();
57 } 58 }
58 } 59 }
59 60
60 bool WindowSelectorController::IsSelecting() { 61 bool WindowSelectorController::IsSelecting() {
61 return window_selector_.get() != NULL; 62 return window_selector_.get() != NULL;
62 } 63 }
63 64
65 bool WindowSelectorController::IsRestoringMinimizedWindows() const {
66 return window_selector_.get() != NULL &&
67 window_selector_->restoring_minimized_windows();
68 }
69
64 // TODO(flackr): Make WindowSelectorController observe the activation of 70 // TODO(flackr): Make WindowSelectorController observe the activation of
65 // windows, so we can remove WindowSelectorDelegate. 71 // windows, so we can remove WindowSelectorDelegate.
66 void WindowSelectorController::OnSelectionEnded() { 72 void WindowSelectorController::OnSelectionEnded() {
73 window_selector_->Shutdown();
67 window_selector_.reset(); 74 window_selector_.reset();
68 last_selection_time_ = base::Time::Now(); 75 last_selection_time_ = base::Time::Now();
69 } 76 }
70 77
71 void WindowSelectorController::OnSelectionStarted() { 78 void WindowSelectorController::OnSelectionStarted() {
72 if (!last_selection_time_.is_null()) { 79 if (!last_selection_time_.is_null()) {
73 UMA_HISTOGRAM_LONG_TIMES( 80 UMA_HISTOGRAM_LONG_TIMES(
74 "Ash.WindowSelector.TimeBetweenUse", 81 "Ash.WindowSelector.TimeBetweenUse",
75 base::Time::Now() - last_selection_time_); 82 base::Time::Now() - last_selection_time_);
76 } 83 }
77 } 84 }
78 85
79 } // namespace ash 86 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698