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 | 8 |
9 #include "ash/accessibility_delegate.h" | 9 #include "ash/accessibility_delegate.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 } // namespace | 90 } // namespace |
91 | 91 |
92 WindowSelector::WindowSelector(const WindowList& windows, | 92 WindowSelector::WindowSelector(const WindowList& windows, |
93 WindowSelectorDelegate* delegate) | 93 WindowSelectorDelegate* delegate) |
94 : delegate_(delegate), | 94 : delegate_(delegate), |
95 restore_focus_window_(aura::client::GetFocusClient( | 95 restore_focus_window_(aura::client::GetFocusClient( |
96 Shell::GetPrimaryRootWindow())->GetFocusedWindow()), | 96 Shell::GetPrimaryRootWindow())->GetFocusedWindow()), |
97 ignore_activations_(false), | 97 ignore_activations_(false), |
| 98 overview_start_time_(base::Time::Now()), |
98 selected_grid_index_(0) { | 99 selected_grid_index_(0) { |
99 DCHECK(delegate_); | 100 DCHECK(delegate_); |
100 Shell* shell = Shell::GetInstance(); | 101 Shell* shell = Shell::GetInstance(); |
101 shell->OnOverviewModeStarting(); | 102 shell->OnOverviewModeStarting(); |
102 | 103 |
103 if (restore_focus_window_) | 104 if (restore_focus_window_) |
104 restore_focus_window_->AddObserver(this); | 105 restore_focus_window_->AddObserver(this); |
105 | 106 |
106 const aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 107 const aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
107 size_t items = 0; | 108 size_t items = 0; |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 // root window, identify it and call Move() on it to initialize the | 366 // root window, identify it and call Move() on it to initialize the |
366 // selection widget. | 367 // selection widget. |
367 // TODO(nsatragno): If there are more than two monitors, move between grids | 368 // TODO(nsatragno): If there are more than two monitors, move between grids |
368 // in the requested direction. | 369 // in the requested direction. |
369 selected_grid_index_ = (selected_grid_index_ + 1) % grid_list_.size(); | 370 selected_grid_index_ = (selected_grid_index_ + 1) % grid_list_.size(); |
370 grid_list_[selected_grid_index_]->Move(direction); | 371 grid_list_[selected_grid_index_]->Move(direction); |
371 } | 372 } |
372 } | 373 } |
373 | 374 |
374 } // namespace ash | 375 } // namespace ash |
OLD | NEW |