diff options
author | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-15 21:46:11 +0200 |
---|---|---|
committer | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-15 21:46:11 +0200 |
commit | 679147eead574d186ebf3069647b4c23e8ccace6 (patch) | |
tree | fc247a0ac8ff119f7c8550879ebb6d3dd8d1ff69 /chromium/content/renderer/cursor_utils.cc | |
download | qtwebengine-chromium-679147eead574d186ebf3069647b4c23e8ccace6.tar.gz |
Initial import.
Diffstat (limited to 'chromium/content/renderer/cursor_utils.cc')
-rw-r--r-- | chromium/content/renderer/cursor_utils.cc | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/chromium/content/renderer/cursor_utils.cc b/chromium/content/renderer/cursor_utils.cc new file mode 100644 index 00000000000..80351c94a3b --- /dev/null +++ b/chromium/content/renderer/cursor_utils.cc @@ -0,0 +1,44 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/renderer/cursor_utils.h" + +#include "build/build_config.h" +#include "third_party/WebKit/public/web/WebCursorInfo.h" +#include "webkit/common/cursors/webcursor.h" + +using WebKit::WebCursorInfo; + +namespace content { + +bool GetWebKitCursorInfo(const WebCursor& cursor, + WebCursorInfo* webkit_cursor_info) { + WebCursor::CursorInfo cursor_info; + cursor.GetCursorInfo(&cursor_info); + + webkit_cursor_info->type = cursor_info.type; + webkit_cursor_info->hotSpot = cursor_info.hotspot; + webkit_cursor_info->customImage = cursor_info.custom_image; + webkit_cursor_info->imageScaleFactor = cursor_info.image_scale_factor; +#if defined(OS_WIN) + webkit_cursor_info->externalHandle = cursor_info.external_handle; +#endif + return true; +} + +void InitializeCursorFromWebKitCursorInfo( + WebCursor* cursor, + const WebCursorInfo& webkit_cursor_info) { + WebCursor::CursorInfo web_cursor_info; + web_cursor_info.type = webkit_cursor_info.type; + web_cursor_info.image_scale_factor = webkit_cursor_info.imageScaleFactor; + web_cursor_info.hotspot = webkit_cursor_info.hotSpot; + web_cursor_info.custom_image = webkit_cursor_info.customImage.getSkBitmap(); +#if defined(OS_WIN) + web_cursor_info.external_handle = webkit_cursor_info.externalHandle; +#endif + cursor->InitFromCursorInfo(web_cursor_info); +} + +} // namespce content |