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 "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "grit/ash_resources.h" | 8 #include "grit/ash_resources.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 base::TimeDelta::FromMilliseconds(kShadowAnimationDurationMs)); | 33 base::TimeDelta::FromMilliseconds(kShadowAnimationDurationMs)); |
34 layer->SetOpacity(visible ? kShadowTargetOpacity : 0.f); | 34 layer->SetOpacity(visible ? kShadowTargetOpacity : 0.f); |
35 // Sets the layer visibility after a delay, which will be identical to the | 35 // Sets the layer visibility after a delay, which will be identical to the |
36 // opacity animation duration. | 36 // opacity animation duration. |
37 layer->SetVisible(visible); | 37 layer->SetVisible(visible); |
38 } | 38 } |
39 | 39 |
40 } // namespace | 40 } // namespace |
41 | 41 |
42 namespace ash { | 42 namespace ash { |
43 namespace internal { | |
44 | 43 |
45 ResizeShadow::ResizeShadow() : last_hit_test_(HTNOWHERE) {} | 44 ResizeShadow::ResizeShadow() : last_hit_test_(HTNOWHERE) {} |
46 | 45 |
47 ResizeShadow::~ResizeShadow() {} | 46 ResizeShadow::~ResizeShadow() {} |
48 | 47 |
49 void ResizeShadow::Init(aura::Window* window) { | 48 void ResizeShadow::Init(aura::Window* window) { |
50 // Set up our image grid and images. | 49 // Set up our image grid and images. |
51 ResourceBundle& res = ResourceBundle::GetSharedInstance(); | 50 ResourceBundle& res = ResourceBundle::GetSharedInstance(); |
52 image_grid_.reset(new ::wm::ImageGrid); | 51 image_grid_.reset(new ::wm::ImageGrid); |
53 image_grid_->SetImages( | 52 image_grid_->SetImages( |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 98 |
100 void ResizeShadow::Hide() { | 99 void ResizeShadow::Hide() { |
101 ShowForHitTest(HTNOWHERE); | 100 ShowForHitTest(HTNOWHERE); |
102 } | 101 } |
103 | 102 |
104 void ResizeShadow::Layout(const gfx::Rect& content_bounds) { | 103 void ResizeShadow::Layout(const gfx::Rect& content_bounds) { |
105 gfx::Rect local_bounds(content_bounds.size()); | 104 gfx::Rect local_bounds(content_bounds.size()); |
106 image_grid_->SetContentBounds(local_bounds); | 105 image_grid_->SetContentBounds(local_bounds); |
107 } | 106 } |
108 | 107 |
109 } // namespace internal | |
110 } // namespace ash | 108 } // namespace ash |
OLD | NEW |