| 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" | 16 #include "ui/wm/core/default_activation_client.h" |
| 17 #include "ui/wm/core/shadow.h" | 17 #include "ui/wm/core/shadow.h" |
| 18 #include "ui/wm/core/shadow_types.h" | 18 #include "ui/wm/core/shadow_types.h" |
| 19 #include "ui/wm/core/window_util.h" | 19 #include "ui/wm/core/window_util.h" |
| 20 #include "ui/wm/core/wm_state.h" | 20 #include "ui/wm/core/wm_state.h" |
| 21 #include "ui/wm/public/activation_client.h" | 21 #include "ui/wm/public/activation_client.h" |
| 22 | 22 |
| 23 namespace wm { | 23 namespace wm { |
| 24 | 24 |
| 25 class ShadowControllerTest : public aura::test::AuraTestBase { | 25 class ShadowControllerTest : public aura::test::AuraTestBase { |
| 26 public: | 26 public: |
| 27 ShadowControllerTest() {} | 27 ShadowControllerTest() {} |
| 28 virtual ~ShadowControllerTest() {} | 28 virtual ~ShadowControllerTest() {} |
| 29 | 29 |
| 30 virtual void SetUp() OVERRIDE { | 30 virtual void SetUp() override { |
| 31 wm_state_.reset(new wm::WMState); | 31 wm_state_.reset(new wm::WMState); |
| 32 AuraTestBase::SetUp(); | 32 AuraTestBase::SetUp(); |
| 33 new wm::DefaultActivationClient(root_window()); | 33 new wm::DefaultActivationClient(root_window()); |
| 34 aura::client::ActivationClient* activation_client = | 34 aura::client::ActivationClient* activation_client = |
| 35 aura::client::GetActivationClient(root_window()); | 35 aura::client::GetActivationClient(root_window()); |
| 36 shadow_controller_.reset(new ShadowController(activation_client)); | 36 shadow_controller_.reset(new ShadowController(activation_client)); |
| 37 } | 37 } |
| 38 virtual void TearDown() OVERRIDE { | 38 virtual void TearDown() override { |
| 39 shadow_controller_.reset(); | 39 shadow_controller_.reset(); |
| 40 AuraTestBase::TearDown(); | 40 AuraTestBase::TearDown(); |
| 41 wm_state_.reset(); | 41 wm_state_.reset(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 ShadowController* shadow_controller() { return shadow_controller_.get(); } | 45 ShadowController* shadow_controller() { return shadow_controller_.get(); } |
| 46 | 46 |
| 47 void ActivateWindow(aura::Window* window) { | 47 void ActivateWindow(aura::Window* window) { |
| 48 DCHECK(window); | 48 DCHECK(window); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 // gets the inactive shadow. | 264 // gets the inactive shadow. |
| 265 SetShadowType(window1.get(), SHADOW_TYPE_RECTANGULAR); | 265 SetShadowType(window1.get(), SHADOW_TYPE_RECTANGULAR); |
| 266 SetShadowType(window2.get(), SHADOW_TYPE_RECTANGULAR); | 266 SetShadowType(window2.get(), SHADOW_TYPE_RECTANGULAR); |
| 267 EXPECT_EQ(Shadow::STYLE_ACTIVE, | 267 EXPECT_EQ(Shadow::STYLE_ACTIVE, |
| 268 api.GetShadowForWindow(window1.get())->style()); | 268 api.GetShadowForWindow(window1.get())->style()); |
| 269 EXPECT_EQ(Shadow::STYLE_INACTIVE, | 269 EXPECT_EQ(Shadow::STYLE_INACTIVE, |
| 270 api.GetShadowForWindow(window2.get())->style()); | 270 api.GetShadowForWindow(window2.get())->style()); |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace wm | 273 } // namespace wm |
| OLD | NEW |