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 "ui/views/corewm/shadow_controller.h" | 5 #include "ui/views/corewm/shadow_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 gaining_active); | 60 gaining_active); |
61 if (it != losing_active->transient_children().end()) | 61 if (it != losing_active->transient_children().end()) |
62 return Shadow::STYLE_ACTIVE; | 62 return Shadow::STYLE_ACTIVE; |
63 } | 63 } |
64 return Shadow::STYLE_INACTIVE; | 64 return Shadow::STYLE_INACTIVE; |
65 } | 65 } |
66 | 66 |
67 } // namespace | 67 } // namespace |
68 | 68 |
69 ShadowController::ShadowController(aura::RootWindow* root_window) | 69 ShadowController::ShadowController(aura::RootWindow* root_window) |
70 : ALLOW_THIS_IN_INITIALIZER_LIST(observer_manager_(this)), | 70 : ActivationChangeShim(root_window), |
| 71 ALLOW_THIS_IN_INITIALIZER_LIST(observer_manager_(this)), |
71 root_window_(root_window) { | 72 root_window_(root_window) { |
72 aura::Env::GetInstance()->AddObserver(this); | 73 aura::Env::GetInstance()->AddObserver(this); |
73 // Watch for window activation changes. | 74 // Watch for window activation changes. |
74 aura::client::GetActivationClient(root_window_)->AddObserver(this); | 75 aura::client::GetActivationClient(root_window_)->AddObserver(this); |
75 } | 76 } |
76 | 77 |
77 ShadowController::~ShadowController() { | 78 ShadowController::~ShadowController() { |
78 aura::client::GetActivationClient(root_window_)->RemoveObserver(this); | 79 aura::client::GetActivationClient(root_window_)->RemoveObserver(this); |
79 aura::Env::GetInstance()->RemoveObserver(this); | 80 aura::Env::GetInstance()->RemoveObserver(this); |
80 } | 81 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 158 |
158 shadow->Init(ShouldUseSmallShadowForWindow(window) ? | 159 shadow->Init(ShouldUseSmallShadowForWindow(window) ? |
159 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE); | 160 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE); |
160 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); | 161 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); |
161 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); | 162 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); |
162 window->layer()->Add(shadow->layer()); | 163 window->layer()->Add(shadow->layer()); |
163 } | 164 } |
164 | 165 |
165 } // namespace corewm | 166 } // namespace corewm |
166 } // namespace views | 167 } // namespace views |
OLD | NEW |