OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_clipboard_proxy.h" | 5 #include "ppapi/proxy/ppb_flash_clipboard_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_clipboard.h" | 8 #include "ppapi/c/private/ppb_flash_clipboard.h" |
9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 if (!dispatcher->IsPlugin()) { | 100 if (!dispatcher->IsPlugin()) { |
101 ppb_flash_clipboard_impl_ = static_cast<const PPB_Flash_Clipboard*>( | 101 ppb_flash_clipboard_impl_ = static_cast<const PPB_Flash_Clipboard*>( |
102 dispatcher->local_get_interface()(PPB_FLASH_CLIPBOARD_INTERFACE)); | 102 dispatcher->local_get_interface()(PPB_FLASH_CLIPBOARD_INTERFACE)); |
103 } | 103 } |
104 } | 104 } |
105 | 105 |
106 PPB_Flash_Clipboard_Proxy::~PPB_Flash_Clipboard_Proxy() { | 106 PPB_Flash_Clipboard_Proxy::~PPB_Flash_Clipboard_Proxy() { |
107 } | 107 } |
108 | 108 |
109 // static | 109 // static |
110 const InterfaceProxy::Info* PPB_Flash_Clipboard_Proxy::GetInfo() { | 110 const PPB_Flash_Clipboard* PPB_Flash_Clipboard_Proxy::GetInterface() { |
111 static const Info info = { | 111 return &flash_clipboard_interface; |
112 &flash_clipboard_interface, | |
113 PPB_FLASH_CLIPBOARD_INTERFACE, | |
114 API_ID_PPB_FLASH_CLIPBOARD, | |
115 false, | |
116 &CreateFlashClipboardProxy | |
117 }; | |
118 return &info; | |
119 } | 112 } |
120 | 113 |
121 bool PPB_Flash_Clipboard_Proxy::OnMessageReceived(const IPC::Message& msg) { | 114 bool PPB_Flash_Clipboard_Proxy::OnMessageReceived(const IPC::Message& msg) { |
122 bool handled = true; | 115 bool handled = true; |
123 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Clipboard_Proxy, msg) | 116 IPC_BEGIN_MESSAGE_MAP(PPB_Flash_Clipboard_Proxy, msg) |
124 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashClipboard_IsFormatAvailable, | 117 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashClipboard_IsFormatAvailable, |
125 OnMsgIsFormatAvailable) | 118 OnMsgIsFormatAvailable) |
126 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashClipboard_ReadPlainText, | 119 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashClipboard_ReadPlainText, |
127 OnMsgReadPlainText) | 120 OnMsgReadPlainText) |
128 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashClipboard_WritePlainText, | 121 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlashClipboard_WritePlainText, |
(...skipping 30 matching lines...) Expand all Loading... |
159 SerializedVarReceiveInput text) { | 152 SerializedVarReceiveInput text) { |
160 int32_t result = ppb_flash_clipboard_impl_->WritePlainText( | 153 int32_t result = ppb_flash_clipboard_impl_->WritePlainText( |
161 instance_id, | 154 instance_id, |
162 static_cast<PP_Flash_Clipboard_Type>(clipboard_type), | 155 static_cast<PP_Flash_Clipboard_Type>(clipboard_type), |
163 text.Get(dispatcher())); | 156 text.Get(dispatcher())); |
164 LOG_IF(WARNING, result != PP_OK) << "Write to clipboard failed unexpectedly."; | 157 LOG_IF(WARNING, result != PP_OK) << "Write to clipboard failed unexpectedly."; |
165 } | 158 } |
166 | 159 |
167 } // namespace proxy | 160 } // namespace proxy |
168 } // namespace ppapi | 161 } // namespace ppapi |
OLD | NEW |