OLD | NEW |
1 // Copyright (c) 2011 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 "native_client/src/shared/ppapi_proxy/plugin_ppb_zoom.h" | 5 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_zoom.h" |
6 | 6 |
7 #include "native_client/src/include/portability.h" | 7 #include "native_client/src/include/portability.h" |
8 #include "native_client/src/shared/ppapi_proxy/plugin_callback.h" | 8 #include "native_client/src/shared/ppapi_proxy/plugin_callback.h" |
9 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" | 9 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" |
10 #include "native_client/src/shared/ppapi_proxy/utility.h" | 10 #include "native_client/src/shared/ppapi_proxy/utility.h" |
11 #include "ppapi/c/dev/ppb_zoom_dev.h" | 11 #include "ppapi/c/dev/ppb_zoom_dev.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_errors.h" | 13 #include "ppapi/c/pp_errors.h" |
14 #include "srpcgen/ppb_rpc.h" | 14 #include "srpcgen/ppb_rpc.h" |
15 | 15 |
16 namespace ppapi_proxy { | 16 namespace ppapi_proxy { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 void ZoomChanged(PP_Instance instance, | 20 void ZoomChanged(PP_Instance instance, |
21 double factor) { | 21 double factor) { |
22 DebugPrintf("PPB_Zoom::ZoomChanged: " | 22 DebugPrintf("PPB_Zoom::ZoomChanged: " |
23 "instance=%"NACL_PRIu32"\n", instance); | 23 "instance=%"NACL_PRId32"\n", instance); |
24 | 24 |
25 NaClSrpcError srpc_result = | 25 NaClSrpcError srpc_result = |
26 PpbZoomRpcClient::PPB_Zoom_ZoomChanged( | 26 PpbZoomRpcClient::PPB_Zoom_ZoomChanged( |
27 GetMainSrpcChannel(), | 27 GetMainSrpcChannel(), |
28 instance, | 28 instance, |
29 factor); | 29 factor); |
30 | 30 |
31 DebugPrintf("PPB_Zoom::ZoomChanged: %s\n", | 31 DebugPrintf("PPB_Zoom::ZoomChanged: %s\n", |
32 NaClSrpcErrorString(srpc_result)); | 32 NaClSrpcErrorString(srpc_result)); |
33 } | 33 } |
34 | 34 |
35 void ZoomLimitsChanged(PP_Instance instance, | 35 void ZoomLimitsChanged(PP_Instance instance, |
36 double minimum_factor, | 36 double minimum_factor, |
37 double maximum_factor) { | 37 double maximum_factor) { |
38 DebugPrintf("PPB_Zoom::ZoomLimitsChanged: " | 38 DebugPrintf("PPB_Zoom::ZoomLimitsChanged: " |
39 "instance=%"NACL_PRIu32"\n", instance); | 39 "instance=%"NACL_PRId32"\n", instance); |
40 | 40 |
41 NaClSrpcError srpc_result = | 41 NaClSrpcError srpc_result = |
42 PpbZoomRpcClient::PPB_Zoom_ZoomLimitsChanged( | 42 PpbZoomRpcClient::PPB_Zoom_ZoomLimitsChanged( |
43 GetMainSrpcChannel(), | 43 GetMainSrpcChannel(), |
44 instance, | 44 instance, |
45 minimum_factor, | 45 minimum_factor, |
46 maximum_factor); | 46 maximum_factor); |
47 | 47 |
48 DebugPrintf("PPB_Zoom::ZoomLimitsChanged: %s\n", | 48 DebugPrintf("PPB_Zoom::ZoomLimitsChanged: %s\n", |
49 NaClSrpcErrorString(srpc_result)); | 49 NaClSrpcErrorString(srpc_result)); |
50 } | 50 } |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 const PPB_Zoom_Dev* PluginZoom::GetInterface() { | 54 const PPB_Zoom_Dev* PluginZoom::GetInterface() { |
55 static const PPB_Zoom_Dev zoom_interface = { | 55 static const PPB_Zoom_Dev zoom_interface = { |
56 ZoomChanged, | 56 ZoomChanged, |
57 ZoomLimitsChanged | 57 ZoomLimitsChanged |
58 }; | 58 }; |
59 return &zoom_interface; | 59 return &zoom_interface; |
60 } | 60 } |
61 | 61 |
62 } // namespace ppapi_proxy | 62 } // namespace ppapi_proxy |
63 | |
64 | |
OLD | NEW |