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/resize_shadow.h" | 5 #include "ash/wm/resize_shadow.h" |
6 | 6 |
7 #include "ash/wm/image_grid.h" | 7 #include "ash/wm/image_grid.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
11 #include "ui/base/hit_test.h" | 11 #include "ui/base/hit_test.h" |
12 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
13 #include "ui/gfx/compositor/layer.h" | 13 #include "ui/compositor/layer.h" |
14 #include "ui/gfx/compositor/scoped_layer_animation_settings.h" | 14 #include "ui/compositor/scoped_layer_animation_settings.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // Final opacity for resize effect. | 18 // Final opacity for resize effect. |
19 const float kShadowTargetOpacity = 0.25f; | 19 const float kShadowTargetOpacity = 0.25f; |
20 // Animation time for resize effect in milliseconds. | 20 // Animation time for resize effect in milliseconds. |
21 const int kShadowAnimationDurationMs = 200; | 21 const int kShadowAnimationDurationMs = 200; |
22 | 22 |
23 // Sets up a layer as invisible and fully transparent, without animating. | 23 // Sets up a layer as invisible and fully transparent, without animating. |
24 void InitLayer(ui::Layer* layer) { | 24 void InitLayer(ui::Layer* layer) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 ShowForHitTest(HTNOWHERE); | 101 ShowForHitTest(HTNOWHERE); |
102 } | 102 } |
103 | 103 |
104 void ResizeShadow::Layout(const gfx::Rect& content_bounds) { | 104 void ResizeShadow::Layout(const gfx::Rect& content_bounds) { |
105 gfx::Rect local_bounds(content_bounds.size()); | 105 gfx::Rect local_bounds(content_bounds.size()); |
106 image_grid_->SetContentBounds(local_bounds); | 106 image_grid_->SetContentBounds(local_bounds); |
107 } | 107 } |
108 | 108 |
109 } // namespace internal | 109 } // namespace internal |
110 } // namespace ash | 110 } // namespace ash |
OLD | NEW |