Chromium Code Reviews| 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.h" | 5 #include "ash/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 <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "ash/accessibility_delegate.h" | 12 #include "ash/accessibility_delegate.h" |
| 13 #include "ash/ash_switches.h" | 13 #include "ash/ash_switches.h" |
| 14 #include "ash/metrics/user_metrics_recorder.h" | 14 #include "ash/metrics/user_metrics_recorder.h" |
| 15 #include "ash/root_window_controller.h" | 15 #include "ash/root_window_controller.h" |
| 16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 17 #include "ash/shell_window_ids.h" | 17 #include "ash/shell_window_ids.h" |
| 18 #include "ash/switchable_windows.h" | 18 #include "ash/switchable_windows.h" |
| 19 #include "ash/wm/mru_window_tracker.h" | 19 #include "ash/wm/mru_window_tracker.h" |
| 20 #include "ash/wm/overview/window_grid.h" | 20 #include "ash/wm/overview/window_grid.h" |
| 21 #include "ash/wm/overview/window_selector_delegate.h" | 21 #include "ash/wm/overview/window_selector_delegate.h" |
| 22 #include "ash/wm/overview/window_selector_item.h" | 22 #include "ash/wm/overview/window_selector_item.h" |
| 23 #include "ash/wm/panels/panel_layout_manager.h" | 23 #include "ash/wm/panels/panel_layout_manager.h" |
| 24 #include "ash/wm/window_state.h" | 24 #include "ash/wm/window_state.h" |
| 25 #include "ash/wm/window_util.h" | |
| 25 #include "base/auto_reset.h" | 26 #include "base/auto_reset.h" |
| 26 #include "base/command_line.h" | 27 #include "base/command_line.h" |
| 27 #include "base/metrics/histogram.h" | 28 #include "base/metrics/histogram.h" |
| 28 #include "third_party/skia/include/core/SkPaint.h" | 29 #include "third_party/skia/include/core/SkPaint.h" |
| 29 #include "third_party/skia/include/core/SkPath.h" | 30 #include "third_party/skia/include/core/SkPath.h" |
| 30 #include "ui/aura/client/focus_client.h" | 31 #include "ui/aura/client/focus_client.h" |
| 31 #include "ui/aura/window.h" | 32 #include "ui/aura/window.h" |
| 32 #include "ui/aura/window_event_dispatcher.h" | 33 #include "ui/aura/window_event_dispatcher.h" |
| 33 #include "ui/aura/window_observer.h" | 34 #include "ui/aura/window_observer.h" |
| 34 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 const int WindowSelector::kTextFilterBottomEdge = | 218 const int WindowSelector::kTextFilterBottomEdge = |
| 218 kTextFilterDistanceFromTop + kTextFilterHeight; | 219 kTextFilterDistanceFromTop + kTextFilterHeight; |
| 219 | 220 |
| 220 // static | 221 // static |
| 221 bool WindowSelector::IsSelectable(aura::Window* window) { | 222 bool WindowSelector::IsSelectable(aura::Window* window) { |
| 222 wm::WindowState* state = wm::GetWindowState(window); | 223 wm::WindowState* state = wm::GetWindowState(window); |
| 223 if (state->GetStateType() == wm::WINDOW_STATE_TYPE_DOCKED || | 224 if (state->GetStateType() == wm::WINDOW_STATE_TYPE_DOCKED || |
| 224 state->GetStateType() == wm::WINDOW_STATE_TYPE_DOCKED_MINIMIZED) { | 225 state->GetStateType() == wm::WINDOW_STATE_TYPE_DOCKED_MINIMIZED) { |
| 225 return false; | 226 return false; |
| 226 } | 227 } |
| 227 return window->type() == ui::wm::WINDOW_TYPE_NORMAL || | 228 return wm::IsWindowUserPositionable(window); |
|
oshima
2015/06/04 19:49:12
ditto
bruthig
2015/06/04 19:56:23
Done.
| |
| 228 window->type() == ui::wm::WINDOW_TYPE_PANEL; | |
| 229 } | 229 } |
| 230 | 230 |
| 231 WindowSelector::WindowSelector(WindowSelectorDelegate* delegate) | 231 WindowSelector::WindowSelector(WindowSelectorDelegate* delegate) |
| 232 : delegate_(delegate), | 232 : delegate_(delegate), |
| 233 restore_focus_window_(aura::client::GetFocusClient( | 233 restore_focus_window_(aura::client::GetFocusClient( |
| 234 Shell::GetPrimaryRootWindow())->GetFocusedWindow()), | 234 Shell::GetPrimaryRootWindow())->GetFocusedWindow()), |
| 235 ignore_activations_(false), | 235 ignore_activations_(false), |
| 236 selected_grid_index_(0), | 236 selected_grid_index_(0), |
| 237 overview_start_time_(base::Time::Now()), | 237 overview_start_time_(base::Time::Now()), |
| 238 num_key_presses_(0), | 238 num_key_presses_(0), |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 615 for (size_t i = 0; | 615 for (size_t i = 0; |
| 616 i <= grid_list_.size() && | 616 i <= grid_list_.size() && |
| 617 grid_list_[selected_grid_index_]->Move(direction, animate); i++) { | 617 grid_list_[selected_grid_index_]->Move(direction, animate); i++) { |
| 618 selected_grid_index_ = | 618 selected_grid_index_ = |
| 619 (selected_grid_index_ + display_direction + grid_list_.size()) % | 619 (selected_grid_index_ + display_direction + grid_list_.size()) % |
| 620 grid_list_.size(); | 620 grid_list_.size(); |
| 621 } | 621 } |
| 622 } | 622 } |
| 623 | 623 |
| 624 } // namespace ash | 624 } // namespace ash |
| OLD | NEW |