| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DISPLAY_UTIL_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_UTIL_H_ |
| 6 #define ASH_DISPLAY_DISPLAY_UTIL_H_ | 6 #define ASH_DISPLAY_DISPLAY_UTIL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | |
| 11 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 12 | 11 |
| 13 namespace aura { | 12 namespace aura { |
| 14 class Window; | 13 class Window; |
| 15 } | 14 } |
| 16 | 15 |
| 17 namespace display { | 16 namespace display { |
| 18 class DisplayManager; | 17 class DisplayManager; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace gfx { | 20 namespace gfx { |
| 22 class Point; | 21 class Point; |
| 23 class Rect; | 22 class Rect; |
| 24 } | 23 } |
| 25 | 24 |
| 26 namespace ash { | 25 namespace ash { |
| 27 class AshWindowTreeHost; | 26 class AshWindowTreeHost; |
| 28 class MouseWarpController; | 27 class MouseWarpController; |
| 29 | 28 |
| 30 // Creates a MouseWarpController for the current display | 29 // Creates a MouseWarpController for the current display |
| 31 // configuration. |drag_source| is the window where dragging | 30 // configuration. |drag_source| is the window where dragging |
| 32 // started, or nullptr otherwise. | 31 // started, or nullptr otherwise. |
| 33 std::unique_ptr<MouseWarpController> CreateMouseWarpController( | 32 std::unique_ptr<MouseWarpController> CreateMouseWarpController( |
| 34 display::DisplayManager* manager, | 33 display::DisplayManager* manager, |
| 35 aura::Window* drag_source); | 34 aura::Window* drag_source); |
| 36 | 35 |
| 37 // Creates edge bounds from |bounds_in_screen| that fits the edge | 36 // Creates edge bounds from |bounds_in_screen| that fits the edge |
| 38 // of the native window for |ash_host|. | 37 // of the native window for |ash_host|. |
| 39 ASH_EXPORT gfx::Rect GetNativeEdgeBounds(AshWindowTreeHost* ash_host, | 38 gfx::Rect GetNativeEdgeBounds(AshWindowTreeHost* ash_host, |
| 40 const gfx::Rect& bounds_in_screen); | 39 const gfx::Rect& bounds_in_screen); |
| 41 | 40 |
| 42 // Moves the cursor to the point inside the |ash_host| that is closest to | 41 // Moves the cursor to the point inside the |ash_host| that is closest to |
| 43 // the point_in_screen, which may be outside of the root window. | 42 // the point_in_screen, which may be outside of the root window. |
| 44 // |update_last_loation_now| is used for the test to update the mouse | 43 // |update_last_loation_now| is used for the test to update the mouse |
| 45 // location synchronously. | 44 // location synchronously. |
| 46 void MoveCursorTo(AshWindowTreeHost* ash_host, | 45 void MoveCursorTo(AshWindowTreeHost* ash_host, |
| 47 const gfx::Point& point_in_screen, | 46 const gfx::Point& point_in_screen, |
| 48 bool update_last_location_now); | 47 bool update_last_location_now); |
| 49 | 48 |
| 50 #if defined(OS_CHROMEOS) | |
| 51 // Shows the notification message for display related issues, and optionally | 49 // Shows the notification message for display related issues, and optionally |
| 52 // adds a button to send a feedback report. | 50 // adds a button to send a feedback report. |
| 53 void ShowDisplayErrorNotification(const base::string16& message, | 51 void ShowDisplayErrorNotification(const base::string16& message, |
| 54 bool allow_feedback); | 52 bool allow_feedback); |
| 55 #endif | |
| 56 | 53 |
| 57 ASH_EXPORT base::string16 GetDisplayErrorNotificationMessageForTest(); | 54 base::string16 GetDisplayErrorNotificationMessageForTest(); |
| 58 | 55 |
| 59 } // namespace ash | 56 } // namespace ash |
| 60 | 57 |
| 61 #endif // ASH_DISPLAY_DISPLAY_UTIL_H_ | 58 #endif // ASH_DISPLAY_DISPLAY_UTIL_H_ |
| OLD | NEW |