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

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

Issue 10984094: Hook up PpapiPermissions in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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_menu_proxy.h" 5 #include "ppapi/proxy/ppb_flash_menu_proxy.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/private/ppb_flash_menu.h" 8 #include "ppapi/c/private/ppb_flash_menu.h"
9 #include "ppapi/proxy/enter_proxy.h" 9 #include "ppapi/proxy/enter_proxy.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return 0; 95 return 0;
96 96
97 dispatcher->Send(new PpapiHostMsg_PPBFlashMenu_Create( 97 dispatcher->Send(new PpapiHostMsg_PPBFlashMenu_Create(
98 API_ID_PPB_FLASH_MENU, instance_id, serialized_menu, &result)); 98 API_ID_PPB_FLASH_MENU, instance_id, serialized_menu, &result));
99 if (result.is_null()) 99 if (result.is_null())
100 return 0; 100 return 0;
101 return (new FlashMenu(result))->GetReference(); 101 return (new FlashMenu(result))->GetReference();
102 } 102 }
103 103
104 bool PPB_Flash_Menu_Proxy::OnMessageReceived(const IPC::Message& msg) { 104 bool PPB_Flash_Menu_Proxy::OnMessageReceived(const IPC::Message& msg) {
105 if (!dispatcher()->permissions().HasPermission(PERMISSION_FLASH))
106 return false;
107
105 bool handled = true; 108 bool handled = true;
106 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Menu_Proxy, msg) 109 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Menu_Proxy, msg)
107 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashMenu_Create, 110 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashMenu_Create,
108 OnMsgCreate) 111 OnMsgCreate)
109 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashMenu_Show, 112 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashMenu_Show,
110 OnMsgShow) 113 OnMsgShow)
111 114
112 IPC_MESSAGE_HANDLER(PpapiMsg_PPBFlashMenu_ShowACK, 115 IPC_MESSAGE_HANDLER(PpapiMsg_PPBFlashMenu_ShowACK,
113 OnMsgShowACK) 116 OnMsgShowACK)
114 IPC_MESSAGE_UNHANDLED(handled = false) 117 IPC_MESSAGE_UNHANDLED(handled = false)
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK( 165 dispatcher()->Send(new PpapiMsg_PPBFlashMenu_ShowACK(
163 API_ID_PPB_FLASH_MENU, 166 API_ID_PPB_FLASH_MENU,
164 request->menu, 167 request->menu,
165 request->selected_id, 168 request->selected_id,
166 result)); 169 result));
167 delete request; 170 delete request;
168 } 171 }
169 172
170 } // namespace proxy 173 } // namespace proxy
171 } // namespace ppapi 174 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698