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 // From ppb_view.idl modified Fri Feb 8 14:28:54 2013. | 5 // From ppb_view.idl modified Thu Mar 21 11:28:20 2013. |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/ppb_view.h" | 8 #include "ppapi/c/ppb_view.h" |
9 #include "ppapi/shared_impl/tracked_callback.h" | 9 #include "ppapi/shared_impl/tracked_callback.h" |
10 #include "ppapi/thunk/enter.h" | 10 #include "ppapi/thunk/enter.h" |
11 #include "ppapi/thunk/ppb_instance_api.h" | 11 #include "ppapi/thunk/ppb_instance_api.h" |
12 #include "ppapi/thunk/ppb_view_api.h" | 12 #include "ppapi/thunk/ppb_view_api.h" |
13 #include "ppapi/thunk/resource_creation_api.h" | 13 #include "ppapi/thunk/resource_creation_api.h" |
14 #include "ppapi/thunk/thunk.h" | 14 #include "ppapi/thunk/thunk.h" |
15 | 15 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return enter.object()->IsPageVisible(); | 51 return enter.object()->IsPageVisible(); |
52 } | 52 } |
53 | 53 |
54 PP_Bool GetClipRect(PP_Resource resource, struct PP_Rect* clip) { | 54 PP_Bool GetClipRect(PP_Resource resource, struct PP_Rect* clip) { |
55 EnterResource<PPB_View_API> enter(resource, true); | 55 EnterResource<PPB_View_API> enter(resource, true); |
56 if (enter.failed()) | 56 if (enter.failed()) |
57 return PP_FALSE; | 57 return PP_FALSE; |
58 return enter.object()->GetClipRect(clip); | 58 return enter.object()->GetClipRect(clip); |
59 } | 59 } |
60 | 60 |
| 61 float GetDeviceScale(PP_Resource resource) { |
| 62 EnterResource<PPB_View_API> enter(resource, true); |
| 63 if (enter.failed()) |
| 64 return 0.0f; |
| 65 return enter.object()->GetDeviceScale(); |
| 66 } |
| 67 |
| 68 float GetCSSScale(PP_Resource resource) { |
| 69 EnterResource<PPB_View_API> enter(resource, true); |
| 70 if (enter.failed()) |
| 71 return 0.0f; |
| 72 return enter.object()->GetCSSScale(); |
| 73 } |
| 74 |
61 const PPB_View_1_0 g_ppb_view_thunk_1_0 = { | 75 const PPB_View_1_0 g_ppb_view_thunk_1_0 = { |
62 &IsView, | 76 &IsView, |
63 &GetRect, | 77 &GetRect, |
64 &IsFullscreen, | 78 &IsFullscreen, |
65 &IsVisible, | 79 &IsVisible, |
66 &IsPageVisible, | 80 &IsPageVisible, |
67 &GetClipRect | 81 &GetClipRect |
68 }; | 82 }; |
69 | 83 |
| 84 const PPB_View_1_1 g_ppb_view_thunk_1_1 = { |
| 85 &IsView, |
| 86 &GetRect, |
| 87 &IsFullscreen, |
| 88 &IsVisible, |
| 89 &IsPageVisible, |
| 90 &GetClipRect, |
| 91 &GetDeviceScale, |
| 92 &GetCSSScale |
| 93 }; |
| 94 |
70 } // namespace | 95 } // namespace |
71 | 96 |
72 const PPB_View_1_0* GetPPB_View_1_0_Thunk() { | 97 const PPB_View_1_0* GetPPB_View_1_0_Thunk() { |
73 return &g_ppb_view_thunk_1_0; | 98 return &g_ppb_view_thunk_1_0; |
74 } | 99 } |
75 | 100 |
| 101 const PPB_View_1_1* GetPPB_View_1_1_Thunk() { |
| 102 return &g_ppb_view_thunk_1_1; |
| 103 } |
| 104 |
76 } // namespace thunk | 105 } // namespace thunk |
77 } // namespace ppapi | 106 } // namespace ppapi |
OLD | NEW |