| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_grid.h" | 5 #include "ash/wm/overview/window_grid.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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 selection_widget_->SetContentsView(content_view); | 440 selection_widget_->SetContentsView(content_view); |
| 441 selection_widget_->GetNativeWindow()->parent()->StackChildAtBottom( | 441 selection_widget_->GetNativeWindow()->parent()->StackChildAtBottom( |
| 442 selection_widget_->GetNativeWindow()); | 442 selection_widget_->GetNativeWindow()); |
| 443 selection_widget_->Show(); | 443 selection_widget_->Show(); |
| 444 // New selection widget starts with 0 opacity and then fades in. | 444 // New selection widget starts with 0 opacity and then fades in. |
| 445 selection_widget_->GetNativeWindow()->layer()->SetOpacity(0); | 445 selection_widget_->GetNativeWindow()->layer()->SetOpacity(0); |
| 446 | 446 |
| 447 const gfx::Rect target_bounds = SelectedWindow()->target_bounds(); | 447 const gfx::Rect target_bounds = SelectedWindow()->target_bounds(); |
| 448 gfx::Vector2d fade_out_direction = | 448 gfx::Vector2d fade_out_direction = |
| 449 GetSlideVectorForFadeIn(direction, target_bounds); | 449 GetSlideVectorForFadeIn(direction, target_bounds); |
| 450 gfx::Display dst_display = gfx::Screen::GetScreenFor(root_window_)-> | 450 gfx::Display dst_display = |
| 451 GetDisplayMatching(target_bounds); | 451 gfx::Screen::GetScreen()->GetDisplayMatching(target_bounds); |
| 452 selection_widget_->GetNativeWindow()->SetBoundsInScreen( | 452 selection_widget_->GetNativeWindow()->SetBoundsInScreen( |
| 453 target_bounds - fade_out_direction, dst_display); | 453 target_bounds - fade_out_direction, dst_display); |
| 454 } | 454 } |
| 455 | 455 |
| 456 void WindowGrid::MoveSelectionWidget(WindowSelector::Direction direction, | 456 void WindowGrid::MoveSelectionWidget(WindowSelector::Direction direction, |
| 457 bool recreate_selection_widget, | 457 bool recreate_selection_widget, |
| 458 bool out_of_bounds, | 458 bool out_of_bounds, |
| 459 bool animate) { | 459 bool animate) { |
| 460 // If the selection widget is already active, fade it out in the selection | 460 // If the selection widget is already active, fade it out in the selection |
| 461 // direction. | 461 // direction. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 507 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
| 508 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); | 508 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); |
| 509 selection_widget_->SetOpacity(255); | 509 selection_widget_->SetOpacity(255); |
| 510 return; | 510 return; |
| 511 } | 511 } |
| 512 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); | 512 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); |
| 513 selection_widget_->SetOpacity(255); | 513 selection_widget_->SetOpacity(255); |
| 514 } | 514 } |
| 515 | 515 |
| 516 } // namespace ash | 516 } // namespace ash |
| OLD | NEW |