| 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/shadow.h" | 5 #include "ash/wm/shadow.h" |
| 6 | 6 |
| 7 #include "ash/wm/image_grid.h" | 7 #include "ash/wm/image_grid.h" |
| 8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
| 9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
| 10 #include "ui/gfx/compositor/scoped_layer_animation_settings.h" | 10 #include "ui/gfx/compositor/scoped_layer_animation_settings.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace ash { | 38 namespace ash { |
| 39 namespace internal { | 39 namespace internal { |
| 40 | 40 |
| 41 Shadow::Shadow() : style_(STYLE_ACTIVE) { | 41 Shadow::Shadow() : style_(STYLE_ACTIVE) { |
| 42 } | 42 } |
| 43 | 43 |
| 44 Shadow::~Shadow() { | 44 Shadow::~Shadow() { |
| 45 } | 45 } |
| 46 | 46 |
| 47 void Shadow::Init(aura::Window* window, Style style) { | 47 void Shadow::Init(Style style) { |
| 48 style_ = style; | 48 style_ = style; |
| 49 image_grid_.reset(new ImageGrid(window)); | 49 image_grid_.reset(new ImageGrid); |
| 50 UpdateImagesForStyle(); | 50 UpdateImagesForStyle(); |
| 51 image_grid_->layer()->set_name("Shadow"); | 51 image_grid_->layer()->set_name("Shadow"); |
| 52 image_grid_->layer()->SetOpacity(GetOpacityForStyle(style_)); | 52 image_grid_->layer()->SetOpacity(GetOpacityForStyle(style_)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void Shadow::SetContentBounds(const gfx::Rect& content_bounds) { | 55 void Shadow::SetContentBounds(const gfx::Rect& content_bounds) { |
| 56 content_bounds_ = content_bounds; | 56 content_bounds_ = content_bounds; |
| 57 UpdateImageGridBounds(); | 57 UpdateImageGridBounds(); |
| 58 } | 58 } |
| 59 | 59 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 UpdateImageGridBounds(); | 166 UpdateImageGridBounds(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void Shadow::UpdateImageGridBounds() { | 169 void Shadow::UpdateImageGridBounds() { |
| 170 // Update bounds based on content bounds and image sizes. | 170 // Update bounds based on content bounds and image sizes. |
| 171 image_grid_->SetContentBounds(content_bounds_); | 171 image_grid_->SetContentBounds(content_bounds_); |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace internal | 174 } // namespace internal |
| 175 } // namespace ash | 175 } // namespace ash |
| OLD | NEW |