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_find.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_find_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 NumberOfFindResultsChanged(PP_Instance instance, |
| 21 int32_t total, |
| 22 PP_Bool final_result) { |
| 23 DebugPrintf("PPB_Find::NumberOfFindResultsChanged: " |
| 24 "instance=%"NACL_PRIu32"\n", instance); |
| 25 |
| 26 NaClSrpcError srpc_result = |
| 27 PpbFindRpcClient::PPB_Find_NumberOfFindResultsChanged( |
| 28 GetMainSrpcChannel(), |
| 29 instance, |
| 30 total, |
| 31 final_result == PP_TRUE); |
| 32 |
| 33 DebugPrintf("PPB_Find::NumberOfFindResultsChanged: %s\n", |
| 34 NaClSrpcErrorString(srpc_result)); |
| 35 } |
| 36 |
| 37 void SelectedFindResultChanged(PP_Instance instance, |
| 38 int32_t index) { |
| 39 DebugPrintf("PPB_Find::SelectedFindResultChanged: " |
| 40 "instance=%"NACL_PRIu32"\n", instance); |
| 41 |
| 42 NaClSrpcError srpc_result = |
| 43 PpbFindRpcClient::PPB_Find_SelectedFindResultChanged( |
| 44 GetMainSrpcChannel(), |
| 45 instance, |
| 46 index); |
| 47 |
| 48 DebugPrintf("PPB_Find::SelectedFindResultChanged: %s\n", |
| 49 NaClSrpcErrorString(srpc_result)); |
| 50 } |
| 51 |
| 52 } // namespace |
| 53 |
| 54 const PPB_Find_Dev* PluginFind::GetInterface() { |
| 55 static const PPB_Find_Dev find_interface = { |
| 56 NumberOfFindResultsChanged, |
| 57 SelectedFindResultChanged |
| 58 }; |
| 59 return &find_interface; |
| 60 } |
| 61 |
| 62 } // namespace ppapi_proxy |
| 63 |
| 64 |
OLD | NEW |