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