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

Side by Side Diff: ppapi/proxy/ppb_flash_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
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_flash_proxy.h" 5 #include "ppapi/proxy/ppb_flash_proxy.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 OnHostMsgGetProxyForURL) 111 OnHostMsgGetProxyForURL)
112 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_Navigate, OnHostMsgNavigate) 112 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_Navigate, OnHostMsgNavigate)
113 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_RunMessageLoop, 113 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_RunMessageLoop,
114 OnHostMsgRunMessageLoop) 114 OnHostMsgRunMessageLoop)
115 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QuitMessageLoop, 115 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QuitMessageLoop,
116 OnHostMsgQuitMessageLoop) 116 OnHostMsgQuitMessageLoop)
117 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetLocalTimeZoneOffset, 117 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetLocalTimeZoneOffset,
118 OnHostMsgGetLocalTimeZoneOffset) 118 OnHostMsgGetLocalTimeZoneOffset)
119 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_IsRectTopmost, 119 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_IsRectTopmost,
120 OnHostMsgIsRectTopmost) 120 OnHostMsgIsRectTopmost)
121 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_FlashSetFullscreen,
122 OnHostMsgFlashSetFullscreen)
123 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_FlashGetScreenSize,
124 OnHostMsgFlashGetScreenSize)
125 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_OpenFileRef, 121 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_OpenFileRef,
126 OnHostMsgOpenFileRef) 122 OnHostMsgOpenFileRef)
127 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QueryFileRef, 123 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_QueryFileRef,
128 OnHostMsgQueryFileRef) 124 OnHostMsgQueryFileRef)
129 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetDeviceID, 125 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetDeviceID,
130 OnHostMsgGetDeviceID) 126 OnHostMsgGetDeviceID)
131 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_InvokePrinting, 127 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_InvokePrinting,
132 OnHostMsgInvokePrinting) 128 OnHostMsgInvokePrinting)
133 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetSetting, 129 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetSetting,
134 OnHostMsgGetSetting) 130 OnHostMsgGetSetting)
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 if (enter.failed()) 527 if (enter.failed())
532 return PP_ERROR_BADRESOURCE; 528 return PP_ERROR_BADRESOURCE;
533 529
534 int32_t result = PP_ERROR_FAILED; 530 int32_t result = PP_ERROR_FAILED;
535 dispatcher()->Send(new PpapiHostMsg_PPBFlash_QueryFileRef( 531 dispatcher()->Send(new PpapiHostMsg_PPBFlash_QueryFileRef(
536 API_ID_PPB_FLASH, instance, enter.resource()->host_resource(), info, 532 API_ID_PPB_FLASH, instance, enter.resource()->host_resource(), info,
537 &result)); 533 &result));
538 return result; 534 return result;
539 } 535 }
540 536
541 PP_Bool PPB_Flash_Proxy::FlashIsFullscreen(PP_Instance instance) {
542 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
543 GetInstanceData(instance);
544 if (!data)
545 return PP_FALSE;
546 return data->flash_fullscreen;
547 }
548
549 PP_Bool PPB_Flash_Proxy::FlashSetFullscreen(PP_Instance instance,
550 PP_Bool fullscreen) {
551 PP_Bool result = PP_FALSE;
552 dispatcher()->Send(new PpapiHostMsg_PPBFlash_FlashSetFullscreen(
553 API_ID_PPB_FLASH, instance, fullscreen, &result));
554 return result;
555 }
556
557 PP_Bool PPB_Flash_Proxy::FlashGetScreenSize(PP_Instance instance,
558 PP_Size* size) {
559 PP_Bool result = PP_FALSE;
560 dispatcher()->Send(new PpapiHostMsg_PPBFlash_FlashGetScreenSize(
561 API_ID_PPB_FLASH, instance, &result, size));
562 return result;
563 }
564
565 void PPB_Flash_Proxy::OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance, 537 void PPB_Flash_Proxy::OnHostMsgSetInstanceAlwaysOnTop(PP_Instance instance,
566 PP_Bool on_top) { 538 PP_Bool on_top) {
567 EnterInstanceNoLock enter(instance); 539 EnterInstanceNoLock enter(instance);
568 if (enter.succeeded()) 540 if (enter.succeeded())
569 enter.functions()->GetFlashAPI()->SetInstanceAlwaysOnTop(instance, on_top); 541 enter.functions()->GetFlashAPI()->SetInstanceAlwaysOnTop(instance, on_top);
570 } 542 }
571 543
572 void PPB_Flash_Proxy::OnHostMsgDrawGlyphs( 544 void PPB_Flash_Proxy::OnHostMsgDrawGlyphs(
573 PP_Instance instance, 545 PP_Instance instance,
574 const PPBFlash_DrawGlyphs_Params& params, 546 const PPBFlash_DrawGlyphs_Params& params,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 void PPB_Flash_Proxy::OnHostMsgIsRectTopmost(PP_Instance instance, 642 void PPB_Flash_Proxy::OnHostMsgIsRectTopmost(PP_Instance instance,
671 PP_Rect rect, 643 PP_Rect rect,
672 PP_Bool* result) { 644 PP_Bool* result) {
673 EnterInstanceNoLock enter(instance); 645 EnterInstanceNoLock enter(instance);
674 if (enter.succeeded()) 646 if (enter.succeeded())
675 *result = enter.functions()->GetFlashAPI()->IsRectTopmost(instance, &rect); 647 *result = enter.functions()->GetFlashAPI()->IsRectTopmost(instance, &rect);
676 else 648 else
677 *result = PP_FALSE; 649 *result = PP_FALSE;
678 } 650 }
679 651
680 void PPB_Flash_Proxy::OnHostMsgFlashSetFullscreen(PP_Instance instance,
681 PP_Bool fullscreen,
682 PP_Bool* result) {
683 EnterInstanceNoLock enter(instance);
684 if (enter.succeeded()) {
685 *result = enter.functions()->GetFlashAPI()->FlashSetFullscreen(
686 instance, fullscreen);
687 } else {
688 *result = PP_FALSE;
689 }
690 }
691
692 void PPB_Flash_Proxy::OnHostMsgFlashGetScreenSize(PP_Instance instance,
693 PP_Bool* result,
694 PP_Size* size) {
695 EnterInstanceNoLock enter(instance);
696 if (enter.succeeded()) {
697 *result = enter.functions()->GetFlashAPI()->FlashGetScreenSize(
698 instance, size);
699 } else {
700 size->width = 0;
701 size->height = 0;
702 }
703 }
704
705 void PPB_Flash_Proxy::OnHostMsgOpenFileRef( 652 void PPB_Flash_Proxy::OnHostMsgOpenFileRef(
706 PP_Instance instance, 653 PP_Instance instance,
707 const HostResource& host_resource, 654 const HostResource& host_resource,
708 int32_t mode, 655 int32_t mode,
709 IPC::PlatformFileForTransit* file_handle, 656 IPC::PlatformFileForTransit* file_handle,
710 int32_t* result) { 657 int32_t* result) {
711 EnterInstanceNoLock enter(instance); 658 EnterInstanceNoLock enter(instance);
712 if (enter.failed()) { 659 if (enter.failed()) {
713 *result = PP_ERROR_BADARGUMENT; 660 *result = PP_ERROR_BADARGUMENT;
714 return; 661 return;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 // It's rarely used enough that we just request this interface when needed. 712 // It's rarely used enough that we just request this interface when needed.
766 const PPB_Flash_Print_1_0* print_interface = 713 const PPB_Flash_Print_1_0* print_interface =
767 static_cast<const PPB_Flash_Print_1_0*>( 714 static_cast<const PPB_Flash_Print_1_0*>(
768 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); 715 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0));
769 if (print_interface) 716 if (print_interface)
770 print_interface->InvokePrinting(instance); 717 print_interface->InvokePrinting(instance);
771 } 718 }
772 719
773 } // namespace proxy 720 } // namespace proxy
774 } // namespace ppapi 721 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698