| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ppapi/thunk/thunk.h" | 5 #include "ppapi/thunk/thunk.h" |
| 6 #include "ppapi/thunk/enter.h" | 6 #include "ppapi/thunk/enter.h" |
| 7 #include "ppapi/thunk/ppb_widget_api.h" | 7 #include "ppapi/thunk/ppb_widget_api.h" |
| 8 #include "ppapi/thunk/resource_creation_api.h" | 8 #include "ppapi/thunk/resource_creation_api.h" |
| 9 | 9 |
| 10 namespace ppapi { | 10 namespace ppapi { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 return PP_FALSE; | 37 return PP_FALSE; |
| 38 return enter.object()->GetLocation(location); | 38 return enter.object()->GetLocation(location); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void SetLocation(PP_Resource widget, const PP_Rect* location) { | 41 void SetLocation(PP_Resource widget, const PP_Rect* location) { |
| 42 EnterResource<PPB_Widget_API> enter(widget, false); | 42 EnterResource<PPB_Widget_API> enter(widget, false); |
| 43 if (enter.succeeded()) | 43 if (enter.succeeded()) |
| 44 enter.object()->SetLocation(location); | 44 enter.object()->SetLocation(location); |
| 45 } | 45 } |
| 46 | 46 |
| 47 const PPB_Widget_Dev g_ppb_widget_thunk = { | 47 void SetScale(PP_Resource widget, float scale) { |
| 48 EnterResource<PPB_Widget_API> enter(widget, false); |
| 49 if (enter.succeeded()) |
| 50 enter.object()->SetScale(scale); |
| 51 } |
| 52 |
| 53 const PPB_Widget_Dev_0_3 g_ppb_widget_thunk_0_3 = { |
| 48 &IsWidget, | 54 &IsWidget, |
| 49 &Paint, | 55 &Paint, |
| 50 &HandleEvent, | 56 &HandleEvent, |
| 51 &GetLocation, | 57 &GetLocation, |
| 52 &SetLocation, | 58 &SetLocation, |
| 53 }; | 59 }; |
| 54 | 60 |
| 61 const PPB_Widget_Dev_0_4 g_ppb_widget_thunk_0_4 = { |
| 62 &IsWidget, |
| 63 &Paint, |
| 64 &HandleEvent, |
| 65 &GetLocation, |
| 66 &SetLocation, |
| 67 &SetScale |
| 68 }; |
| 69 |
| 55 } // namespace | 70 } // namespace |
| 56 | 71 |
| 57 const PPB_Widget_Dev_0_3* GetPPB_Widget_Dev_0_3_Thunk() { | 72 const PPB_Widget_Dev_0_3* GetPPB_Widget_Dev_0_3_Thunk() { |
| 58 return &g_ppb_widget_thunk; | 73 return &g_ppb_widget_thunk_0_3; |
| 74 } |
| 75 |
| 76 const PPB_Widget_Dev_0_4* GetPPB_Widget_Dev_0_4_Thunk() { |
| 77 return &g_ppb_widget_thunk_0_4; |
| 59 } | 78 } |
| 60 | 79 |
| 61 } // namespace thunk | 80 } // namespace thunk |
| 62 } // namespace ppapi | 81 } // namespace ppapi |
| OLD | NEW |