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 #include "ppapi/proxy/ppb_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/pp_time.h" | 10 #include "ppapi/c/pp_time.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ExecuteScript, | 126 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ExecuteScript, |
127 OnHostMsgExecuteScript) | 127 OnHostMsgExecuteScript) |
128 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDefaultCharSet, | 128 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDefaultCharSet, |
129 OnHostMsgGetDefaultCharSet) | 129 OnHostMsgGetDefaultCharSet) |
130 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetPluginToHandleFindRequests, | 130 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetPluginToHandleFindRequests, |
131 OnHostMsgSetPluginToHandleFindRequests); | 131 OnHostMsgSetPluginToHandleFindRequests); |
132 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_NumberOfFindResultsChanged, | 132 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_NumberOfFindResultsChanged, |
133 OnHostMsgNumberOfFindResultsChanged) | 133 OnHostMsgNumberOfFindResultsChanged) |
134 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SelectFindResultChanged, | 134 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SelectFindResultChanged, |
135 OnHostMsgSelectFindResultChanged) | 135 OnHostMsgSelectFindResultChanged) |
| 136 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetTickmarks, |
| 137 OnHostMsgSetTickmarks) |
136 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PostMessage, | 138 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PostMessage, |
137 OnHostMsgPostMessage) | 139 OnHostMsgPostMessage) |
138 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetFullscreen, | 140 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetFullscreen, |
139 OnHostMsgSetFullscreen) | 141 OnHostMsgSetFullscreen) |
140 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetScreenSize, | 142 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetScreenSize, |
141 OnHostMsgGetScreenSize) | 143 OnHostMsgGetScreenSize) |
142 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_RequestInputEvents, | 144 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_RequestInputEvents, |
143 OnHostMsgRequestInputEvents) | 145 OnHostMsgRequestInputEvents) |
144 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ClearInputEvents, | 146 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ClearInputEvents, |
145 OnHostMsgClearInputEvents) | 147 OnHostMsgClearInputEvents) |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 dispatcher()->Send(new PpapiHostMsg_PPBInstance_NumberOfFindResultsChanged( | 330 dispatcher()->Send(new PpapiHostMsg_PPBInstance_NumberOfFindResultsChanged( |
329 API_ID_PPB_INSTANCE, instance, total, final_result)); | 331 API_ID_PPB_INSTANCE, instance, total, final_result)); |
330 } | 332 } |
331 | 333 |
332 void PPB_Instance_Proxy::SelectedFindResultChanged(PP_Instance instance, | 334 void PPB_Instance_Proxy::SelectedFindResultChanged(PP_Instance instance, |
333 int32_t index) { | 335 int32_t index) { |
334 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SelectFindResultChanged( | 336 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SelectFindResultChanged( |
335 API_ID_PPB_INSTANCE, instance, index)); | 337 API_ID_PPB_INSTANCE, instance, index)); |
336 } | 338 } |
337 | 339 |
| 340 void PPB_Instance_Proxy::SetTickmarks(PP_Instance instance, |
| 341 const PP_Rect* tickmarks, |
| 342 uint32_t count) { |
| 343 dispatcher()->Send(new PpapiHostMsg_PPBInstance_SetTickmarks( |
| 344 API_ID_PPB_INSTANCE, instance, |
| 345 std::vector<PP_Rect>(tickmarks, tickmarks + count))); |
| 346 } |
| 347 |
338 PP_Bool PPB_Instance_Proxy::IsFullscreen(PP_Instance instance) { | 348 PP_Bool PPB_Instance_Proxy::IsFullscreen(PP_Instance instance) { |
339 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 349 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
340 GetInstanceData(instance); | 350 GetInstanceData(instance); |
341 if (!data) | 351 if (!data) |
342 return PP_FALSE; | 352 return PP_FALSE; |
343 return PP_FromBool(data->view.is_fullscreen); | 353 return PP_FromBool(data->view.is_fullscreen); |
344 } | 354 } |
345 | 355 |
346 PP_Bool PPB_Instance_Proxy::SetFullscreen(PP_Instance instance, | 356 PP_Bool PPB_Instance_Proxy::SetFullscreen(PP_Instance instance, |
347 PP_Bool fullscreen) { | 357 PP_Bool fullscreen) { |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 void PPB_Instance_Proxy::OnHostMsgSelectFindResultChanged( | 947 void PPB_Instance_Proxy::OnHostMsgSelectFindResultChanged( |
938 PP_Instance instance, | 948 PP_Instance instance, |
939 int32_t index) { | 949 int32_t index) { |
940 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) | 950 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
941 return; | 951 return; |
942 EnterInstanceNoLock enter(instance); | 952 EnterInstanceNoLock enter(instance); |
943 if (enter.succeeded()) | 953 if (enter.succeeded()) |
944 enter.functions()->SelectedFindResultChanged(instance, index); | 954 enter.functions()->SelectedFindResultChanged(instance, index); |
945 } | 955 } |
946 | 956 |
| 957 void PPB_Instance_Proxy::OnHostMsgSetTickmarks( |
| 958 PP_Instance instance, |
| 959 const std::vector<PP_Rect>& tickmarks) { |
| 960 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) |
| 961 return; |
| 962 if (tickmarks.empty()) |
| 963 return; |
| 964 EnterInstanceNoLock enter(instance); |
| 965 if (enter.succeeded()) { |
| 966 enter.functions()->SetTickmarks(instance, |
| 967 &tickmarks[0], |
| 968 static_cast<uint32_t>(tickmarks.size())); |
| 969 } |
| 970 } |
| 971 |
947 void PPB_Instance_Proxy::OnHostMsgSetFullscreen(PP_Instance instance, | 972 void PPB_Instance_Proxy::OnHostMsgSetFullscreen(PP_Instance instance, |
948 PP_Bool fullscreen, | 973 PP_Bool fullscreen, |
949 PP_Bool* result) { | 974 PP_Bool* result) { |
950 EnterInstanceNoLock enter(instance); | 975 EnterInstanceNoLock enter(instance); |
951 if (enter.succeeded()) | 976 if (enter.succeeded()) |
952 *result = enter.functions()->SetFullscreen(instance, fullscreen); | 977 *result = enter.functions()->SetFullscreen(instance, fullscreen); |
953 } | 978 } |
954 | 979 |
955 | 980 |
956 void PPB_Instance_Proxy::OnHostMsgGetScreenSize(PP_Instance instance, | 981 void PPB_Instance_Proxy::OnHostMsgGetScreenSize(PP_Instance instance, |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 PP_Instance instance) { | 1345 PP_Instance instance) { |
1321 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1346 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1322 GetInstanceData(instance); | 1347 GetInstanceData(instance); |
1323 if (!data) | 1348 if (!data) |
1324 return; // Instance was probably deleted. | 1349 return; // Instance was probably deleted. |
1325 data->should_do_request_surrounding_text = false; | 1350 data->should_do_request_surrounding_text = false; |
1326 } | 1351 } |
1327 | 1352 |
1328 } // namespace proxy | 1353 } // namespace proxy |
1329 } // namespace ppapi | 1354 } // namespace ppapi |
OLD | NEW |