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/glue/plugins/pepper_cursor_control.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 "third_party/ppapi/c/pp_cursor_type.h" | 9 #include "third_party/ppapi/c/dev/pp_cursor_type_dev.h" |
| 10 #include "third_party/ppapi/c/dev/ppb_cursor_control_dev.h" |
10 #include "third_party/ppapi/c/pp_point.h" | 11 #include "third_party/ppapi/c/pp_point.h" |
11 #include "third_party/ppapi/c/pp_resource.h" | 12 #include "third_party/ppapi/c/pp_resource.h" |
12 #include "third_party/ppapi/c/ppb_cursor_control.h" | |
13 #include "webkit/glue/plugins/pepper_image_data.h" | 13 #include "webkit/glue/plugins/pepper_image_data.h" |
14 #include "webkit/glue/plugins/pepper_plugin_instance.h" | 14 #include "webkit/glue/plugins/pepper_plugin_instance.h" |
15 #include "webkit/glue/plugins/pepper_resource.h" | 15 #include "webkit/glue/plugins/pepper_resource.h" |
16 | 16 |
17 namespace pepper { | 17 namespace pepper { |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 bool SetCursor(PP_Instance instance_id, | 21 bool SetCursor(PP_Instance instance_id, |
22 PP_CursorType type, | 22 PP_CursorType_Dev type, |
23 PP_Resource custom_image_id, | 23 PP_Resource custom_image_id, |
24 const PP_Point* hot_spot) { | 24 const PP_Point* hot_spot) { |
25 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); | 25 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); |
26 if (!instance) | 26 if (!instance) |
27 return false; | 27 return false; |
28 | 28 |
29 scoped_refptr<ImageData> custom_image( | 29 scoped_refptr<ImageData> custom_image( |
30 Resource::GetAs<ImageData>(custom_image_id)); | 30 Resource::GetAs<ImageData>(custom_image_id)); |
31 if (custom_image.get()) { | 31 if (custom_image.get()) { |
32 // TODO(neb): implement custom cursors. | 32 // TODO(neb): implement custom cursors. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 bool CanLockCursor(PP_Instance) { | 67 bool CanLockCursor(PP_Instance) { |
68 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); | 68 PluginInstance* instance = PluginInstance::FromPPInstance(instance_id); |
69 if (!instance) | 69 if (!instance) |
70 return false; | 70 return false; |
71 | 71 |
72 // TODO(neb): implement cursor locking. | 72 // TODO(neb): implement cursor locking. |
73 return false; | 73 return false; |
74 } | 74 } |
75 | 75 |
76 const PPB_CursorControl cursor_control_interface = { | 76 const PPB_CursorControl_Dev cursor_control_interface = { |
77 &SetCursor, | 77 &SetCursor, |
78 &LockCursor, | 78 &LockCursor, |
79 &UnlockCursor, | 79 &UnlockCursor, |
80 &HasCursorLock, | 80 &HasCursorLock, |
81 &CanLockCursor | 81 &CanLockCursor |
82 }; | 82 }; |
83 | 83 |
84 } // namespace | 84 } // namespace |
85 | 85 |
86 const PPB_CursorControl* GetCursorControlInterface() { | 86 const PPB_CursorControl_Dev* GetCursorControlInterface() { |
87 return &cursor_control_interface; | 87 return &cursor_control_interface; |
88 } | 88 } |
89 | 89 |
90 } // namespace pepper | 90 } // namespace pepper |
91 | 91 |
OLD | NEW |