| 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_flash_proxy.h" | 5 #include "ppapi/proxy/ppb_flash_proxy.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 PPB_Flash_Proxy::~PPB_Flash_Proxy() { | 82 PPB_Flash_Proxy::~PPB_Flash_Proxy() { |
| 83 } | 83 } |
| 84 | 84 |
| 85 // static | 85 // static |
| 86 const PPB_Flash_Print_1_0* PPB_Flash_Proxy::GetFlashPrintInterface() { | 86 const PPB_Flash_Print_1_0* PPB_Flash_Proxy::GetFlashPrintInterface() { |
| 87 return &g_flash_print_interface; | 87 return &g_flash_print_interface; |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) { | 90 bool PPB_Flash_Proxy::OnMessageReceived(const IPC::Message& msg) { |
| 91 if (!dispatcher()->permissions().HasPermission(PERMISSION_FLASH)) |
| 92 return false; |
| 93 |
| 91 // Prevent the dispatcher from going away during a call to Navigate. | 94 // Prevent the dispatcher from going away during a call to Navigate. |
| 92 // This must happen OUTSIDE of OnMsgNavigate since the handling code use | 95 // This must happen OUTSIDE of OnMsgNavigate since the handling code use |
| 93 // the dispatcher upon return of the function (sending the reply message). | 96 // the dispatcher upon return of the function (sending the reply message). |
| 94 ScopedModuleReference death_grip(dispatcher()); | 97 ScopedModuleReference death_grip(dispatcher()); |
| 95 | 98 |
| 96 bool handled = true; | 99 bool handled = true; |
| 97 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) | 100 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Proxy, msg) |
| 98 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, | 101 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, |
| 99 OnHostMsgSetInstanceAlwaysOnTop) | 102 OnHostMsgSetInstanceAlwaysOnTop) |
| 100 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DrawGlyphs, | 103 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_DrawGlyphs, |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 // It's rarely used enough that we just request this interface when needed. | 880 // It's rarely used enough that we just request this interface when needed. |
| 878 const PPB_Flash_Print_1_0* print_interface = | 881 const PPB_Flash_Print_1_0* print_interface = |
| 879 static_cast<const PPB_Flash_Print_1_0*>( | 882 static_cast<const PPB_Flash_Print_1_0*>( |
| 880 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); | 883 dispatcher()->local_get_interface()(PPB_FLASH_PRINT_INTERFACE_1_0)); |
| 881 if (print_interface) | 884 if (print_interface) |
| 882 print_interface->InvokePrinting(instance); | 885 print_interface->InvokePrinting(instance); |
| 883 } | 886 } |
| 884 | 887 |
| 885 } // namespace proxy | 888 } // namespace proxy |
| 886 } // namespace ppapi | 889 } // namespace ppapi |
| OLD | NEW |