| 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 CONTENT_COMMON_CURSORS_WEBCURSOR_H_ | 5 #ifndef CONTENT_COMMON_CURSORS_WEBCURSOR_H_ |
| 6 #define CONTENT_COMMON_CURSORS_WEBCURSOR_H_ | 6 #define CONTENT_COMMON_CURSORS_WEBCURSOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 12 #include "content/public/common/cursor_info.h" |
| 13 #include "ui/display/display.h" | 13 #include "ui/display/display.h" |
| 14 #include "ui/gfx/geometry/point.h" | 14 #include "ui/gfx/geometry/point.h" |
| 15 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 17 | 17 |
| 18 #if defined(USE_AURA) | 18 #if defined(USE_AURA) |
| 19 #include "ui/base/cursor/cursor.h" | 19 #include "ui/base/cursor/cursor.h" |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 namespace content { | 39 namespace content { |
| 40 | 40 |
| 41 // This class encapsulates a cross-platform description of a cursor. Platform | 41 // This class encapsulates a cross-platform description of a cursor. Platform |
| 42 // specific methods are provided to translate the cross-platform cursor into a | 42 // specific methods are provided to translate the cross-platform cursor into a |
| 43 // platform specific cursor. It is also possible to serialize / de-serialize a | 43 // platform specific cursor. It is also possible to serialize / de-serialize a |
| 44 // WebCursor. | 44 // WebCursor. |
| 45 class CONTENT_EXPORT WebCursor { | 45 class CONTENT_EXPORT WebCursor { |
| 46 public: | 46 public: |
| 47 struct CursorInfo { | |
| 48 explicit CursorInfo(blink::WebCursorInfo::Type cursor_type) | |
| 49 : type(cursor_type), | |
| 50 image_scale_factor(1) { | |
| 51 } | |
| 52 | |
| 53 CursorInfo() | |
| 54 : type(blink::WebCursorInfo::kTypePointer), image_scale_factor(1) {} | |
| 55 | |
| 56 blink::WebCursorInfo::Type type; | |
| 57 gfx::Point hotspot; | |
| 58 float image_scale_factor; | |
| 59 SkBitmap custom_image; | |
| 60 }; | |
| 61 | |
| 62 WebCursor(); | 47 WebCursor(); |
| 63 ~WebCursor(); | 48 ~WebCursor(); |
| 64 | 49 |
| 65 // Copy constructor/assignment operator combine. | 50 // Copy constructor/assignment operator combine. |
| 66 WebCursor(const WebCursor& other); | 51 WebCursor(const WebCursor& other); |
| 67 const WebCursor& operator=(const WebCursor& other); | 52 const WebCursor& operator=(const WebCursor& other); |
| 68 | 53 |
| 69 // Conversion from/to CursorInfo. | 54 // Conversion from/to CursorInfo. |
| 70 void InitFromCursorInfo(const CursorInfo& cursor_info); | 55 void InitFromCursorInfo(const CursorInfo& cursor_info); |
| 71 void GetCursorInfo(CursorInfo* cursor_info) const; | 56 void GetCursorInfo(CursorInfo* cursor_info) const; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 155 |
| 171 #if defined(USE_OZONE) | 156 #if defined(USE_OZONE) |
| 172 display::Display::Rotation rotation_; | 157 display::Display::Rotation rotation_; |
| 173 gfx::Size maximum_cursor_size_; | 158 gfx::Size maximum_cursor_size_; |
| 174 #endif | 159 #endif |
| 175 }; | 160 }; |
| 176 | 161 |
| 177 } // namespace content | 162 } // namespace content |
| 178 | 163 |
| 179 #endif // CONTENT_COMMON_CURSORS_WEBCURSOR_H_ | 164 #endif // CONTENT_COMMON_CURSORS_WEBCURSOR_H_ |
| OLD | NEW |