Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 11421066: Refactor PPB_Flash_Fullscreen to the new resource model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.h ('k') | ppapi/proxy/ppp_instance_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "ppapi/c/pp_var.h" 11 #include "ppapi/c/pp_var.h"
12 #include "ppapi/c/ppb_audio_config.h" 12 #include "ppapi/c/ppb_audio_config.h"
13 #include "ppapi/c/ppb_instance.h" 13 #include "ppapi/c/ppb_instance.h"
14 #include "ppapi/c/ppb_messaging.h" 14 #include "ppapi/c/ppb_messaging.h"
15 #include "ppapi/c/ppb_mouse_lock.h" 15 #include "ppapi/c/ppb_mouse_lock.h"
16 #include "ppapi/c/private/pp_content_decryptor.h" 16 #include "ppapi/c/private/pp_content_decryptor.h"
17 #include "ppapi/proxy/content_decryptor_private_serializer.h" 17 #include "ppapi/proxy/content_decryptor_private_serializer.h"
18 #include "ppapi/proxy/enter_proxy.h" 18 #include "ppapi/proxy/enter_proxy.h"
19 #include "ppapi/proxy/flash_clipboard_resource.h" 19 #include "ppapi/proxy/flash_clipboard_resource.h"
20 #include "ppapi/proxy/flash_fullscreen_resource.h"
20 #include "ppapi/proxy/flash_resource.h" 21 #include "ppapi/proxy/flash_resource.h"
21 #include "ppapi/proxy/gamepad_resource.h" 22 #include "ppapi/proxy/gamepad_resource.h"
22 #include "ppapi/proxy/host_dispatcher.h" 23 #include "ppapi/proxy/host_dispatcher.h"
23 #include "ppapi/proxy/plugin_dispatcher.h" 24 #include "ppapi/proxy/plugin_dispatcher.h"
24 #include "ppapi/proxy/ppapi_messages.h" 25 #include "ppapi/proxy/ppapi_messages.h"
25 #include "ppapi/proxy/ppb_flash_proxy.h" 26 #include "ppapi/proxy/ppb_flash_proxy.h"
26 #include "ppapi/proxy/serialized_var.h" 27 #include "ppapi/proxy/serialized_var.h"
27 #include "ppapi/shared_impl/ppapi_globals.h" 28 #include "ppapi/shared_impl/ppapi_globals.h"
28 #include "ppapi/shared_impl/ppb_url_util_shared.h" 29 #include "ppapi/shared_impl/ppb_url_util_shared.h"
29 #include "ppapi/shared_impl/ppb_view_shared.h" 30 #include "ppapi/shared_impl/ppb_view_shared.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 221 }
221 222
222 const ViewData* PPB_Instance_Proxy::GetViewData(PP_Instance instance) { 223 const ViewData* PPB_Instance_Proxy::GetViewData(PP_Instance instance) {
223 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 224 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
224 GetInstanceData(instance); 225 GetInstanceData(instance);
225 if (!data) 226 if (!data)
226 return NULL; 227 return NULL;
227 return &data->view; 228 return &data->view;
228 } 229 }
229 230
231 PP_Bool PPB_Instance_Proxy::FlashIsFullscreen(PP_Instance instance) {
232 // This function is only used for proxying in the renderer process. It is not
233 // implemented in the plugin process.
234 NOTREACHED();
235 return PP_FALSE;
236 }
237
230 PP_Var PPB_Instance_Proxy::GetWindowObject(PP_Instance instance) { 238 PP_Var PPB_Instance_Proxy::GetWindowObject(PP_Instance instance) {
231 ReceiveSerializedVarReturnValue result; 239 ReceiveSerializedVarReturnValue result;
232 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetWindowObject( 240 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetWindowObject(
233 API_ID_PPB_INSTANCE, instance, &result)); 241 API_ID_PPB_INSTANCE, instance, &result));
234 return result.Return(dispatcher()); 242 return result.Return(dispatcher());
235 } 243 }
236 244
237 PP_Var PPB_Instance_Proxy::GetOwnerElementObject(PP_Instance instance) { 245 PP_Var PPB_Instance_Proxy::GetOwnerElementObject(PP_Instance instance) {
238 ReceiveSerializedVarReturnValue result; 246 ReceiveSerializedVarReturnValue result;
239 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetOwnerElementObject( 247 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetOwnerElementObject(
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 351
344 scoped_refptr<Resource> new_singleton; 352 scoped_refptr<Resource> new_singleton;
345 Connection connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher()); 353 Connection connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher());
346 354
347 switch (id) { 355 switch (id) {
348 case GAMEPAD_SINGLETON_ID: 356 case GAMEPAD_SINGLETON_ID:
349 new_singleton = new GamepadResource(connection, instance); 357 new_singleton = new GamepadResource(connection, instance);
350 break; 358 break;
351 // Flash resources aren't needed for NaCl. 359 // Flash resources aren't needed for NaCl.
352 #if !defined(OS_NACL) && !defined(NACL_WIN64) 360 #if !defined(OS_NACL) && !defined(NACL_WIN64)
361 case FLASH_CLIPBOARD_SINGLETON_ID:
362 new_singleton = new FlashClipboardResource(connection, instance);
363 break;
364 case FLASH_FULLSCREEN_SINGLETON_ID:
365 new_singleton = new FlashFullscreenResource(connection, instance);
366 break;
353 case FLASH_SINGLETON_ID: 367 case FLASH_SINGLETON_ID:
354 new_singleton = new FlashResource(connection, instance); 368 new_singleton = new FlashResource(connection, instance);
355 break; 369 break;
370 #else
356 case FLASH_CLIPBOARD_SINGLETON_ID: 371 case FLASH_CLIPBOARD_SINGLETON_ID:
357 new_singleton = new FlashClipboardResource(connection, instance); 372 case FLASH_FULLSCREEN_SINGLETON_ID:
358 break;
359 #else
360 case FLASH_SINGLETON_ID: 373 case FLASH_SINGLETON_ID:
361 case FLASH_CLIPBOARD_SINGLETON_ID:
362 NOTREACHED(); 374 NOTREACHED();
363 break; 375 break;
364 #endif // !defined(OS_NACL) && !defined(NACL_WIN64) 376 #endif // !defined(OS_NACL) && !defined(NACL_WIN64)
365 } 377 }
366 378
367 if (!new_singleton) { 379 if (!new_singleton) {
368 // Getting here implies that a constructor is missing in the above switch. 380 // Getting here implies that a constructor is missing in the above switch.
369 NOTREACHED(); 381 NOTREACHED();
370 return NULL; 382 return NULL;
371 } 383 }
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 PP_Instance instance) { 1184 PP_Instance instance) {
1173 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1185 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1174 GetInstanceData(instance); 1186 GetInstanceData(instance);
1175 if (!data) 1187 if (!data)
1176 return; // Instance was probably deleted. 1188 return; // Instance was probably deleted.
1177 data->should_do_request_surrounding_text = false; 1189 data->should_do_request_surrounding_text = false;
1178 } 1190 }
1179 1191
1180 } // namespace proxy 1192 } // namespace proxy
1181 } // namespace ppapi 1193 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.h ('k') | ppapi/proxy/ppp_instance_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698