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/workspace/phantom_window_controller.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/coordinate_conversion.h" | 10 #include "ash/wm/coordinate_conversion.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 const int kAnimationDurationMs = 200; | 30 const int kAnimationDurationMs = 200; |
31 | 31 |
32 // The size of the phantom window at the beginning of the show animation in | 32 // The size of the phantom window at the beginning of the show animation in |
33 // relation to the size of the phantom window at the end of the animation when | 33 // relation to the size of the phantom window at the end of the animation when |
34 // using the alternate caption button style. | 34 // using the alternate caption button style. |
35 const float kAlternateCaptionButtonStyleAnimationInitialBoundsRatio = 0.85f; | 35 const float kAlternateCaptionButtonStyleAnimationInitialBoundsRatio = 0.85f; |
36 | 36 |
37 // The amount of pixels that the phantom window's shadow should extend past | 37 // The amount of pixels that the phantom window's shadow should extend past |
38 // the bounds passed into Show(). There is no shadow when not using the | 38 // the bounds passed into Show(). There is no shadow when not using the |
39 // alternate caption button style. | 39 // alternate caption button style. |
40 const int kShadowThickness = 60; | 40 const int kShadowThickness = 15; |
41 | 41 |
42 // Converts the bounds of a phantom window without a shadow to those of a | 42 // Converts the bounds of a phantom window without a shadow to those of a |
43 // phantom window with a shadow. | 43 // phantom window with a shadow. |
44 gfx::Rect GetBoundsWithShadow(const gfx::Rect& bounds) { | 44 gfx::Rect GetBoundsWithShadow(const gfx::Rect& bounds) { |
45 gfx::Rect bounds_with_shadow(bounds); | 45 gfx::Rect bounds_with_shadow(bounds); |
46 // Phantom windows have a shadow solely when using the alternate caption | 46 // Phantom windows have a shadow solely when using the alternate caption |
47 // button style. | 47 // button style. |
48 if (switches::UseAlternateFrameCaptionButtonStyle()) | 48 if (switches::UseAlternateFrameCaptionButtonStyle()) |
49 bounds_with_shadow.Inset(-kShadowThickness, -kShadowThickness); | 49 bounds_with_shadow.Inset(-kShadowThickness, -kShadowThickness); |
50 return bounds_with_shadow; | 50 return bounds_with_shadow; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); | 253 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); |
254 scoped_setter.SetTransitionDuration( | 254 scoped_setter.SetTransitionDuration( |
255 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); | 255 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); |
256 widget_layer->SetOpacity(1); | 256 widget_layer->SetOpacity(1); |
257 | 257 |
258 return phantom_widget.Pass(); | 258 return phantom_widget.Pass(); |
259 } | 259 } |
260 | 260 |
261 } // namespace internal | 261 } // namespace internal |
262 } // namespace ash | 262 } // namespace ash |
OLD | NEW |