| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ash_constants.h" | 5 #include "ash/ash_constants.h" |
| 6 #include "ash/frame/custom_frame_view_ash.h" | 6 #include "ash/frame/custom_frame_view_ash.h" |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ash/test/cursor_manager_test_api.h" | 9 #include "ash/test/cursor_manager_test_api.h" |
| 10 #include "ash/wm/resize_shadow.h" | 10 #include "ash/wm/resize_shadow.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // handles and the resize shadows are shown when the mouse is | 67 // handles and the resize shadows are shown when the mouse is |
| 68 // ash::kResizeInsideBoundsSize inside of |window_|'s edges. | 68 // ash::kResizeInsideBoundsSize inside of |window_|'s edges. |
| 69 aura::Window* child = CreateTestWindowInShell( | 69 aura::Window* child = CreateTestWindowInShell( |
| 70 SK_ColorWHITE, 0, gfx::Rect(0, 10, 200, 90)); | 70 SK_ColorWHITE, 0, gfx::Rect(0, 10, 200, 90)); |
| 71 window_->AddChild(child); | 71 window_->AddChild(child); |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Returns the hit test code if there is a resize shadow. Returns HTNOWHERE if | 74 // Returns the hit test code if there is a resize shadow. Returns HTNOWHERE if |
| 75 // there is no resize shadow. | 75 // there is no resize shadow. |
| 76 int ResizeShadowHitTest() const { | 76 int ResizeShadowHitTest() const { |
| 77 ash::internal::ResizeShadow* resize_shadow = | 77 ash::ResizeShadow* resize_shadow = ash::Shell::GetInstance() |
| 78 ash::Shell::GetInstance()->resize_shadow_controller()-> | 78 ->resize_shadow_controller() |
| 79 GetShadowForWindowForTest(window_); | 79 ->GetShadowForWindowForTest(window_); |
| 80 return resize_shadow ? resize_shadow->GetLastHitTestForTest() : HTNOWHERE; | 80 return resize_shadow ? resize_shadow->GetLastHitTestForTest() : HTNOWHERE; |
| 81 } | 81 } |
| 82 | 82 |
| 83 // Returns true if there is a resize shadow. | 83 // Returns true if there is a resize shadow. |
| 84 bool HasResizeShadow() const { | 84 bool HasResizeShadow() const { |
| 85 return ResizeShadowHitTest() != HTNOWHERE; | 85 return ResizeShadowHitTest() != HTNOWHERE; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Returns the current cursor type. | 88 // Returns the current cursor type. |
| 89 int GetCurrentCursorType() const { | 89 int GetCurrentCursorType() const { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 generator.MoveMouseTo(200, 50); | 221 generator.MoveMouseTo(200, 50); |
| 222 EXPECT_EQ(HTRIGHT, ResizeShadowHitTest()); | 222 EXPECT_EQ(HTRIGHT, ResizeShadowHitTest()); |
| 223 EXPECT_EQ(ui::kCursorEastResize, GetCurrentCursorType()); | 223 EXPECT_EQ(ui::kCursorEastResize, GetCurrentCursorType()); |
| 224 generator.MoveMouseTo(200 - ash::kResizeInsideBoundsSize, 50); | 224 generator.MoveMouseTo(200 - ash::kResizeInsideBoundsSize, 50); |
| 225 EXPECT_EQ(HTRIGHT, ResizeShadowHitTest()); | 225 EXPECT_EQ(HTRIGHT, ResizeShadowHitTest()); |
| 226 EXPECT_EQ(ui::kCursorEastResize, GetCurrentCursorType()); | 226 EXPECT_EQ(ui::kCursorEastResize, GetCurrentCursorType()); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace test | 229 } // namespace test |
| 230 } // namespace ash | 230 } // namespace ash |
| OLD | NEW |