| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/pepper_cursor_control.h" | 5 #include "webkit/plugins/ppapi/ppb_cursor_control_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
| 9 #include "ppapi/c/dev/pp_cursor_type_dev.h" | 9 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
| 10 #include "ppapi/c/dev/ppb_cursor_control_dev.h" | 10 #include "ppapi/c/dev/ppb_cursor_control_dev.h" |
| 11 #include "ppapi/c/pp_point.h" | 11 #include "ppapi/c/pp_point.h" |
| 12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
| 13 #include "webkit/glue/plugins/pepper_common.h" | 13 #include "webkit/plugins/ppapi/common.h" |
| 14 #include "webkit/glue/plugins/pepper_image_data.h" | 14 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
| 15 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 15 #include "webkit/plugins/ppapi/plugin_instance.h" |
| 16 #include "webkit/glue/plugins/pepper_resource.h" | 16 #include "webkit/plugins/ppapi/resource.h" |
| 17 | 17 |
| 18 namespace pepper { | 18 namespace webkit { |
| 19 namespace plugins { |
| 20 namespace ppapi { |
| 19 | 21 |
| 20 namespace { | 22 namespace { |
| 21 | 23 |
| 22 PP_Bool SetCursor(PP_Instance instance_id, | 24 PP_Bool SetCursor(PP_Instance instance_id, |
| 23 PP_CursorType_Dev type, | 25 PP_CursorType_Dev type, |
| 24 PP_Resource custom_image_id, | 26 PP_Resource custom_image_id, |
| 25 const PP_Point* hot_spot) { | 27 const PP_Point* hot_spot) { |
| 26 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); | 28 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); |
| 27 if (!instance) | 29 if (!instance) |
| 28 return PP_FALSE; | 30 return PP_FALSE; |
| 29 | 31 |
| 30 scoped_refptr<ImageData> custom_image( | 32 scoped_refptr<PPB_ImageData_Impl> custom_image( |
| 31 Resource::GetAs<ImageData>(custom_image_id)); | 33 Resource::GetAs<PPB_ImageData_Impl>(custom_image_id)); |
| 32 if (custom_image.get()) { | 34 if (custom_image.get()) { |
| 33 // TODO(neb): implement custom cursors. | 35 // TODO(neb): implement custom cursors. |
| 34 NOTIMPLEMENTED(); | 36 NOTIMPLEMENTED(); |
| 35 return PP_FALSE; | 37 return PP_FALSE; |
| 36 } | 38 } |
| 37 | 39 |
| 38 return BoolToPPBool(instance->SetCursor(type)); | 40 return BoolToPPBool(instance->SetCursor(type)); |
| 39 } | 41 } |
| 40 | 42 |
| 41 PP_Bool LockCursor(PP_Instance instance_id) { | 43 PP_Bool LockCursor(PP_Instance instance_id) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 &HasCursorLock, | 83 &HasCursorLock, |
| 82 &CanLockCursor | 84 &CanLockCursor |
| 83 }; | 85 }; |
| 84 | 86 |
| 85 } // namespace | 87 } // namespace |
| 86 | 88 |
| 87 const PPB_CursorControl_Dev* GetCursorControlInterface() { | 89 const PPB_CursorControl_Dev* GetCursorControlInterface() { |
| 88 return &cursor_control_interface; | 90 return &cursor_control_interface; |
| 89 } | 91 } |
| 90 | 92 |
| 91 } // namespace pepper | 93 } // namespace ppapi |
| 94 } // namespace plugins |
| 95 } // namespace webkit |
| 92 | 96 |
| OLD | NEW |