OLD | NEW |
1 // Copyright (c) 2011 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 "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_scrollbar_api.h" | 7 #include "ppapi/thunk/ppb_scrollbar_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 15 matching lines...) Expand all Loading... |
26 return PP_FromBool(enter.succeeded()); | 26 return PP_FromBool(enter.succeeded()); |
27 } | 27 } |
28 | 28 |
29 uint32_t GetThickness(PP_Resource scrollbar) { | 29 uint32_t GetThickness(PP_Resource scrollbar) { |
30 EnterScrollbar enter(scrollbar, true); | 30 EnterScrollbar enter(scrollbar, true); |
31 if (enter.failed()) | 31 if (enter.failed()) |
32 return 0; | 32 return 0; |
33 return enter.object()->GetThickness(); | 33 return enter.object()->GetThickness(); |
34 } | 34 } |
35 | 35 |
| 36 PP_Bool IsOverlay(PP_Resource scrollbar) { |
| 37 EnterScrollbar enter(scrollbar, true); |
| 38 if (enter.failed()) |
| 39 return PP_FALSE; |
| 40 return PP_FromBool(enter.object()->IsOverlay()); |
| 41 } |
| 42 |
36 uint32_t GetValue(PP_Resource scrollbar) { | 43 uint32_t GetValue(PP_Resource scrollbar) { |
37 EnterScrollbar enter(scrollbar, true); | 44 EnterScrollbar enter(scrollbar, true); |
38 if (enter.failed()) | 45 if (enter.failed()) |
39 return 0; | 46 return 0; |
40 return enter.object()->GetValue(); | 47 return enter.object()->GetValue(); |
41 } | 48 } |
42 | 49 |
43 void SetValue(PP_Resource scrollbar, uint32_t value) { | 50 void SetValue(PP_Resource scrollbar, uint32_t value) { |
44 EnterScrollbar enter(scrollbar, true); | 51 EnterScrollbar enter(scrollbar, true); |
45 if (enter.succeeded()) | 52 if (enter.succeeded()) |
(...skipping 13 matching lines...) Expand all Loading... |
59 if (enter.succeeded()) | 66 if (enter.succeeded()) |
60 enter.object()->SetTickMarks(tick_marks, count); | 67 enter.object()->SetTickMarks(tick_marks, count); |
61 } | 68 } |
62 | 69 |
63 void ScrollBy(PP_Resource scrollbar, PP_ScrollBy_Dev unit, int32_t multiplier) { | 70 void ScrollBy(PP_Resource scrollbar, PP_ScrollBy_Dev unit, int32_t multiplier) { |
64 EnterScrollbar enter(scrollbar, true); | 71 EnterScrollbar enter(scrollbar, true); |
65 if (enter.succeeded()) | 72 if (enter.succeeded()) |
66 enter.object()->ScrollBy(unit, multiplier); | 73 enter.object()->ScrollBy(unit, multiplier); |
67 } | 74 } |
68 | 75 |
69 const PPB_Scrollbar_0_4_Dev g_ppb_scrollbar_thunk = { | 76 const PPB_Scrollbar_0_5_Dev g_ppb_scrollbar_thunk = { |
70 &Create, | 77 &Create, |
71 &IsScrollbar, | 78 &IsScrollbar, |
72 &GetThickness, | 79 &GetThickness, |
| 80 &IsOverlay, |
73 &GetValue, | 81 &GetValue, |
74 &SetValue, | 82 &SetValue, |
75 &SetDocumentSize, | 83 &SetDocumentSize, |
76 &SetTickMarks, | 84 &SetTickMarks, |
77 &ScrollBy | 85 &ScrollBy |
78 }; | 86 }; |
79 | 87 |
80 } // namespace | 88 } // namespace |
81 | 89 |
82 const PPB_Scrollbar_0_4_Dev* GetPPB_Scrollbar_Thunk() { | 90 const PPB_Scrollbar_0_5_Dev* GetPPB_Scrollbar_Thunk() { |
83 return &g_ppb_scrollbar_thunk; | 91 return &g_ppb_scrollbar_thunk; |
84 } | 92 } |
85 | 93 |
86 } // namespace thunk | 94 } // namespace thunk |
87 } // namespace ppapi | 95 } // namespace ppapi |
OLD | NEW |