OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "content/renderer/cursor_utils.h" | 5 #include "content/renderer/cursor_utils.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "content/common/cursors/webcursor.h" | 8 #include "content/common/cursors/webcursor.h" |
9 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 9 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
10 | 10 |
11 using blink::WebCursorInfo; | 11 using blink::WebCursorInfo; |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 bool GetWebCursorInfo(const WebCursor& cursor, | 15 bool GetWebCursorInfo(const WebCursor& cursor, |
16 WebCursorInfo* web_cursor_info) { | 16 WebCursorInfo* web_cursor_info) { |
17 WebCursor::CursorInfo cursor_info; | 17 CursorInfo cursor_info; |
18 cursor.GetCursorInfo(&cursor_info); | 18 cursor.GetCursorInfo(&cursor_info); |
19 | 19 |
20 web_cursor_info->type = cursor_info.type; | 20 web_cursor_info->type = cursor_info.type; |
21 web_cursor_info->hot_spot = cursor_info.hotspot; | 21 web_cursor_info->hot_spot = cursor_info.hotspot; |
22 web_cursor_info->custom_image = cursor_info.custom_image; | 22 web_cursor_info->custom_image = cursor_info.custom_image; |
23 web_cursor_info->image_scale_factor = cursor_info.image_scale_factor; | 23 web_cursor_info->image_scale_factor = cursor_info.image_scale_factor; |
24 return true; | 24 return true; |
25 } | 25 } |
26 | 26 |
27 void InitializeCursorFromWebCursorInfo(WebCursor* cursor, | 27 void InitializeCursorFromWebCursorInfo(WebCursor* cursor, |
28 const WebCursorInfo& web_cursor_info) { | 28 const WebCursorInfo& web_cursor_info) { |
29 WebCursor::CursorInfo cursor_info; | 29 CursorInfo cursor_info; |
30 cursor_info.type = web_cursor_info.type; | 30 cursor_info.type = web_cursor_info.type; |
31 cursor_info.image_scale_factor = web_cursor_info.image_scale_factor; | 31 cursor_info.image_scale_factor = web_cursor_info.image_scale_factor; |
32 cursor_info.hotspot = web_cursor_info.hot_spot; | 32 cursor_info.hotspot = web_cursor_info.hot_spot; |
33 cursor_info.custom_image = web_cursor_info.custom_image.GetSkBitmap(); | 33 cursor_info.custom_image = web_cursor_info.custom_image.GetSkBitmap(); |
34 cursor->InitFromCursorInfo(cursor_info); | 34 cursor->InitFromCursorInfo(cursor_info); |
35 } | 35 } |
36 | 36 |
37 } // namespce content | 37 } // namespce content |
OLD | NEW |