diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-08 20:28:43 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-08 20:28:43 +0000 |
commit | 33ec505631bcc1cc6709248b97b468fbdf3d5f0a (patch) | |
tree | 4963e5e21af0f8173c5b6353c34209993b5da852 /webkit | |
parent | 41c3696d8ebb37c0b2e0afd0361f0b40bc369483 (diff) | |
download | chromium_src-33ec505631bcc1cc6709248b97b468fbdf3d5f0a.zip chromium_src-33ec505631bcc1cc6709248b97b468fbdf3d5f0a.tar.gz chromium_src-33ec505631bcc1cc6709248b97b468fbdf3d5f0a.tar.bz2 |
Add new MouseCursor interface for setting the mouse cursor.
Remove most of the old cursor control interface. This keeps backwards compat for CursorControl.SetCursor (which just redirects to the new function) to kepe existing users running. None of the other functions on cursor control were implemented, so I removed all the proxying and stuff for them.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/9814015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131314 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webkit_glue.gypi | 2 | ||||
-rw-r--r-- | webkit/plugins/ppapi/host_globals.cc | 4 | ||||
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 1 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 188 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.h | 9 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_cursor_control_impl.cc | 62 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_cursor_control_impl.h | 49 |
7 files changed, 99 insertions, 216 deletions
diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi index 785c4fa..89bc7bd 100644 --- a/webkit/glue/webkit_glue.gypi +++ b/webkit/glue/webkit_glue.gypi @@ -261,8 +261,6 @@ '../plugins/ppapi/ppb_broker_impl.h', '../plugins/ppapi/ppb_buffer_impl.cc', '../plugins/ppapi/ppb_buffer_impl.h', - '../plugins/ppapi/ppb_cursor_control_impl.cc', - '../plugins/ppapi/ppb_cursor_control_impl.h', '../plugins/ppapi/ppb_directory_reader_impl.cc', '../plugins/ppapi/ppb_directory_reader_impl.h', '../plugins/ppapi/ppb_file_chooser_impl.cc', diff --git a/webkit/plugins/ppapi/host_globals.cc b/webkit/plugins/ppapi/host_globals.cc index a3e5f31..d2c2516 100644 --- a/webkit/plugins/ppapi/host_globals.cc +++ b/webkit/plugins/ppapi/host_globals.cc @@ -20,7 +20,6 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" #include "webkit/plugins/ppapi/plugin_module.h" #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" -#include "webkit/plugins/ppapi/ppb_cursor_control_impl.h" #include "webkit/plugins/ppapi/ppb_flash_clipboard_impl.h" #include "webkit/plugins/ppapi/ppb_text_input_impl.h" #include "webkit/plugins/ppapi/resource_creation_impl.h" @@ -141,9 +140,6 @@ HostGlobals::~HostGlobals() { return proxy.get(); switch (id) { - case ::ppapi::API_ID_PPB_CURSORCONTROL: - proxy.reset(new PPB_CursorControl_Impl(instance)); - break; case ::ppapi::API_ID_PPB_TEXT_INPUT: proxy.reset(new PPB_TextInput_Impl(instance)); break; diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index bc9dcaf..a570a40 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -56,6 +56,7 @@ #include "ppapi/c/ppb_image_data.h" #include "ppapi/c/ppb_instance.h" #include "ppapi/c/ppb_messaging.h" +#include "ppapi/c/ppb_mouse_cursor.h" #include "ppapi/c/ppb_mouse_lock.h" #include "ppapi/c/ppb_opengles2.h" #include "ppapi/c/ppb_url_loader.h" diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index 6cd4146..09554fa 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -173,60 +173,66 @@ const char kHeight[] = "height"; const char kBorder[] = "border"; // According to w3c, deprecated. const char kStyle[] = "style"; -COMPILE_ASSERT_MATCHING_ENUM(TypePointer, PP_CURSORTYPE_POINTER); -COMPILE_ASSERT_MATCHING_ENUM(TypeCross, PP_CURSORTYPE_CROSS); -COMPILE_ASSERT_MATCHING_ENUM(TypeHand, PP_CURSORTYPE_HAND); -COMPILE_ASSERT_MATCHING_ENUM(TypeIBeam, PP_CURSORTYPE_IBEAM); -COMPILE_ASSERT_MATCHING_ENUM(TypeWait, PP_CURSORTYPE_WAIT); -COMPILE_ASSERT_MATCHING_ENUM(TypeHelp, PP_CURSORTYPE_HELP); -COMPILE_ASSERT_MATCHING_ENUM(TypeEastResize, PP_CURSORTYPE_EASTRESIZE); -COMPILE_ASSERT_MATCHING_ENUM(TypeNorthResize, PP_CURSORTYPE_NORTHRESIZE); +COMPILE_ASSERT_MATCHING_ENUM(TypePointer, PP_MOUSECURSOR_TYPE_POINTER); +COMPILE_ASSERT_MATCHING_ENUM(TypeCross, PP_MOUSECURSOR_TYPE_CROSS); +COMPILE_ASSERT_MATCHING_ENUM(TypeHand, PP_MOUSECURSOR_TYPE_HAND); +COMPILE_ASSERT_MATCHING_ENUM(TypeIBeam, PP_MOUSECURSOR_TYPE_IBEAM); +COMPILE_ASSERT_MATCHING_ENUM(TypeWait, PP_MOUSECURSOR_TYPE_WAIT); +COMPILE_ASSERT_MATCHING_ENUM(TypeHelp, PP_MOUSECURSOR_TYPE_HELP); +COMPILE_ASSERT_MATCHING_ENUM(TypeEastResize, PP_MOUSECURSOR_TYPE_EASTRESIZE); +COMPILE_ASSERT_MATCHING_ENUM(TypeNorthResize, PP_MOUSECURSOR_TYPE_NORTHRESIZE); COMPILE_ASSERT_MATCHING_ENUM(TypeNorthEastResize, - PP_CURSORTYPE_NORTHEASTRESIZE); + PP_MOUSECURSOR_TYPE_NORTHEASTRESIZE); COMPILE_ASSERT_MATCHING_ENUM(TypeNorthWestResize, - PP_CURSORTYPE_NORTHWESTRESIZE); -COMPILE_ASSERT_MATCHING_ENUM(TypeSouthResize, PP_CURSORTYPE_SOUTHRESIZE); + PP_MOUSECURSOR_TYPE_NORTHWESTRESIZE); +COMPILE_ASSERT_MATCHING_ENUM(TypeSouthResize, PP_MOUSECURSOR_TYPE_SOUTHRESIZE); COMPILE_ASSERT_MATCHING_ENUM(TypeSouthEastResize, - PP_CURSORTYPE_SOUTHEASTRESIZE); + PP_MOUSECURSOR_TYPE_SOUTHEASTRESIZE); COMPILE_ASSERT_MATCHING_ENUM(TypeSouthWestResize, - PP_CURSORTYPE_SOUTHWESTRESIZE); -COMPILE_ASSERT_MATCHING_ENUM(TypeWestResize, PP_CURSORTYPE_WESTRESIZE); + PP_MOUSECURSOR_TYPE_SOUTHWESTRESIZE); +COMPILE_ASSERT_MATCHING_ENUM(TypeWestResize, PP_MOUSECURSOR_TYPE_WESTRESIZE); COMPILE_ASSERT_MATCHING_ENUM(TypeNorthSouthResize, - PP_CURSORTYPE_NORTHSOUTHRESIZE); -COMPILE_ASSERT_MATCHING_ENUM(TypeEastWestResize, PP_CURSORTYPE_EASTWESTRESIZE); + PP_MOUSECURSOR_TYPE_NORTHSOUTHRESIZE); +COMPILE_ASSERT_MATCHING_ENUM(TypeEastWestResize, + PP_MOUSECURSOR_TYPE_EASTWESTRESIZE); COMPILE_ASSERT_MATCHING_ENUM(TypeNorthEastSouthWestResize, - PP_CURSORTYPE_NORTHEASTSOUTHWESTRESIZE); + PP_MOUSECURSOR_TYPE_NORTHEASTSOUTHWESTRESIZE); COMPILE_ASSERT_MATCHING_ENUM(TypeNorthWestSouthEastResize, - PP_CURSORTYPE_NORTHWESTSOUTHEASTRESIZE); -COMPILE_ASSERT_MATCHING_ENUM(TypeColumnResize, PP_CURSORTYPE_COLUMNRESIZE); -COMPILE_ASSERT_MATCHING_ENUM(TypeRowResize, PP_CURSORTYPE_ROWRESIZE); -COMPILE_ASSERT_MATCHING_ENUM(TypeMiddlePanning, PP_CURSORTYPE_MIDDLEPANNING); -COMPILE_ASSERT_MATCHING_ENUM(TypeEastPanning, PP_CURSORTYPE_EASTPANNING); -COMPILE_ASSERT_MATCHING_ENUM(TypeNorthPanning, PP_CURSORTYPE_NORTHPANNING); + PP_MOUSECURSOR_TYPE_NORTHWESTSOUTHEASTRESIZE); +COMPILE_ASSERT_MATCHING_ENUM(TypeColumnResize, + PP_MOUSECURSOR_TYPE_COLUMNRESIZE); +COMPILE_ASSERT_MATCHING_ENUM(TypeRowResize, PP_MOUSECURSOR_TYPE_ROWRESIZE); +COMPILE_ASSERT_MATCHING_ENUM(TypeMiddlePanning, + PP_MOUSECURSOR_TYPE_MIDDLEPANNING); +COMPILE_ASSERT_MATCHING_ENUM(TypeEastPanning, PP_MOUSECURSOR_TYPE_EASTPANNING); +COMPILE_ASSERT_MATCHING_ENUM(TypeNorthPanning, + PP_MOUSECURSOR_TYPE_NORTHPANNING); COMPILE_ASSERT_MATCHING_ENUM(TypeNorthEastPanning, - PP_CURSORTYPE_NORTHEASTPANNING); + PP_MOUSECURSOR_TYPE_NORTHEASTPANNING); COMPILE_ASSERT_MATCHING_ENUM(TypeNorthWestPanning, - PP_CURSORTYPE_NORTHWESTPANNING); -COMPILE_ASSERT_MATCHING_ENUM(TypeSouthPanning, PP_CURSORTYPE_SOUTHPANNING); + PP_MOUSECURSOR_TYPE_NORTHWESTPANNING); +COMPILE_ASSERT_MATCHING_ENUM(TypeSouthPanning, + PP_MOUSECURSOR_TYPE_SOUTHPANNING); COMPILE_ASSERT_MATCHING_ENUM(TypeSouthEastPanning, - PP_CURSORTYPE_SOUTHEASTPANNING); + PP_MOUSECURSOR_TYPE_SOUTHEASTPANNING); COMPILE_ASSERT_MATCHING_ENUM(TypeSouthWestPanning, - PP_CURSORTYPE_SOUTHWESTPANNING); -COMPILE_ASSERT_MATCHING_ENUM(TypeWestPanning, PP_CURSORTYPE_WESTPANNING); -COMPILE_ASSERT_MATCHING_ENUM(TypeMove, PP_CURSORTYPE_MOVE); -COMPILE_ASSERT_MATCHING_ENUM(TypeVerticalText, PP_CURSORTYPE_VERTICALTEXT); -COMPILE_ASSERT_MATCHING_ENUM(TypeCell, PP_CURSORTYPE_CELL); -COMPILE_ASSERT_MATCHING_ENUM(TypeContextMenu, PP_CURSORTYPE_CONTEXTMENU); -COMPILE_ASSERT_MATCHING_ENUM(TypeAlias, PP_CURSORTYPE_ALIAS); -COMPILE_ASSERT_MATCHING_ENUM(TypeProgress, PP_CURSORTYPE_PROGRESS); -COMPILE_ASSERT_MATCHING_ENUM(TypeNoDrop, PP_CURSORTYPE_NODROP); -COMPILE_ASSERT_MATCHING_ENUM(TypeCopy, PP_CURSORTYPE_COPY); -COMPILE_ASSERT_MATCHING_ENUM(TypeNone, PP_CURSORTYPE_NONE); -COMPILE_ASSERT_MATCHING_ENUM(TypeNotAllowed, PP_CURSORTYPE_NOTALLOWED); -COMPILE_ASSERT_MATCHING_ENUM(TypeZoomIn, PP_CURSORTYPE_ZOOMIN); -COMPILE_ASSERT_MATCHING_ENUM(TypeZoomOut, PP_CURSORTYPE_ZOOMOUT); -COMPILE_ASSERT_MATCHING_ENUM(TypeGrab, PP_CURSORTYPE_GRAB); -COMPILE_ASSERT_MATCHING_ENUM(TypeGrabbing, PP_CURSORTYPE_GRABBING); + PP_MOUSECURSOR_TYPE_SOUTHWESTPANNING); +COMPILE_ASSERT_MATCHING_ENUM(TypeWestPanning, PP_MOUSECURSOR_TYPE_WESTPANNING); +COMPILE_ASSERT_MATCHING_ENUM(TypeMove, PP_MOUSECURSOR_TYPE_MOVE); +COMPILE_ASSERT_MATCHING_ENUM(TypeVerticalText, + PP_MOUSECURSOR_TYPE_VERTICALTEXT); +COMPILE_ASSERT_MATCHING_ENUM(TypeCell, PP_MOUSECURSOR_TYPE_CELL); +COMPILE_ASSERT_MATCHING_ENUM(TypeContextMenu, PP_MOUSECURSOR_TYPE_CONTEXTMENU); +COMPILE_ASSERT_MATCHING_ENUM(TypeAlias, PP_MOUSECURSOR_TYPE_ALIAS); +COMPILE_ASSERT_MATCHING_ENUM(TypeProgress, PP_MOUSECURSOR_TYPE_PROGRESS); +COMPILE_ASSERT_MATCHING_ENUM(TypeNoDrop, PP_MOUSECURSOR_TYPE_NODROP); +COMPILE_ASSERT_MATCHING_ENUM(TypeCopy, PP_MOUSECURSOR_TYPE_COPY); +COMPILE_ASSERT_MATCHING_ENUM(TypeNone, PP_MOUSECURSOR_TYPE_NONE); +COMPILE_ASSERT_MATCHING_ENUM(TypeNotAllowed, PP_MOUSECURSOR_TYPE_NOTALLOWED); +COMPILE_ASSERT_MATCHING_ENUM(TypeZoomIn, PP_MOUSECURSOR_TYPE_ZOOMIN); +COMPILE_ASSERT_MATCHING_ENUM(TypeZoomOut, PP_MOUSECURSOR_TYPE_ZOOMOUT); +COMPILE_ASSERT_MATCHING_ENUM(TypeGrab, PP_MOUSECURSOR_TYPE_GRAB); +COMPILE_ASSERT_MATCHING_ENUM(TypeGrabbing, PP_MOUSECURSOR_TYPE_GRABBING); // Do not assert WebCursorInfo::TypeCustom == PP_CURSORTYPE_CUSTOM; // PP_CURSORTYPE_CUSTOM is pinned to allow new cursor types. @@ -449,57 +455,6 @@ void PluginInstance::InstanceCrashed() { delegate()->PluginCrashed(this); } -bool PluginInstance::SetCursor(PP_CursorType_Dev type, - PP_Resource custom_image, - const PP_Point* hot_spot) { - if (type != PP_CURSORTYPE_CUSTOM) { - DoSetCursor(new WebCursorInfo(static_cast<WebCursorInfo::Type>(type))); - return true; - } - - if (!hot_spot) - return false; - - EnterResourceNoLock<PPB_ImageData_API> enter(custom_image, true); - if (enter.failed()) - return false; - PPB_ImageData_Impl* image_data = - static_cast<PPB_ImageData_Impl*>(enter.object()); - - if (image_data->format() != PPB_ImageData_Impl::GetNativeImageDataFormat()) { - // TODO(yzshen): Handle the case that the image format is different from the - // native format. - NOTIMPLEMENTED(); - return false; - } - - ImageDataAutoMapper auto_mapper(image_data); - if (!auto_mapper.is_valid()) - return false; - - scoped_ptr<WebCursorInfo> custom_cursor( - new WebCursorInfo(WebCursorInfo::TypeCustom)); - custom_cursor->hotSpot.x = hot_spot->x; - custom_cursor->hotSpot.y = hot_spot->y; - -#if WEBKIT_USING_SKIA - const SkBitmap* bitmap = image_data->GetMappedBitmap(); - // Make a deep copy, so that the cursor remains valid even after the original - // image data gets freed. - if (!bitmap->copyTo(&custom_cursor->customImage.getSkBitmap(), - bitmap->config())) { - return false; - } -#elif WEBKIT_USING_CG - // TODO(yzshen): Implement it. - NOTIMPLEMENTED(); - return false; -#endif - - DoSetCursor(custom_cursor.release()); - return true; -} - bool PluginInstance::Initialize(WebPluginContainer* container, const std::vector<std::string>& arg_names, const std::vector<std::string>& arg_values, @@ -2024,6 +1979,51 @@ void PluginInstance::PostMessage(PP_Instance instance, PP_Var message) { message_channel_->PostMessageToJavaScript(message); } +PP_Bool PluginInstance::SetCursor(PP_Instance instance, + PP_MouseCursor_Type type, + PP_Resource image, + const PP_Point* hot_spot) { + if (!ValidateSetCursorParams(type, image, hot_spot)) + return PP_FALSE; + + if (type != PP_MOUSECURSOR_TYPE_CUSTOM) { + DoSetCursor(new WebCursorInfo(static_cast<WebCursorInfo::Type>(type))); + return PP_TRUE; + } + + EnterResourceNoLock<PPB_ImageData_API> enter(image, true); + if (enter.failed()) + return PP_FALSE; + PPB_ImageData_Impl* image_data = + static_cast<PPB_ImageData_Impl*>(enter.object()); + + ImageDataAutoMapper auto_mapper(image_data); + if (!auto_mapper.is_valid()) + return PP_FALSE; + + scoped_ptr<WebCursorInfo> custom_cursor( + new WebCursorInfo(WebCursorInfo::TypeCustom)); + custom_cursor->hotSpot.x = hot_spot->x; + custom_cursor->hotSpot.y = hot_spot->y; + +#if WEBKIT_USING_SKIA + const SkBitmap* bitmap = image_data->GetMappedBitmap(); + // Make a deep copy, so that the cursor remains valid even after the original + // image data gets freed. + if (!bitmap->copyTo(&custom_cursor->customImage.getSkBitmap(), + bitmap->config())) { + return PP_FALSE; + } +#elif WEBKIT_USING_CG + // TODO(yzshen): Implement it. + NOTIMPLEMENTED(); + return false; +#endif + + DoSetCursor(custom_cursor.release()); + return PP_TRUE; +} + int32_t PluginInstance::LockMouse(PP_Instance instance, PP_CompletionCallback callback) { if (!callback.func) { diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h index d19a709..7c8e0de 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.h +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h @@ -154,11 +154,6 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance : const GURL& plugin_url() const { return plugin_url_; } bool full_frame() const { return full_frame_; } const ::ppapi::ViewData& view_data() const { return view_data_; } - // If |type| is not PP_CURSORTYPE_CUSTOM, |custom_image| and |hot_spot| are - // ignored. - bool SetCursor(PP_CursorType_Dev type, - PP_Resource custom_image, - const PP_Point* hot_spot); // PPP_Instance and PPP_Instance_Private pass-through. bool Initialize(WebKit::WebPluginContainer* container, @@ -379,6 +374,10 @@ class WEBKIT_PLUGINS_EXPORT PluginInstance : double minimum_factor, double maximium_factor) OVERRIDE; virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; + virtual PP_Bool SetCursor(PP_Instance instance, + PP_MouseCursor_Type type, + PP_Resource image,
+ const PP_Point* hot_spot) OVERRIDE;
virtual int32_t LockMouse(PP_Instance instance, PP_CompletionCallback callback) OVERRIDE; virtual void UnlockMouse(PP_Instance instance) OVERRIDE; diff --git a/webkit/plugins/ppapi/ppb_cursor_control_impl.cc b/webkit/plugins/ppapi/ppb_cursor_control_impl.cc deleted file mode 100644 index 6525563..0000000 --- a/webkit/plugins/ppapi/ppb_cursor_control_impl.cc +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_cursor_control_impl.h" - -#include "base/logging.h" -#include "base/memory/ref_counted.h" -#include "ppapi/c/dev/pp_cursor_type_dev.h" -#include "ppapi/c/dev/ppb_cursor_control_dev.h" -#include "ppapi/c/pp_point.h" -#include "ppapi/c/pp_resource.h" -#include "webkit/plugins/ppapi/common.h" -#include "webkit/plugins/ppapi/ppb_image_data_impl.h" -#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" - -using ::ppapi::thunk::PPB_CursorControl_FunctionAPI; - -namespace webkit { -namespace ppapi { - -PPB_CursorControl_Impl::PPB_CursorControl_Impl(PluginInstance* instance) - : instance_(instance) { -} - -PPB_CursorControl_Impl::~PPB_CursorControl_Impl() { -} - -PPB_CursorControl_FunctionAPI* -PPB_CursorControl_Impl::AsPPB_CursorControl_FunctionAPI() { - return this; -} - -PP_Bool PPB_CursorControl_Impl::SetCursor(PP_Instance instance, - PP_CursorType_Dev type, - PP_Resource custom_image_id, - const PP_Point* hot_spot) { - return PP_FromBool(instance_->SetCursor(type, custom_image_id, hot_spot)); -} - -PP_Bool PPB_CursorControl_Impl::LockCursor(PP_Instance instance) { - // TODO: implement cursor locking. - return PP_FALSE; -} - -PP_Bool PPB_CursorControl_Impl::UnlockCursor(PP_Instance instance) { - // TODO: implement cursor locking. - return PP_FALSE; -} - -PP_Bool PPB_CursorControl_Impl::HasCursorLock(PP_Instance instance) { - // TODO: implement cursor locking. - return PP_FALSE; -} - -PP_Bool PPB_CursorControl_Impl::CanLockCursor(PP_Instance instance) { - // TODO: implement cursor locking. - return PP_FALSE; -} - -} // namespace ppapi -} // namespace webkit diff --git a/webkit/plugins/ppapi/ppb_cursor_control_impl.h b/webkit/plugins/ppapi/ppb_cursor_control_impl.h deleted file mode 100644 index 6b1242e..0000000 --- a/webkit/plugins/ppapi/ppb_cursor_control_impl.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2011 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. - -#ifndef WEBKIT_PLUGINS_PPAPI_PPB_CURSOR_CONTROL_IMPL_H_ -#define WEBKIT_PLUGINS_PPAPI_PPB_CURSOR_CONTROL_IMPL_H_ - -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "ppapi/shared_impl/function_group_base.h" -#include "ppapi/thunk/ppb_cursor_control_api.h" - -namespace webkit { -namespace ppapi { - -class PluginInstance; - -class PPB_CursorControl_Impl - : public ::ppapi::FunctionGroupBase, - public ::ppapi::thunk::PPB_CursorControl_FunctionAPI { - public: - PPB_CursorControl_Impl(PluginInstance* instance); - virtual ~PPB_CursorControl_Impl(); - - // FunctionGroupBase overrides. - virtual ::ppapi::thunk::PPB_CursorControl_FunctionAPI* - AsPPB_CursorControl_FunctionAPI() OVERRIDE; - - // PPB_CursorControl_FunctionAPI implementation. - virtual PP_Bool SetCursor(PP_Instance instance, - PP_CursorType_Dev type, - PP_Resource custom_image_id, - const PP_Point* hot_spot) OVERRIDE; - virtual PP_Bool LockCursor(PP_Instance instance) OVERRIDE; - virtual PP_Bool UnlockCursor(PP_Instance instance) OVERRIDE; - virtual PP_Bool HasCursorLock(PP_Instance instance) OVERRIDE; - virtual PP_Bool CanLockCursor(PP_Instance instance) OVERRIDE; - - private: - PluginInstance* instance_; - - DISALLOW_COPY_AND_ASSIGN(PPB_CursorControl_Impl); -}; - -} // namespace ppapi -} // namespace webkit - -#endif // WEBKIT_PLUGINS_PPAPI_PPB_CURSOR_CONTROL_IMPL_H_ - |