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/browser_ppp_scrollbar.h" | 5 #include "native_client/src/shared/ppapi_proxy/browser_ppp_scrollbar.h" |
6 | 6 |
7 // Include file order cannot be observed because ppp_instance declares a | 7 // Include file order cannot be observed because ppp_instance declares a |
8 // structure return type that causes an error on Windows. | 8 // structure return type that causes an error on Windows. |
9 // TODO(sehr, brettw): fix the return types and include order in PPAPI. | 9 // TODO(sehr, brettw): fix the return types and include order in PPAPI. |
10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
12 #include "srpcgen/ppp_rpc.h" | 12 #include "srpcgen/ppp_rpc.h" |
13 #include "native_client/src/include/portability.h" | 13 #include "native_client/src/include/portability.h" |
14 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" | 14 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" |
15 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" | 15 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" |
16 #include "native_client/src/shared/ppapi_proxy/utility.h" | 16 #include "native_client/src/shared/ppapi_proxy/utility.h" |
17 | 17 |
18 namespace ppapi_proxy { | 18 namespace ppapi_proxy { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 void ValueChanged( | 22 void ValueChanged( |
23 PP_Instance instance, | 23 PP_Instance instance, |
24 PP_Resource resource, | 24 PP_Resource resource, |
25 uint32_t value) { | 25 uint32_t value) { |
26 DebugPrintf("PPP_Scrollbar_Dev::ValueChanged: instance=%"NACL_PRIu32"\n", | 26 DebugPrintf("PPP_Scrollbar_Dev::ValueChanged: instance=%"NACL_PRId32"\n", |
27 instance); | 27 instance); |
28 | 28 |
29 NaClSrpcError srpc_result = PppScrollbarRpcClient::PPP_Scrollbar_ValueChanged( | 29 NaClSrpcError srpc_result = PppScrollbarRpcClient::PPP_Scrollbar_ValueChanged( |
30 GetMainSrpcChannel(instance), | 30 GetMainSrpcChannel(instance), |
31 instance, | 31 instance, |
32 resource, | 32 resource, |
33 value); | 33 value); |
34 | 34 |
35 DebugPrintf("PPP_Scrollbar_Dev::ValueChanged: %s\n", | 35 DebugPrintf("PPP_Scrollbar_Dev::ValueChanged: %s\n", |
36 NaClSrpcErrorString(srpc_result)); | 36 NaClSrpcErrorString(srpc_result)); |
37 } | 37 } |
38 | 38 |
39 void OverlayChanged( | 39 void OverlayChanged( |
40 PP_Instance instance, | 40 PP_Instance instance, |
41 PP_Resource resource, | 41 PP_Resource resource, |
42 PP_Bool type) { | 42 PP_Bool type) { |
43 DebugPrintf("PPP_Scrollbar_Dev::OverlayChanged: instance=%"NACL_PRIu32"\n", | 43 DebugPrintf("PPP_Scrollbar_Dev::OverlayChanged: instance=%"NACL_PRId32"\n", |
44 instance); | 44 instance); |
45 | 45 |
46 NaClSrpcError srpc_result = | 46 NaClSrpcError srpc_result = |
47 PppScrollbarRpcClient::PPP_Scrollbar_OverlayChanged( | 47 PppScrollbarRpcClient::PPP_Scrollbar_OverlayChanged( |
48 GetMainSrpcChannel(instance), | 48 GetMainSrpcChannel(instance), |
49 instance, | 49 instance, |
50 resource, | 50 resource, |
51 type); | 51 type); |
52 | 52 |
53 DebugPrintf("PPP_Scrollbar_Dev::OverlayChanged: %s\n", | 53 DebugPrintf("PPP_Scrollbar_Dev::OverlayChanged: %s\n", |
54 NaClSrpcErrorString(srpc_result)); | 54 NaClSrpcErrorString(srpc_result)); |
55 } | 55 } |
56 | 56 |
57 } // namespace | 57 } // namespace |
58 | 58 |
59 const PPP_Scrollbar_Dev* BrowserScrollbar::GetInterface() { | 59 const PPP_Scrollbar_Dev* BrowserScrollbar::GetInterface() { |
60 static const PPP_Scrollbar_Dev scrollbar_interface = { | 60 static const PPP_Scrollbar_Dev scrollbar_interface = { |
61 ValueChanged, | 61 ValueChanged, |
62 OverlayChanged | 62 OverlayChanged |
63 }; | 63 }; |
64 return &scrollbar_interface; | 64 return &scrollbar_interface; |
65 } | 65 } |
66 | 66 |
67 } // namespace ppapi_proxy | 67 } // namespace ppapi_proxy |
68 | |
OLD | NEW |