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/wm/core/shadow_controller.h" | 5 #include "ui/wm/core/shadow_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "ui/aura/client/window_tree_client.h" | 11 #include "ui/aura/client/window_tree_client.h" |
12 #include "ui/aura/test/aura_test_base.h" | 12 #include "ui/aura/test/aura_test_base.h" |
13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
14 #include "ui/aura/window_event_dispatcher.h" | 14 #include "ui/aura/window_event_dispatcher.h" |
15 #include "ui/compositor/layer.h" | 15 #include "ui/compositor/layer.h" |
16 #include "ui/wm/core/default_activation_client.h" | |
17 #include "ui/wm/core/shadow.h" | 16 #include "ui/wm/core/shadow.h" |
18 #include "ui/wm/core/shadow_types.h" | 17 #include "ui/wm/core/shadow_types.h" |
19 #include "ui/wm/core/window_util.h" | 18 #include "ui/wm/core/window_util.h" |
20 #include "ui/wm/core/wm_state.h" | 19 #include "ui/wm/core/wm_state.h" |
21 #include "ui/wm/public/activation_client.h" | 20 #include "ui/wm/public/activation_client.h" |
22 | 21 |
23 namespace wm { | 22 namespace wm { |
24 | 23 |
25 class ShadowControllerTest : public aura::test::AuraTestBase { | 24 class ShadowControllerTest : public aura::test::AuraTestBase { |
26 public: | 25 public: |
27 ShadowControllerTest() {} | 26 ShadowControllerTest() {} |
28 virtual ~ShadowControllerTest() {} | 27 virtual ~ShadowControllerTest() {} |
29 | 28 |
30 virtual void SetUp() OVERRIDE { | 29 virtual void SetUp() OVERRIDE { |
31 wm_state_.reset(new wm::WMState); | 30 wm_state_.reset(new wm::WMState); |
32 AuraTestBase::SetUp(); | 31 AuraTestBase::SetUp(); |
33 new wm::DefaultActivationClient(root_window()); | |
34 aura::client::ActivationClient* activation_client = | 32 aura::client::ActivationClient* activation_client = |
35 aura::client::GetActivationClient(root_window()); | 33 aura::client::GetActivationClient(root_window()); |
36 shadow_controller_.reset(new ShadowController(activation_client)); | 34 shadow_controller_.reset(new ShadowController(activation_client)); |
37 } | 35 } |
38 virtual void TearDown() OVERRIDE { | 36 virtual void TearDown() OVERRIDE { |
39 shadow_controller_.reset(); | 37 shadow_controller_.reset(); |
40 AuraTestBase::TearDown(); | 38 AuraTestBase::TearDown(); |
41 wm_state_.reset(); | 39 wm_state_.reset(); |
42 } | 40 } |
43 | 41 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 AddTransientChild(window1.get(), window2.get()); | 208 AddTransientChild(window1.get(), window2.get()); |
211 aura::client::SetHideOnDeactivate(window2.get(), true); | 209 aura::client::SetHideOnDeactivate(window2.get(), true); |
212 window2->Show(); | 210 window2->Show(); |
213 ActivateWindow(window2.get()); | 211 ActivateWindow(window2.get()); |
214 | 212 |
215 // window1 is now inactive, but its shadow should still appear active. | 213 // window1 is now inactive, but its shadow should still appear active. |
216 EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow1->style()); | 214 EXPECT_EQ(Shadow::STYLE_ACTIVE, shadow1->style()); |
217 } | 215 } |
218 | 216 |
219 } // namespace wm | 217 } // namespace wm |
OLD | NEW |