OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/plugins/ppapi/ppb_cursor_control_impl.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" |
(...skipping 13 matching lines...) Expand all Loading... |
25 PP_Resource custom_image_id, | 25 PP_Resource custom_image_id, |
26 const PP_Point* hot_spot) { | 26 const PP_Point* hot_spot) { |
27 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); | 27 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); |
28 if (!instance) | 28 if (!instance) |
29 return PP_FALSE; | 29 return PP_FALSE; |
30 | 30 |
31 scoped_refptr<PPB_ImageData_Impl> custom_image( | 31 scoped_refptr<PPB_ImageData_Impl> custom_image( |
32 Resource::GetAs<PPB_ImageData_Impl>(custom_image_id)); | 32 Resource::GetAs<PPB_ImageData_Impl>(custom_image_id)); |
33 if (custom_image.get()) { | 33 if (custom_image.get()) { |
34 // TODO(neb): implement custom cursors. | 34 // TODO(neb): implement custom cursors. |
| 35 // (Remember that PP_CURSORTYPE_CUSTOM != WebCursorInfo::TypeCustom.) |
35 NOTIMPLEMENTED(); | 36 NOTIMPLEMENTED(); |
36 return PP_FALSE; | 37 return PP_FALSE; |
37 } | 38 } |
38 | 39 |
39 return BoolToPPBool(instance->SetCursor(type)); | 40 return BoolToPPBool(instance->SetCursor(type)); |
40 } | 41 } |
41 | 42 |
42 PP_Bool LockCursor(PP_Instance instance_id) { | 43 PP_Bool LockCursor(PP_Instance instance_id) { |
43 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); | 44 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); |
44 if (!instance) | 45 if (!instance) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 86 |
86 } // namespace | 87 } // namespace |
87 | 88 |
88 const PPB_CursorControl_Dev* GetCursorControlInterface() { | 89 const PPB_CursorControl_Dev* GetCursorControlInterface() { |
89 return &cursor_control_interface; | 90 return &cursor_control_interface; |
90 } | 91 } |
91 | 92 |
92 } // namespace ppapi | 93 } // namespace ppapi |
93 } // namespace webkit | 94 } // namespace webkit |
94 | 95 |
OLD | NEW |