| 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> |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 | 532 |
| 533 void WindowSelector::OnDisplayAdded(const display::Display& display) {} | 533 void WindowSelector::OnDisplayAdded(const display::Display& display) {} |
| 534 | 534 |
| 535 void WindowSelector::OnDisplayRemoved(const display::Display& display) { | 535 void WindowSelector::OnDisplayRemoved(const display::Display& display) { |
| 536 // TODO(flackr): Keep window selection active on remaining displays. | 536 // TODO(flackr): Keep window selection active on remaining displays. |
| 537 CancelSelection(); | 537 CancelSelection(); |
| 538 } | 538 } |
| 539 | 539 |
| 540 void WindowSelector::OnDisplayMetricsChanged(const display::Display& display, | 540 void WindowSelector::OnDisplayMetricsChanged(const display::Display& display, |
| 541 uint32_t metrics) { | 541 uint32_t metrics) { |
| 542 PositionWindows(/* animate */ false); | 542 // If only the work area changes, there is no need to reposition windows in |
| 543 RepositionTextFilterOnDisplayMetricsChange(); | 543 // overview. |
| 544 if (metrics != DISPLAY_METRIC_WORK_AREA) { |
| 545 PositionWindows(/* animate */ false); |
| 546 RepositionTextFilterOnDisplayMetricsChange(); |
| 547 } |
| 544 } | 548 } |
| 545 | 549 |
| 546 void WindowSelector::OnWindowTreeChanged(WmWindow* window, | 550 void WindowSelector::OnWindowTreeChanged(WmWindow* window, |
| 547 const TreeChangeParams& params) { | 551 const TreeChangeParams& params) { |
| 548 // Only care about newly added children of |observed_windows_|. | 552 // Only care about newly added children of |observed_windows_|. |
| 549 if (!observed_windows_.count(window) || | 553 if (!observed_windows_.count(window) || |
| 550 !observed_windows_.count(params.new_parent)) { | 554 !observed_windows_.count(params.new_parent)) { |
| 551 return; | 555 return; |
| 552 } | 556 } |
| 553 | 557 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 for (size_t i = 0; i <= grid_list_.size() && | 699 for (size_t i = 0; i <= grid_list_.size() && |
| 696 grid_list_[selected_grid_index_]->Move(direction, animate); | 700 grid_list_[selected_grid_index_]->Move(direction, animate); |
| 697 i++) { | 701 i++) { |
| 698 selected_grid_index_ = | 702 selected_grid_index_ = |
| 699 (selected_grid_index_ + display_direction + grid_list_.size()) % | 703 (selected_grid_index_ + display_direction + grid_list_.size()) % |
| 700 grid_list_.size(); | 704 grid_list_.size(); |
| 701 } | 705 } |
| 702 } | 706 } |
| 703 | 707 |
| 704 } // namespace ash | 708 } // namespace ash |
| OLD | NEW |