OLD | NEW |
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/ash_switches.h" | |
10 #include "ash/metrics/user_metrics_recorder.h" | 9 #include "ash/metrics/user_metrics_recorder.h" |
11 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
12 #include "ash/session/session_state_delegate.h" | 11 #include "ash/session/session_state_delegate.h" |
13 #include "ash/shell.h" | 12 #include "ash/shell.h" |
14 #include "ash/system/tray/system_tray_delegate.h" | 13 #include "ash/system/tray/system_tray_delegate.h" |
15 #include "ash/wm/mru_window_tracker.h" | 14 #include "ash/wm/mru_window_tracker.h" |
16 #include "ash/wm/overview/window_selector.h" | 15 #include "ash/wm/overview/window_selector.h" |
17 #include "ash/wm/window_state.h" | 16 #include "ash/wm/window_state.h" |
18 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
19 #include "base/command_line.h" | |
20 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
21 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
22 | 20 |
23 namespace ash { | 21 namespace ash { |
24 | 22 |
25 WindowSelectorController::WindowSelectorController() | 23 WindowSelectorController::WindowSelectorController() { |
26 : swipe_to_close_enabled_(base::CommandLine::ForCurrentProcess()->HasSwitch( | |
27 switches::kAshEnableSwipeToCloseInOverviewMode)) { | |
28 } | 24 } |
29 | 25 |
30 WindowSelectorController::~WindowSelectorController() { | 26 WindowSelectorController::~WindowSelectorController() { |
31 } | 27 } |
32 | 28 |
33 // static | 29 // static |
34 bool WindowSelectorController::CanSelect() { | 30 bool WindowSelectorController::CanSelect() { |
35 // Don't allow a window overview if the screen is locked or a modal dialog is | 31 // Don't allow a window overview if the screen is locked or a modal dialog is |
36 // open or running in kiosk app session. | 32 // open or running in kiosk app session. |
37 return Shell::GetInstance()->session_state_delegate()-> | 33 return Shell::GetInstance()->session_state_delegate()-> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 79 |
84 void WindowSelectorController::OnSelectionStarted() { | 80 void WindowSelectorController::OnSelectionStarted() { |
85 if (!last_selection_time_.is_null()) { | 81 if (!last_selection_time_.is_null()) { |
86 UMA_HISTOGRAM_LONG_TIMES( | 82 UMA_HISTOGRAM_LONG_TIMES( |
87 "Ash.WindowSelector.TimeBetweenUse", | 83 "Ash.WindowSelector.TimeBetweenUse", |
88 base::Time::Now() - last_selection_time_); | 84 base::Time::Now() - last_selection_time_); |
89 } | 85 } |
90 } | 86 } |
91 | 87 |
92 } // namespace ash | 88 } // namespace ash |
OLD | NEW |