| 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 "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_fil
ter.h" | 5 #include "chrome/browser/renderer_host/pepper/pepper_flash_clipboard_message_fil
ter.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include "base/pickle.h" | 9 #include "base/pickle.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "build/build_config.h" |
| 9 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 10 #include "ipc/ipc_message.h" | 13 #include "ipc/ipc_message.h" |
| 11 #include "ipc/ipc_message_macros.h" | 14 #include "ipc/ipc_message_macros.h" |
| 12 #include "ppapi/c/pp_errors.h" | 15 #include "ppapi/c/pp_errors.h" |
| 13 #include "ppapi/c/private/ppb_flash_clipboard.h" | 16 #include "ppapi/c/private/ppb_flash_clipboard.h" |
| 14 #include "ppapi/host/dispatch_host_message.h" | 17 #include "ppapi/host/dispatch_host_message.h" |
| 15 #include "ppapi/host/host_message_context.h" | 18 #include "ppapi/host/host_message_context.h" |
| 16 #include "ppapi/host/ppapi_host.h" | 19 #include "ppapi/host/ppapi_host.h" |
| 17 #include "ppapi/proxy/ppapi_messages.h" | 20 #include "ppapi/proxy/ppapi_messages.h" |
| 18 #include "ppapi/proxy/resource_message_params.h" | 21 #include "ppapi/proxy/resource_message_params.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 break; | 236 break; |
| 234 } | 237 } |
| 235 case PP_FLASH_CLIPBOARD_FORMAT_HTML: { | 238 case PP_FLASH_CLIPBOARD_FORMAT_HTML: { |
| 236 if (!clipboard->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(), | 239 if (!clipboard->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(), |
| 237 type)) { | 240 type)) { |
| 238 break; | 241 break; |
| 239 } | 242 } |
| 240 | 243 |
| 241 base::string16 html; | 244 base::string16 html; |
| 242 std::string url; | 245 std::string url; |
| 243 uint32 fragment_start; | 246 uint32_t fragment_start; |
| 244 uint32 fragment_end; | 247 uint32_t fragment_end; |
| 245 clipboard->ReadHTML(type, &html, &url, &fragment_start, &fragment_end); | 248 clipboard->ReadHTML(type, &html, &url, &fragment_start, &fragment_end); |
| 246 result = PP_OK; | 249 result = PP_OK; |
| 247 clipboard_string = base::UTF16ToUTF8( | 250 clipboard_string = base::UTF16ToUTF8( |
| 248 html.substr(fragment_start, fragment_end - fragment_start)); | 251 html.substr(fragment_start, fragment_end - fragment_start)); |
| 249 break; | 252 break; |
| 250 } | 253 } |
| 251 case PP_FLASH_CLIPBOARD_FORMAT_RTF: { | 254 case PP_FLASH_CLIPBOARD_FORMAT_RTF: { |
| 252 if (!clipboard->IsFormatAvailable(ui::Clipboard::GetRtfFormatType(), | 255 if (!clipboard->IsFormatAvailable(ui::Clipboard::GetRtfFormatType(), |
| 253 type)) { | 256 type)) { |
| 254 break; | 257 break; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 371 |
| 369 ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); | 372 ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); |
| 370 ui::ClipboardType type = ConvertClipboardType(clipboard_type); | 373 ui::ClipboardType type = ConvertClipboardType(clipboard_type); |
| 371 int64_t sequence_number = clipboard->GetSequenceNumber(type); | 374 int64_t sequence_number = clipboard->GetSequenceNumber(type); |
| 372 host_context->reply_msg = | 375 host_context->reply_msg = |
| 373 PpapiPluginMsg_FlashClipboard_GetSequenceNumberReply(sequence_number); | 376 PpapiPluginMsg_FlashClipboard_GetSequenceNumberReply(sequence_number); |
| 374 return PP_OK; | 377 return PP_OK; |
| 375 } | 378 } |
| 376 | 379 |
| 377 } // namespace chrome | 380 } // namespace chrome |
| OLD | NEW |