| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/workspace/workspace_window_resizer.h" | 5 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 !ShouldAllowMouseWarp()) { | 681 !ShouldAllowMouseWarp()) { |
| 682 return; | 682 return; |
| 683 } | 683 } |
| 684 | 684 |
| 685 // It's available. Show a phantom window on the display if needed. | 685 // It's available. Show a phantom window on the display if needed. |
| 686 aura::RootWindow* another_root = | 686 aura::RootWindow* another_root = |
| 687 GetAnotherRootWindow(window()->GetRootWindow()); | 687 GetAnotherRootWindow(window()->GetRootWindow()); |
| 688 const gfx::Rect root_bounds_in_screen(another_root->GetBoundsInScreen()); | 688 const gfx::Rect root_bounds_in_screen(another_root->GetBoundsInScreen()); |
| 689 const gfx::Rect bounds_in_screen = | 689 const gfx::Rect bounds_in_screen = |
| 690 ScreenAsh::ConvertRectToScreen(window()->parent(), bounds); | 690 ScreenAsh::ConvertRectToScreen(window()->parent(), bounds); |
| 691 gfx::Rect bounds_in_another_root = root_bounds_in_screen; | 691 gfx::Rect bounds_in_another_root = |
| 692 bounds_in_another_root.Intersect(bounds_in_screen); | 692 gfx::Intersection(root_bounds_in_screen, bounds_in_screen); |
| 693 | 693 |
| 694 const float fraction_in_another_window = | 694 const float fraction_in_another_window = |
| 695 (bounds_in_another_root.width() * bounds_in_another_root.height()) / | 695 (bounds_in_another_root.width() * bounds_in_another_root.height()) / |
| 696 static_cast<float>(bounds.width() * bounds.height()); | 696 static_cast<float>(bounds.width() * bounds.height()); |
| 697 const float phantom_opacity = | 697 const float phantom_opacity = |
| 698 !in_original_root ? 1 : (kMaxOpacity * fraction_in_another_window); | 698 !in_original_root ? 1 : (kMaxOpacity * fraction_in_another_window); |
| 699 const float window_opacity = | 699 const float window_opacity = |
| 700 in_original_root ? 1 : (kMaxOpacity * (1 - fraction_in_another_window)); | 700 in_original_root ? 1 : (kMaxOpacity * (1 - fraction_in_another_window)); |
| 701 | 701 |
| 702 if (fraction_in_another_window > 0) { | 702 if (fraction_in_another_window > 0) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 gfx::Rect layer_bounds = layer_->bounds(); | 809 gfx::Rect layer_bounds = layer_->bounds(); |
| 810 layer_bounds.set_origin(gfx::Point(0, 0)); | 810 layer_bounds.set_origin(gfx::Point(0, 0)); |
| 811 layer_->SetBounds(layer_bounds); | 811 layer_->SetBounds(layer_bounds); |
| 812 layer_->SetVisible(false); | 812 layer_->SetVisible(false); |
| 813 // Detach it from the current container. | 813 // Detach it from the current container. |
| 814 layer_->parent()->Remove(layer_); | 814 layer_->parent()->Remove(layer_); |
| 815 } | 815 } |
| 816 | 816 |
| 817 } // namespace internal | 817 } // namespace internal |
| 818 } // namespace ash | 818 } // namespace ash |
| OLD | NEW |