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_controller.h" | 5 #include "ash/wm/shadow_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/shadow.h" | 10 #include "ash/wm/shadow.h" |
11 #include "ash/wm/shadow_types.h" | 11 #include "ash/wm/shadow_types.h" |
12 #include "ash/wm/window_properties.h" | 12 #include "ash/wm/window_properties.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "ui/aura/client/activation_client.h" | 15 #include "ui/aura/client/activation_client.h" |
16 #include "ui/aura/env.h" | 16 #include "ui/aura/env.h" |
17 #include "ui/aura/root_window.h" | 17 #include "ui/aura/root_window.h" |
18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
19 #include "ui/gfx/compositor/layer.h" | 19 #include "ui/compositor/layer.h" |
20 | 20 |
21 using std::make_pair; | 21 using std::make_pair; |
22 | 22 |
23 namespace ash { | 23 namespace ash { |
24 namespace internal { | 24 namespace internal { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 ShadowType GetShadowTypeFromWindow(aura::Window* window) { | 28 ShadowType GetShadowTypeFromWindow(aura::Window* window) { |
29 switch (window->type()) { | 29 switch (window->type()) { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 shadow->Init(window, | 165 shadow->Init(window, |
166 ShouldUseSmallShadowForWindow(window) ? | 166 ShouldUseSmallShadowForWindow(window) ? |
167 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE); | 167 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE); |
168 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); | 168 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); |
169 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); | 169 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); |
170 window->layer()->Add(shadow->layer()); | 170 window->layer()->Add(shadow->layer()); |
171 } | 171 } |
172 | 172 |
173 } // namespace internal | 173 } // namespace internal |
174 } // namespace ash | 174 } // namespace ash |
OLD | NEW |