| 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/common/wm/overview/window_selector.h" | 5 #include "ash/common/wm/overview/window_selector.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/common/accessibility_delegate.h" | 13 #include "ash/common/accessibility_delegate.h" |
| 14 #include "ash/common/accessibility_types.h" | 14 #include "ash/common/accessibility_types.h" |
| 15 #include "ash/common/metrics/user_metrics_action.h" | 15 #include "ash/common/metrics/user_metrics_action.h" |
| 16 #include "ash/common/shelf/wm_shelf.h" | 16 #include "ash/common/shelf/wm_shelf.h" |
| 17 #include "ash/common/wm/mru_window_tracker.h" | 17 #include "ash/common/wm/mru_window_tracker.h" |
| 18 #include "ash/common/wm/overview/window_grid.h" | 18 #include "ash/common/wm/overview/window_grid.h" |
| 19 #include "ash/common/wm/overview/window_selector_delegate.h" | 19 #include "ash/common/wm/overview/window_selector_delegate.h" |
| 20 #include "ash/common/wm/overview/window_selector_item.h" | 20 #include "ash/common/wm/overview/window_selector_item.h" |
| 21 #include "ash/common/wm/panels/panel_layout_manager.h" | 21 #include "ash/common/wm/panels/panel_layout_manager.h" |
| 22 #include "ash/common/wm/switchable_windows.h" | 22 #include "ash/common/wm/switchable_windows.h" |
| 23 #include "ash/common/wm/window_state.h" | 23 #include "ash/common/wm/window_state.h" |
| 24 #include "ash/common/wm/wm_screen_util.h" | 24 #include "ash/common/wm/wm_screen_util.h" |
| 25 #include "ash/common/wm_shell.h" | 25 #include "ash/common/wm_shell.h" |
| 26 #include "ash/common/wm_window.h" | 26 #include "ash/common/wm_window.h" |
| 27 #include "ash/public/cpp/shell_window_ids.h" | 27 #include "ash/public/cpp/shell_window_ids.h" |
| 28 #include "ash/root_window_controller.h" | 28 #include "ash/root_window_controller.h" |
| 29 #include "ash/shell.h" | 29 #include "ash/shell.h" |
| 30 #include "ash/wm/window_util.h" |
| 30 #include "base/auto_reset.h" | 31 #include "base/auto_reset.h" |
| 31 #include "base/command_line.h" | 32 #include "base/command_line.h" |
| 32 #include "base/metrics/histogram_macros.h" | 33 #include "base/metrics/histogram_macros.h" |
| 33 #include "third_party/skia/include/core/SkPath.h" | 34 #include "third_party/skia/include/core/SkPath.h" |
| 34 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
| 35 #include "ui/compositor/scoped_layer_animation_settings.h" | 36 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 36 #include "ui/display/screen.h" | 37 #include "ui/display/screen.h" |
| 37 #include "ui/events/event.h" | 38 #include "ui/events/event.h" |
| 38 #include "ui/gfx/canvas.h" | 39 #include "ui/gfx/canvas.h" |
| 39 #include "ui/gfx/paint_vector_icon.h" | 40 #include "ui/gfx/paint_vector_icon.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } // namespace | 211 } // namespace |
| 211 | 212 |
| 212 // static | 213 // static |
| 213 bool WindowSelector::IsSelectable(WmWindow* window) { | 214 bool WindowSelector::IsSelectable(WmWindow* window) { |
| 214 wm::WindowState* state = window->GetWindowState(); | 215 wm::WindowState* state = window->GetWindowState(); |
| 215 return state->IsUserPositionable(); | 216 return state->IsUserPositionable(); |
| 216 } | 217 } |
| 217 | 218 |
| 218 WindowSelector::WindowSelector(WindowSelectorDelegate* delegate) | 219 WindowSelector::WindowSelector(WindowSelectorDelegate* delegate) |
| 219 : delegate_(delegate), | 220 : delegate_(delegate), |
| 220 restore_focus_window_(WmShell::Get()->GetFocusedWindow()), | 221 restore_focus_window_(WmWindow::Get(wm::GetFocusedWindow())), |
| 221 ignore_activations_(false), | 222 ignore_activations_(false), |
| 222 selected_grid_index_(0), | 223 selected_grid_index_(0), |
| 223 overview_start_time_(base::Time::Now()), | 224 overview_start_time_(base::Time::Now()), |
| 224 num_key_presses_(0), | 225 num_key_presses_(0), |
| 225 num_items_(0), | 226 num_items_(0), |
| 226 showing_text_filter_(false), | 227 showing_text_filter_(false), |
| 227 text_filter_string_length_(0), | 228 text_filter_string_length_(0), |
| 228 num_times_textfield_cleared_(0), | 229 num_times_textfield_cleared_(0), |
| 229 restoring_minimized_windows_(false), | 230 restoring_minimized_windows_(false), |
| 230 text_filter_bottom_(0) { | 231 text_filter_bottom_(0) { |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 for (size_t i = 0; i <= grid_list_.size() && | 681 for (size_t i = 0; i <= grid_list_.size() && |
| 681 grid_list_[selected_grid_index_]->Move(direction, animate); | 682 grid_list_[selected_grid_index_]->Move(direction, animate); |
| 682 i++) { | 683 i++) { |
| 683 selected_grid_index_ = | 684 selected_grid_index_ = |
| 684 (selected_grid_index_ + display_direction + grid_list_.size()) % | 685 (selected_grid_index_ + display_direction + grid_list_.size()) % |
| 685 grid_list_.size(); | 686 grid_list_.size(); |
| 686 } | 687 } |
| 687 } | 688 } |
| 688 | 689 |
| 689 } // namespace ash | 690 } // namespace ash |
| OLD | NEW |