| 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 <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 12 #include "ash/wm/coordinate_conversion.h" | 12 #include "ash/wm/coordinate_conversion.h" |
| 13 #include "grit/ash_resources.h" | 13 #include "grit/ash_resources.h" |
| 14 #include "third_party/skia/include/core/SkCanvas.h" | 14 #include "third_party/skia/include/core/SkCanvas.h" |
| 15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 16 #include "ui/aura/window_event_dispatcher.h" | 16 #include "ui/aura/window_event_dispatcher.h" |
| 17 #include "ui/compositor/layer.h" | 17 #include "ui/compositor/layer.h" |
| 18 #include "ui/compositor/scoped_layer_animation_settings.h" | 18 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 19 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
| 20 #include "ui/gfx/skia_util.h" | 20 #include "ui/gfx/skia_util.h" |
| 21 #include "ui/views/background.h" | 21 #include "ui/views/background.h" |
| 22 #include "ui/views/painter.h" | 22 #include "ui/views/painter.h" |
| 23 #include "ui/views/view.h" | 23 #include "ui/views/view.h" |
| 24 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
| 25 | 25 |
| 26 namespace ash { | 26 namespace ash { |
| 27 namespace internal { | |
| 28 | |
| 29 namespace { | 27 namespace { |
| 30 | 28 |
| 31 // The duration of the show animation. | 29 // The duration of the show animation. |
| 32 const int kAnimationDurationMs = 200; | 30 const int kAnimationDurationMs = 200; |
| 33 | 31 |
| 34 // 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 |
| 35 // 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 |
| 36 // using the alternate caption button style. | 34 // using the alternate caption button style. |
| 37 const float kAlternateStyleStartBoundsRatio = 0.85f; | 35 const float kAlternateStyleStartBoundsRatio = 0.85f; |
| 38 | 36 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 ui::Layer* widget_layer = phantom_widget->GetNativeWindow()->layer(); | 280 ui::Layer* widget_layer = phantom_widget->GetNativeWindow()->layer(); |
| 283 widget_layer->SetOpacity(0); | 281 widget_layer->SetOpacity(0); |
| 284 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); | 282 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); |
| 285 scoped_setter.SetTransitionDuration( | 283 scoped_setter.SetTransitionDuration( |
| 286 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); | 284 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); |
| 287 widget_layer->SetOpacity(1); | 285 widget_layer->SetOpacity(1); |
| 288 | 286 |
| 289 return phantom_widget.Pass(); | 287 return phantom_widget.Pass(); |
| 290 } | 288 } |
| 291 | 289 |
| 292 } // namespace internal | |
| 293 } // namespace ash | 290 } // namespace ash |
| OLD | NEW |