| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/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/root_window.h" | 15 #include "ui/aura/root_window.h" |
| 16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 17 | 17 |
| 18 using std::make_pair; | 18 using std::make_pair; |
| 19 | 19 |
| 20 namespace ash { | 20 namespace ash { |
| 21 namespace internal { | 21 namespace internal { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 ShadowType GetShadowTypeFromWindowType(aura::Window* window) { | 25 ShadowType GetShadowTypeFromWindowType(aura::Window* window) { |
| 26 switch (window->type()) { | 26 switch (window->type()) { |
| 27 case aura::client::WINDOW_TYPE_NORMAL: | 27 case aura::client::WINDOW_TYPE_NORMAL: |
| 28 case aura::client::WINDOW_TYPE_PANEL: |
| 28 return CommandLine::ForCurrentProcess()->HasSwitch( | 29 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 29 switches::kAuraTranslucentFrames) ? | 30 switches::kAuraTranslucentFrames) ? |
| 30 SHADOW_TYPE_NONE : SHADOW_TYPE_RECTANGULAR; | 31 SHADOW_TYPE_NONE : SHADOW_TYPE_RECTANGULAR; |
| 31 case aura::client::WINDOW_TYPE_MENU: | 32 case aura::client::WINDOW_TYPE_MENU: |
| 32 case aura::client::WINDOW_TYPE_TOOLTIP: | 33 case aura::client::WINDOW_TYPE_TOOLTIP: |
| 33 return SHADOW_TYPE_RECTANGULAR; | 34 return SHADOW_TYPE_RECTANGULAR; |
| 34 default: | 35 default: |
| 35 break; | 36 break; |
| 36 } | 37 } |
| 37 return SHADOW_TYPE_NONE; | 38 return SHADOW_TYPE_NONE; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 window_shadows_.insert(make_pair(window, shadow)); | 109 window_shadows_.insert(make_pair(window, shadow)); |
| 109 | 110 |
| 110 shadow->Init(); | 111 shadow->Init(); |
| 111 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); | 112 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); |
| 112 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); | 113 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); |
| 113 window->layer()->Add(shadow->layer()); | 114 window->layer()->Add(shadow->layer()); |
| 114 } | 115 } |
| 115 | 116 |
| 116 } // namespace internal | 117 } // namespace internal |
| 117 } // namespace ash | 118 } // namespace ash |
| OLD | NEW |