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 ppapi { |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 PP_Bool SetCursor(PP_Instance instance_id, | 23 PP_Bool SetCursor(PP_Instance instance_id, |
23 PP_CursorType_Dev type, | 24 PP_CursorType_Dev type, |
24 PP_Resource custom_image_id, | 25 PP_Resource custom_image_id, |
25 const PP_Point* hot_spot) { | 26 const PP_Point* hot_spot) { |
26 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); | 27 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); |
27 if (!instance) | 28 if (!instance) |
28 return PP_FALSE; | 29 return PP_FALSE; |
29 | 30 |
30 scoped_refptr<ImageData> custom_image( | 31 scoped_refptr<PPB_ImageData_Impl> custom_image( |
31 Resource::GetAs<ImageData>(custom_image_id)); | 32 Resource::GetAs<PPB_ImageData_Impl>(custom_image_id)); |
32 if (custom_image.get()) { | 33 if (custom_image.get()) { |
33 // TODO(neb): implement custom cursors. | 34 // TODO(neb): implement custom cursors. |
34 NOTIMPLEMENTED(); | 35 NOTIMPLEMENTED(); |
35 return PP_FALSE; | 36 return PP_FALSE; |
36 } | 37 } |
37 | 38 |
38 return BoolToPPBool(instance->SetCursor(type)); | 39 return BoolToPPBool(instance->SetCursor(type)); |
39 } | 40 } |
40 | 41 |
41 PP_Bool LockCursor(PP_Instance instance_id) { | 42 PP_Bool LockCursor(PP_Instance instance_id) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 &HasCursorLock, | 82 &HasCursorLock, |
82 &CanLockCursor | 83 &CanLockCursor |
83 }; | 84 }; |
84 | 85 |
85 } // namespace | 86 } // namespace |
86 | 87 |
87 const PPB_CursorControl_Dev* GetCursorControlInterface() { | 88 const PPB_CursorControl_Dev* GetCursorControlInterface() { |
88 return &cursor_control_interface; | 89 return &cursor_control_interface; |
89 } | 90 } |
90 | 91 |
91 } // namespace pepper | 92 } // namespace ppapi |
| 93 } // namespace webkit |
92 | 94 |
OLD | NEW |