| 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/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/wm/shadow.h" | 11 #include "ash/wm/shadow.h" |
| 12 #include "ash/wm/shadow_types.h" | 12 #include "ash/wm/shadow_types.h" |
| 13 #include "ash/wm/window_properties.h" | 13 #include "ash/wm/window_properties.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "ui/aura/client/activation_client.h" | 16 #include "ui/aura/client/activation_client.h" |
| 17 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
| 18 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
| 19 #include "ui/aura/window.h" | 19 #include "ui/aura/window.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 // No shadow for transparent window. | |
| 30 if (window->transparent()) | |
| 31 return SHADOW_TYPE_NONE; | |
| 32 | |
| 33 switch (window->type()) { | 29 switch (window->type()) { |
| 34 case aura::client::WINDOW_TYPE_NORMAL: | 30 case aura::client::WINDOW_TYPE_NORMAL: |
| 35 case aura::client::WINDOW_TYPE_PANEL: | 31 case aura::client::WINDOW_TYPE_PANEL: |
| 36 case aura::client::WINDOW_TYPE_MENU: | 32 case aura::client::WINDOW_TYPE_MENU: |
| 37 case aura::client::WINDOW_TYPE_TOOLTIP: | 33 case aura::client::WINDOW_TYPE_TOOLTIP: |
| 38 return SHADOW_TYPE_RECTANGULAR; | 34 return SHADOW_TYPE_RECTANGULAR; |
| 39 default: | 35 default: |
| 40 break; | 36 break; |
| 41 } | 37 } |
| 42 return SHADOW_TYPE_NONE; | 38 return SHADOW_TYPE_NONE; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 143 |
| 148 shadow->Init(ShouldUseSmallShadowForWindow(window) ? | 144 shadow->Init(ShouldUseSmallShadowForWindow(window) ? |
| 149 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE); | 145 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE); |
| 150 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); | 146 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); |
| 151 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); | 147 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); |
| 152 window->layer()->Add(shadow->layer()); | 148 window->layer()->Add(shadow->layer()); |
| 153 } | 149 } |
| 154 | 150 |
| 155 } // namespace internal | 151 } // namespace internal |
| 156 } // namespace ash | 152 } // namespace ash |
| OLD | NEW |