Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(802)

Side by Side Diff: ash/display/unified_mouse_warp_controller.h

Issue 2355063002: Separate ash::test::DisplayManagerTestApi from ash (Closed)
Patch Set: review comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef ASH_DISPLAY_UNIFIED_MOUSE_WARP_CONTROLLER_H_ 5 #ifndef ASH_DISPLAY_UNIFIED_MOUSE_WARP_CONTROLLER_H_
6 #define ASH_DISPLAY_UNIFIED_MOUSE_WARP_CONTROLLER_H_ 6 #define ASH_DISPLAY_UNIFIED_MOUSE_WARP_CONTROLLER_H_
7 7
8 #include "ash/display/mouse_warp_controller.h" 8 #include "ash/display/mouse_warp_controller.h"
9 9
10 #include <stdint.h> 10 #include <stdint.h>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "ui/gfx/geometry/rect.h" 13 #include "ui/gfx/geometry/rect.h"
14 14
15 namespace aura { 15 namespace aura {
16 class Window; 16 class Window;
17 } 17 }
18 18
19 namespace gfx { 19 namespace gfx {
20 class Point; 20 class Point;
21 } 21 }
22 22
23 namespace ash { 23 namespace ash {
24 namespace test { 24 namespace test {
25 class AshTestBase;
25 class DisplayManagerTestApi; 26 class DisplayManagerTestApi;
26 } 27 }
27 28
28 // A MouseWarpController used in unified display mode. 29 // A MouseWarpController used in unified display mode.
29 class ASH_EXPORT UnifiedMouseWarpController : public MouseWarpController { 30 class ASH_EXPORT UnifiedMouseWarpController : public MouseWarpController {
30 public: 31 public:
31 UnifiedMouseWarpController(); 32 UnifiedMouseWarpController();
32 ~UnifiedMouseWarpController() override; 33 ~UnifiedMouseWarpController() override;
33 34
34 // MouseWarpController: 35 // MouseWarpController:
35 bool WarpMouseCursor(ui::MouseEvent* event) override; 36 bool WarpMouseCursor(ui::MouseEvent* event) override;
36 void SetEnabled(bool enabled) override; 37 void SetEnabled(bool enabled) override;
37 38
38 private: 39 private:
40 friend class test::AshTestBase;
39 friend class test::DisplayManagerTestApi; 41 friend class test::DisplayManagerTestApi;
40 friend class UnifiedMouseWarpControllerTest; 42 friend class UnifiedMouseWarpControllerTest;
41 43
42 void ComputeBounds(); 44 void ComputeBounds();
43 45
44 // Warps the mouse cursor to an alternate root window when the 46 // Warps the mouse cursor to an alternate root window when the
45 // mouse location in |event|, hits the edge of the event target's root and 47 // mouse location in |event|, hits the edge of the event target's root and
46 // the mouse cursor is considered to be in an alternate display. 48 // the mouse cursor is considered to be in an alternate display.
47 // If |update_mouse_location_now| is true, 49 // If |update_mouse_location_now| is true,
48 // Returns true if/ the cursor was moved. 50 // Returns true if/ the cursor was moved.
49 bool WarpMouseCursorInNativeCoords(const gfx::Point& point_in_native, 51 bool WarpMouseCursorInNativeCoords(const gfx::Point& point_in_native,
50 const gfx::Point& point_in_screen, 52 const gfx::Point& point_in_screen,
51 bool update_mouse_location_now); 53 bool update_mouse_location_now);
52 54
53 void update_location_for_test() { update_location_for_test_ = true; } 55 void update_location_for_test() { update_location_for_test_ = true; }
54 56
55 gfx::Rect first_edge_bounds_in_native_; 57 gfx::Rect first_edge_bounds_in_native_;
56 gfx::Rect second_edge_bounds_in_native_; 58 gfx::Rect second_edge_bounds_in_native_;
57 59
58 int64_t current_cursor_display_id_; 60 int64_t current_cursor_display_id_;
59 61
60 bool update_location_for_test_; 62 bool update_location_for_test_;
61 63
62 DISALLOW_COPY_AND_ASSIGN(UnifiedMouseWarpController); 64 DISALLOW_COPY_AND_ASSIGN(UnifiedMouseWarpController);
63 }; 65 };
64 66
65 } // namespace ash 67 } // namespace ash
66 68
67 #endif // ASH_DISPLAY_UNIFIED_MOUSE_WARP_CONTROLLER_H_ 69 #endif // ASH_DISPLAY_UNIFIED_MOUSE_WARP_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/display/screen_position_controller_unittest.cc ('k') | ash/display/unified_mouse_warp_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698