Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: content/renderer/cursor_utils.cc

Issue 1975033002: Minor cleanup to webcursors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delete another function Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/cursors/webcursor_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 WebCursor::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->hotSpot = cursor_info.hotspot; 21 web_cursor_info->hotSpot = cursor_info.hotspot;
22 web_cursor_info->customImage = cursor_info.custom_image; 22 web_cursor_info->customImage = cursor_info.custom_image;
23 web_cursor_info->imageScaleFactor = cursor_info.image_scale_factor; 23 web_cursor_info->imageScaleFactor = cursor_info.image_scale_factor;
24 #if defined(OS_WIN)
25 web_cursor_info->externalHandle = cursor_info.external_handle;
26 #endif
27 return true; 24 return true;
28 } 25 }
29 26
30 void InitializeCursorFromWebCursorInfo(WebCursor* cursor, 27 void InitializeCursorFromWebCursorInfo(WebCursor* cursor,
31 const WebCursorInfo& web_cursor_info) { 28 const WebCursorInfo& web_cursor_info) {
32 WebCursor::CursorInfo cursor_info; 29 WebCursor::CursorInfo cursor_info;
33 cursor_info.type = web_cursor_info.type; 30 cursor_info.type = web_cursor_info.type;
34 cursor_info.image_scale_factor = web_cursor_info.imageScaleFactor; 31 cursor_info.image_scale_factor = web_cursor_info.imageScaleFactor;
35 cursor_info.hotspot = web_cursor_info.hotSpot; 32 cursor_info.hotspot = web_cursor_info.hotSpot;
36 cursor_info.custom_image = web_cursor_info.customImage.getSkBitmap(); 33 cursor_info.custom_image = web_cursor_info.customImage.getSkBitmap();
37 #if defined(OS_WIN)
38 cursor_info.external_handle = web_cursor_info.externalHandle;
39 #endif
40 cursor->InitFromCursorInfo(cursor_info); 34 cursor->InitFromCursorInfo(cursor_info);
41 } 35 }
42 36
43 } // namespce content 37 } // namespce content
OLDNEW
« no previous file with comments | « content/common/cursors/webcursor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698