| 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/toplevel_window_event_handler.h" | 5 #include "ash/wm/toplevel_window_event_handler.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 // A simple window delegate that returns the specified hit-test code when | 43 // A simple window delegate that returns the specified hit-test code when |
| 44 // requested and applies a minimum size constraint if there is one. | 44 // requested and applies a minimum size constraint if there is one. |
| 45 class TestWindowDelegate : public aura::test::TestWindowDelegate { | 45 class TestWindowDelegate : public aura::test::TestWindowDelegate { |
| 46 public: | 46 public: |
| 47 explicit TestWindowDelegate(int hittest_code) { | 47 explicit TestWindowDelegate(int hittest_code) { |
| 48 set_window_component(hittest_code); | 48 set_window_component(hittest_code); |
| 49 } | 49 } |
| 50 virtual ~TestWindowDelegate() {} | 50 ~TestWindowDelegate() override {} |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 // Overridden from aura::Test::TestWindowDelegate: | 53 // Overridden from aura::Test::TestWindowDelegate: |
| 54 virtual void OnWindowDestroyed(aura::Window* window) override { | 54 void OnWindowDestroyed(aura::Window* window) override { delete this; } |
| 55 delete this; | |
| 56 } | |
| 57 | 55 |
| 58 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); | 56 DISALLOW_COPY_AND_ASSIGN(TestWindowDelegate); |
| 59 }; | 57 }; |
| 60 | 58 |
| 61 class ToplevelWindowEventHandlerTest : public AshTestBase { | 59 class ToplevelWindowEventHandlerTest : public AshTestBase { |
| 62 public: | 60 public: |
| 63 ToplevelWindowEventHandlerTest() {} | 61 ToplevelWindowEventHandlerTest() {} |
| 64 virtual ~ToplevelWindowEventHandlerTest() {} | 62 ~ToplevelWindowEventHandlerTest() override {} |
| 65 | 63 |
| 66 protected: | 64 protected: |
| 67 aura::Window* CreateWindow(int hittest_code) { | 65 aura::Window* CreateWindow(int hittest_code) { |
| 68 TestWindowDelegate* d1 = new TestWindowDelegate(hittest_code); | 66 TestWindowDelegate* d1 = new TestWindowDelegate(hittest_code); |
| 69 aura::Window* w1 = new aura::Window(d1); | 67 aura::Window* w1 = new aura::Window(d1); |
| 70 w1->SetType(ui::wm::WINDOW_TYPE_NORMAL); | 68 w1->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
| 71 w1->set_id(1); | 69 w1->set_id(1); |
| 72 w1->Init(aura::WINDOW_LAYER_TEXTURED); | 70 w1->Init(aura::WINDOW_LAYER_TEXTURED); |
| 73 aura::Window* parent = Shell::GetContainer( | 71 aura::Window* parent = Shell::GetContainer( |
| 74 Shell::GetPrimaryRootWindow(), kShellWindowId_AlwaysOnTopContainer); | 72 Shell::GetPrimaryRootWindow(), kShellWindowId_AlwaysOnTopContainer); |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 EXPECT_EQ(aura::client::MOVE_SUCCESSFUL, | 723 EXPECT_EQ(aura::client::MOVE_SUCCESSFUL, |
| 726 move_client->RunMoveLoop(window.get(), gfx::Vector2d(), | 724 move_client->RunMoveLoop(window.get(), gfx::Vector2d(), |
| 727 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); | 725 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); |
| 728 } | 726 } |
| 729 | 727 |
| 730 // Showing the resize shadows when the mouse is over the window edges is tested | 728 // Showing the resize shadows when the mouse is over the window edges is tested |
| 731 // in resize_shadow_and_cursor_test.cc | 729 // in resize_shadow_and_cursor_test.cc |
| 732 | 730 |
| 733 } // namespace test | 731 } // namespace test |
| 734 } // namespace ash | 732 } // namespace ash |
| OLD | NEW |