| 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/phantom_window_controller.h" | 5 #include "ash/wm/common/workspace/phantom_window_controller.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include "ash/wm/common/root_window_finder.h" | 9 #include "ash/wm/common/root_window_finder.h" |
| 10 #include "ash/wm/common/wm_root_window_controller.h" | 10 #include "ash/wm/common/wm_root_window_controller.h" |
| 11 #include "ash/wm/common/wm_shell_window_ids.h" | 11 #include "ash/wm/common/wm_shell_window_ids.h" |
| 12 #include "ash/wm/common/wm_window.h" | 12 #include "ash/wm/common/wm_window.h" |
| 13 #include "grit/ash_resources.h" | 13 #include "grit/ash_resources.h" |
| 14 #include "ui/compositor/layer.h" | 14 #include "ui/compositor/layer.h" |
| 15 #include "ui/compositor/scoped_layer_animation_settings.h" | 15 #include "ui/compositor/scoped_layer_animation_settings.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 widget->SetBounds(new_bounds_in_screen); | 69 widget->SetBounds(new_bounds_in_screen); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace | 72 } // namespace |
| 73 | 73 |
| 74 // PhantomWindowController ---------------------------------------------------- | 74 // PhantomWindowController ---------------------------------------------------- |
| 75 | 75 |
| 76 PhantomWindowController::PhantomWindowController(wm::WmWindow* window) | 76 PhantomWindowController::PhantomWindowController(wm::WmWindow* window) |
| 77 : window_(window) {} | 77 : window_(window) {} |
| 78 | 78 |
| 79 PhantomWindowController::~PhantomWindowController() { | 79 PhantomWindowController::~PhantomWindowController() {} |
| 80 } | |
| 81 | 80 |
| 82 void PhantomWindowController::Show(const gfx::Rect& bounds_in_screen) { | 81 void PhantomWindowController::Show(const gfx::Rect& bounds_in_screen) { |
| 83 gfx::Rect adjusted_bounds_in_screen = GetAdjustedBounds(bounds_in_screen); | 82 gfx::Rect adjusted_bounds_in_screen = GetAdjustedBounds(bounds_in_screen); |
| 84 if (adjusted_bounds_in_screen == target_bounds_in_screen_) | 83 if (adjusted_bounds_in_screen == target_bounds_in_screen_) |
| 85 return; | 84 return; |
| 86 target_bounds_in_screen_ = adjusted_bounds_in_screen; | 85 target_bounds_in_screen_ = adjusted_bounds_in_screen; |
| 87 | 86 |
| 88 gfx::Rect start_bounds_in_screen = target_bounds_in_screen_; | 87 gfx::Rect start_bounds_in_screen = target_bounds_in_screen_; |
| 89 int start_width = std::max( | 88 int start_width = std::max( |
| 90 kMinSizeWithShadow, | 89 kMinSizeWithShadow, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 widget_layer->SetOpacity(0); | 143 widget_layer->SetOpacity(0); |
| 145 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); | 144 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); |
| 146 scoped_setter.SetTransitionDuration( | 145 scoped_setter.SetTransitionDuration( |
| 147 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); | 146 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); |
| 148 widget_layer->SetOpacity(1); | 147 widget_layer->SetOpacity(1); |
| 149 | 148 |
| 150 return phantom_widget; | 149 return phantom_widget; |
| 151 } | 150 } |
| 152 | 151 |
| 153 } // namespace ash | 152 } // namespace ash |
| OLD | NEW |