Elim cr-checkbox
[chromium-blink-merge.git] / ash / display / unified_mouse_warp_controller.h
blob95fdbf69fe482c2aae8bbb84f545b5ae3825fb2d
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
3 // found in the LICENSE file.
5 #ifndef ASH_DISPLAY_UNIFIED_MOUSE_WARP_CONTROLLER_H
6 #define ASH_DISPLAY_UNIFIED_MOUSE_WARP_CONTROLLER_H
8 #include "ash/display/mouse_warp_controller.h"
10 #include "base/gtest_prod_util.h"
11 #include "ui/gfx/geometry/rect.h"
13 namespace aura {
14 class Window;
17 namespace gfx {
18 class Point;
21 namespace ash {
22 namespace test {
23 class DisplayManagerTestApi;
26 // A MouseWarpController used in unified display mode.
27 class ASH_EXPORT UnifiedMouseWarpController : public MouseWarpController {
28 public:
29 UnifiedMouseWarpController();
30 ~UnifiedMouseWarpController() override;
32 // MouseWarpController:
33 bool WarpMouseCursor(ui::MouseEvent* event) override;
34 void SetEnabled(bool enabled) override;
36 private:
37 friend class test::DisplayManagerTestApi;
38 friend class UnifiedMouseWarpControllerTest;
40 void ComputeBounds();
42 // Warps the mouse cursor to an alternate root window when the
43 // mouse location in |event|, hits the edge of the event target's root and
44 // the mouse cursor is considered to be in an alternate display.
45 // If |update_mouse_location_now| is true,
46 // Returns true if/ the cursor was moved.
47 bool WarpMouseCursorInNativeCoords(const gfx::Point& point_in_native,
48 const gfx::Point& point_in_screen,
49 bool update_mouse_location_now);
51 void update_location_for_test() { update_location_for_test_ = true; }
53 gfx::Rect first_edge_bounds_in_native_;
54 gfx::Rect second_edge_bounds_in_native_;
56 int64 current_cursor_display_id_;
58 bool update_location_for_test_;
60 DISALLOW_COPY_AND_ASSIGN(UnifiedMouseWarpController);
63 } // namespace ash
65 #endif // ASH_DISPLAY_UNIFIED_MOUSE_WARP_CONTROLLER_H