From 41869539b903260815feae1501a29cbc470c3d20 Mon Sep 17 00:00:00 2001 From: "avi@chromium.org" Date: Thu, 24 Feb 2011 19:19:13 +0000 Subject: Pin the PPAPI custom cursor value. PPAPI is intended to be frozen, so make space now for expanding the number of named cursors. BUG=73356 TEST=no visible change; PPAPI custom cursors are currently not implemented anyway Review URL: http://codereview.chromium.org/6576034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75928 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/c/dev/pp_cursor_type_dev.h | 6 +++--- webkit/plugins/ppapi/ppapi_plugin_instance.cc | 11 +++++++++-- webkit/plugins/ppapi/ppb_cursor_control_impl.cc | 3 ++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ppapi/c/dev/pp_cursor_type_dev.h b/ppapi/c/dev/pp_cursor_type_dev.h index 454e55b..c305797 100644 --- a/ppapi/c/dev/pp_cursor_type_dev.h +++ b/ppapi/c/dev/pp_cursor_type_dev.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010 The Chromium Authors. All rights reserved. +/* 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. */ @@ -8,6 +8,7 @@ #include "ppapi/c/pp_macros.h" enum PP_CursorType_Dev { + PP_CURSORTYPE_CUSTOM = -1, PP_CURSORTYPE_POINTER = 0, PP_CURSORTYPE_CROSS = 1, PP_CURSORTYPE_HAND = 2, @@ -48,8 +49,7 @@ enum PP_CursorType_Dev { PP_CURSORTYPE_NONE = 37, PP_CURSORTYPE_NOTALLOWED = 38, PP_CURSORTYPE_ZOOMIN = 39, - PP_CURSORTYPE_ZOOMOUT = 40, - PP_CURSORTYPE_CUSTOM = 41 + PP_CURSORTYPE_ZOOMOUT = 40 }; PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_CursorType_Dev, 4); diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index 421d676..bd4264c 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// 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. @@ -145,7 +145,8 @@ 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(TypeCustom, PP_CURSORTYPE_CUSTOM); +// Do not assert WebCursorInfo::TypeCustom == PP_CURSORTYPE_CUSTOM; +// PP_CURSORTYPE_CUSTOM is pinned to allow new cursor types. void RectToPPRect(const gfx::Rect& input, PP_Rect* output) { *output = PP_MakeRectFromXYWH(input.x(), input.y(), @@ -511,6 +512,12 @@ bool PluginInstance::BindGraphics(PP_Resource graphics_id) { } bool PluginInstance::SetCursor(PP_CursorType_Dev type) { + if (type == PP_CURSORTYPE_CUSTOM) { + // TODO(neb): implement custom cursors. + // (Remember that PP_CURSORTYPE_CUSTOM != WebCursorInfo::TypeCustom.) + NOTIMPLEMENTED(); + return false; + } cursor_.reset(new WebCursorInfo(static_cast(type))); return true; } diff --git a/webkit/plugins/ppapi/ppb_cursor_control_impl.cc b/webkit/plugins/ppapi/ppb_cursor_control_impl.cc index d7b5119..83c004d 100644 --- a/webkit/plugins/ppapi/ppb_cursor_control_impl.cc +++ b/webkit/plugins/ppapi/ppb_cursor_control_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// 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. @@ -32,6 +32,7 @@ PP_Bool SetCursor(PP_Instance instance_id, Resource::GetAs(custom_image_id)); if (custom_image.get()) { // TODO(neb): implement custom cursors. + // (Remember that PP_CURSORTYPE_CUSTOM != WebCursorInfo::TypeCustom.) NOTIMPLEMENTED(); return PP_FALSE; } -- cgit v1.1