| 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 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_ | 5 #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_ |
| 6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_ | 6 #define UI_BASE_CURSOR_CURSOR_LOADER_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "ui/base/ui_base_export.h" | 11 #include "ui/base/ui_base_export.h" |
| 12 #include "ui/gfx/display.h" | 12 #include "ui/display/display.h" |
| 13 #include "ui/gfx/geometry/point.h" | 13 #include "ui/gfx/geometry/point.h" |
| 14 #include "ui/gfx/native_widget_types.h" | 14 #include "ui/gfx/native_widget_types.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 | 17 |
| 18 class UI_BASE_EXPORT CursorLoader { | 18 class UI_BASE_EXPORT CursorLoader { |
| 19 public: | 19 public: |
| 20 CursorLoader() : scale_(1.f), rotation_(gfx::Display::ROTATE_0) {} | 20 CursorLoader() : scale_(1.f), rotation_(display::Display::ROTATE_0) {} |
| 21 virtual ~CursorLoader() {} | 21 virtual ~CursorLoader() {} |
| 22 | 22 |
| 23 gfx::Display::Rotation rotation() const { | 23 display::Display::Rotation rotation() const { return rotation_; } |
| 24 return rotation_; | |
| 25 } | |
| 26 | 24 |
| 27 void set_rotation(gfx::Display::Rotation rotation) { | 25 void set_rotation(display::Display::Rotation rotation) { |
| 28 rotation_ = rotation; | 26 rotation_ = rotation; |
| 29 } | 27 } |
| 30 | 28 |
| 31 // Returns the current scale of the mouse cursor icon. | 29 // Returns the current scale of the mouse cursor icon. |
| 32 float scale() const { | 30 float scale() const { |
| 33 return scale_; | 31 return scale_; |
| 34 } | 32 } |
| 35 | 33 |
| 36 // Sets the scale of the mouse cursor icon. | 34 // Sets the scale of the mouse cursor icon. |
| 37 void set_scale(const float scale) { | 35 void set_scale(const float scale) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 60 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0; | 58 virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0; |
| 61 | 59 |
| 62 // Creates a CursorLoader. | 60 // Creates a CursorLoader. |
| 63 static CursorLoader* Create(); | 61 static CursorLoader* Create(); |
| 64 | 62 |
| 65 private: | 63 private: |
| 66 // The current scale of the mouse cursor icon. | 64 // The current scale of the mouse cursor icon. |
| 67 float scale_; | 65 float scale_; |
| 68 | 66 |
| 69 // The current rotation of the mouse cursor icon. | 67 // The current rotation of the mouse cursor icon. |
| 70 gfx::Display::Rotation rotation_; | 68 display::Display::Rotation rotation_; |
| 71 | 69 |
| 72 DISALLOW_COPY_AND_ASSIGN(CursorLoader); | 70 DISALLOW_COPY_AND_ASSIGN(CursorLoader); |
| 73 }; | 71 }; |
| 74 | 72 |
| 75 } // namespace ui | 73 } // namespace ui |
| 76 | 74 |
| 77 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_ | 75 #endif // UI_BASE_CURSOR_CURSOR_LOADER_H_ |
| OLD | NEW |