Chromium Code Reviews| Index: ui/wm/core/shadow.cc |
| diff --git a/ui/wm/core/shadow.cc b/ui/wm/core/shadow.cc |
| index 4b621225844350015c2aa58d4dfbfb0dcd1a7414..8e42a6283757fb009fc42857819970792320807a 100644 |
| --- a/ui/wm/core/shadow.cc |
| +++ b/ui/wm/core/shadow.cc |
| @@ -12,10 +12,9 @@ |
| namespace { |
| -// Shadow opacity for different styles. |
| +// The target opacity of shadow animation for different styles. |
| const float kActiveShadowOpacity = 1.0f; |
|
James Cook
2014/12/11 22:34:04
I would just delete this constant and inline the u
oshima
2014/12/12 21:23:45
Done.
|
| const float kInactiveShadowOpacity = 0.2f; |
| -const float kSmallShadowOpacity = 1.0f; |
| // Shadow aperture for different styles. |
| // Note that this may be greater than interior inset to allow shadows with |
| @@ -32,18 +31,6 @@ const int kSmallInteriorInset = 4; |
| // Duration for opacity animation in milliseconds. |
| const int kShadowAnimationDurationMs = 100; |
| -float GetOpacityForStyle(wm::Shadow::Style style) { |
| - switch (style) { |
| - case wm::Shadow::STYLE_ACTIVE: |
| - return kActiveShadowOpacity; |
| - case wm::Shadow::STYLE_INACTIVE: |
| - return kInactiveShadowOpacity; |
| - case wm::Shadow::STYLE_SMALL: |
| - return kSmallShadowOpacity; |
| - } |
| - return 1.0f; |
| -} |
| - |
| int GetShadowApertureForStyle(wm::Shadow::Style style) { |
| switch (style) { |
| case wm::Shadow::STYLE_ACTIVE: |
| @@ -89,7 +76,7 @@ void Shadow::Init(Style style) { |
| shadow_layer_->set_name("Shadow"); |
| shadow_layer_->SetVisible(true); |
| shadow_layer_->SetFillsBoundsOpaquely(false); |
| - shadow_layer_->SetOpacity(GetOpacityForStyle(style_)); |
| + shadow_layer_->SetOpacity(1.0f); |
|
oshima
2014/12/12 21:23:45
I removed this because 1.0f is default.
|
| } |
| void Shadow::SetContentBounds(const gfx::Rect& content_bounds) { |
| @@ -111,7 +98,7 @@ void Shadow::SetStyle(Style style) { |
| // animations. |
| if (style == STYLE_SMALL || old_style == STYLE_SMALL) { |
| UpdateImagesForStyle(); |
| - shadow_layer_->SetOpacity(GetOpacityForStyle(style)); |
| + shadow_layer_->SetOpacity(1.0f); |
| return; |
| } |