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 Thu Mar 28 11:12:59 2013. | 5 // From ppb_view.idl modified Thu Mar 28 11:12:59 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" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 PP_Bool GetClipRect(PP_Resource resource, struct PP_Rect* clip) { | 59 PP_Bool GetClipRect(PP_Resource resource, struct PP_Rect* clip) { |
60 VLOG(4) << "PPB_View::GetClipRect()"; | 60 VLOG(4) << "PPB_View::GetClipRect()"; |
61 EnterResource<PPB_View_API> enter(resource, true); | 61 EnterResource<PPB_View_API> enter(resource, true); |
62 if (enter.failed()) | 62 if (enter.failed()) |
63 return PP_FALSE; | 63 return PP_FALSE; |
64 return enter.object()->GetClipRect(clip); | 64 return enter.object()->GetClipRect(clip); |
65 } | 65 } |
66 | 66 |
| 67 float GetDeviceScale(PP_Resource resource) { |
| 68 EnterResource<PPB_View_API> enter(resource, true); |
| 69 if (enter.failed()) |
| 70 return 0.0f; |
| 71 return enter.object()->GetDeviceScale(); |
| 72 } |
| 73 |
| 74 float GetCSSScale(PP_Resource resource) { |
| 75 EnterResource<PPB_View_API> enter(resource, true); |
| 76 if (enter.failed()) |
| 77 return 0.0f; |
| 78 return enter.object()->GetCSSScale(); |
| 79 } |
| 80 |
67 const PPB_View_1_0 g_ppb_view_thunk_1_0 = { | 81 const PPB_View_1_0 g_ppb_view_thunk_1_0 = { |
68 &IsView, | 82 &IsView, |
69 &GetRect, | 83 &GetRect, |
70 &IsFullscreen, | 84 &IsFullscreen, |
71 &IsVisible, | 85 &IsVisible, |
72 &IsPageVisible, | 86 &IsPageVisible, |
73 &GetClipRect | 87 &GetClipRect |
74 }; | 88 }; |
75 | 89 |
| 90 const PPB_View_1_1 g_ppb_view_thunk_1_1 = { |
| 91 &IsView, |
| 92 &GetRect, |
| 93 &IsFullscreen, |
| 94 &IsVisible, |
| 95 &IsPageVisible, |
| 96 &GetClipRect, |
| 97 &GetDeviceScale, |
| 98 &GetCSSScale |
| 99 }; |
| 100 |
76 } // namespace | 101 } // namespace |
77 | 102 |
78 const PPB_View_1_0* GetPPB_View_1_0_Thunk() { | 103 const PPB_View_1_0* GetPPB_View_1_0_Thunk() { |
79 return &g_ppb_view_thunk_1_0; | 104 return &g_ppb_view_thunk_1_0; |
80 } | 105 } |
81 | 106 |
| 107 const PPB_View_1_1* GetPPB_View_1_1_Thunk() { |
| 108 return &g_ppb_view_thunk_1_1; |
| 109 } |
| 110 |
82 } // namespace thunk | 111 } // namespace thunk |
83 } // namespace ppapi | 112 } // namespace ppapi |
OLD | NEW |