OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ppapi/thunk/thunk.h" |
| 6 #include "ppapi/thunk/enter.h" |
| 7 #include "ppapi/thunk/ppb_scrollbar_group_api.h" |
| 8 #include "ppapi/thunk/resource_creation_api.h" |
| 9 |
| 10 namespace ppapi { |
| 11 namespace thunk { |
| 12 |
| 13 typedef EnterResource<PPB_ScrollbarGroup_API> EnterScrollbarGroup; |
| 14 |
| 15 namespace { |
| 16 |
| 17 PP_Resource Create(PP_Instance instance) { |
| 18 EnterFunction<ResourceCreationAPI> enter(instance, true); |
| 19 if (enter.failed()) |
| 20 return 0; |
| 21 return enter.functions()->CreateScrollbarGroup(instance); |
| 22 } |
| 23 |
| 24 void MouseEnteredContentArea(PP_Resource resource) { |
| 25 EnterScrollbarGroup enter(resource, false); |
| 26 if (!enter.failed()) |
| 27 enter.object()->MouseEnteredContentArea(); |
| 28 } |
| 29 |
| 30 void MouseMovedInContentArea(PP_Resource scrollbar) { |
| 31 EnterScrollbarGroup enter(scrollbar, true); |
| 32 if (!enter.failed()) |
| 33 enter.object()->MouseMovedInContentArea(); |
| 34 } |
| 35 |
| 36 void MouseExitedContentArea(PP_Resource scrollbar) { |
| 37 EnterScrollbarGroup enter(scrollbar, true); |
| 38 if (!enter.failed()) |
| 39 enter.object()->MouseExitedContentArea(); |
| 40 } |
| 41 |
| 42 void WillStartLiveResize(PP_Resource resource) { |
| 43 EnterScrollbarGroup enter(resource, false); |
| 44 if (!enter.failed()) |
| 45 enter.object()->WillStartLiveResize(); |
| 46 } |
| 47 |
| 48 void ContentResized(PP_Resource scrollbar) { |
| 49 EnterScrollbarGroup enter(scrollbar, true); |
| 50 if (!enter.failed()) |
| 51 enter.object()->ContentResized(); |
| 52 } |
| 53 |
| 54 void WillEndLiveResize(PP_Resource scrollbar) { |
| 55 EnterScrollbarGroup enter(scrollbar, true); |
| 56 if (!enter.failed()) |
| 57 enter.object()->WillEndLiveResize(); |
| 58 } |
| 59 |
| 60 const PPB_ScrollbarGroup_Dev g_ppb_scrollbar_group_thunk = { |
| 61 &Create, |
| 62 &MouseEnteredContentArea, |
| 63 &MouseMovedInContentArea, |
| 64 &MouseExitedContentArea, |
| 65 &WillStartLiveResize, |
| 66 &ContentResized, |
| 67 &WillEndLiveResize |
| 68 }; |
| 69 |
| 70 } // namespace |
| 71 |
| 72 const PPB_ScrollbarGroup_Dev* GetPPB_ScrollbarGroup_Thunk() { |
| 73 return &g_ppb_scrollbar_group_thunk; |
| 74 } |
| 75 |
| 76 } // namespace thunk |
| 77 } // namespace ppapi |
OLD | NEW |