| 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 WEBKIT_COMMON_CURSORS_WEBCURSOR_H_ | 5 #ifndef WEBKIT_COMMON_CURSORS_WEBCURSOR_H_ |
| 6 #define WEBKIT_COMMON_CURSORS_WEBCURSOR_H_ | 6 #define WEBKIT_COMMON_CURSORS_WEBCURSOR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "third_party/WebKit/public/web/WebCursorInfo.h" | 9 #include "third_party/WebKit/public/web/WebCursorInfo.h" |
| 10 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 class Pickle; | 36 class Pickle; |
| 37 class PickleIterator; | 37 class PickleIterator; |
| 38 | 38 |
| 39 // This class encapsulates a cross-platform description of a cursor. Platform | 39 // This class encapsulates a cross-platform description of a cursor. Platform |
| 40 // specific methods are provided to translate the cross-platform cursor into a | 40 // specific methods are provided to translate the cross-platform cursor into a |
| 41 // platform specific cursor. It is also possible to serialize / de-serialize a | 41 // platform specific cursor. It is also possible to serialize / de-serialize a |
| 42 // WebCursor. | 42 // WebCursor. |
| 43 class WEBKIT_COMMON_EXPORT WebCursor { | 43 class WEBKIT_COMMON_EXPORT WebCursor { |
| 44 public: | 44 public: |
| 45 struct CursorInfo { | 45 struct CursorInfo { |
| 46 explicit CursorInfo(WebKit::WebCursorInfo::Type cursor_type) | 46 explicit CursorInfo(blink::WebCursorInfo::Type cursor_type) |
| 47 : type(cursor_type), | 47 : type(cursor_type), |
| 48 image_scale_factor(1) { | 48 image_scale_factor(1) { |
| 49 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
| 50 external_handle = NULL; | 50 external_handle = NULL; |
| 51 #endif | 51 #endif |
| 52 } | 52 } |
| 53 | 53 |
| 54 CursorInfo() | 54 CursorInfo() |
| 55 : type(WebKit::WebCursorInfo::TypePointer), | 55 : type(blink::WebCursorInfo::TypePointer), |
| 56 image_scale_factor(1) { | 56 image_scale_factor(1) { |
| 57 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
| 58 external_handle = NULL; | 58 external_handle = NULL; |
| 59 #endif | 59 #endif |
| 60 } | 60 } |
| 61 | 61 |
| 62 WebKit::WebCursorInfo::Type type; | 62 blink::WebCursorInfo::Type type; |
| 63 gfx::Point hotspot; | 63 gfx::Point hotspot; |
| 64 float image_scale_factor; | 64 float image_scale_factor; |
| 65 SkBitmap custom_image; | 65 SkBitmap custom_image; |
| 66 #if defined(OS_WIN) | 66 #if defined(OS_WIN) |
| 67 HCURSOR external_handle; | 67 HCURSOR external_handle; |
| 68 #endif | 68 #endif |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 WebCursor(); | 71 WebCursor(); |
| 72 explicit WebCursor(const CursorInfo& cursor_info); | 72 explicit WebCursor(const CursorInfo& cursor_info); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 #elif defined(OS_WIN) | 186 #elif defined(OS_WIN) |
| 187 // A custom cursor created from custom bitmap data by Webkit. | 187 // A custom cursor created from custom bitmap data by Webkit. |
| 188 HCURSOR custom_cursor_; | 188 HCURSOR custom_cursor_; |
| 189 #elif defined(TOOLKIT_GTK) | 189 #elif defined(TOOLKIT_GTK) |
| 190 // A custom cursor created that should be unref'ed from the destructor. | 190 // A custom cursor created that should be unref'ed from the destructor. |
| 191 GdkCursor* unref_; | 191 GdkCursor* unref_; |
| 192 #endif | 192 #endif |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 #endif // WEBKIT_COMMON_CURSORS_WEBCURSOR_H_ | 195 #endif // WEBKIT_COMMON_CURSORS_WEBCURSOR_H_ |
| OLD | NEW |