| 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 "webkit/plugins/ppapi/ppb_flash_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 ui::Clipboard::GetPlainTextFormatType(), buffer_type)) { | 319 ui::Clipboard::GetPlainTextFormatType(), buffer_type)) { |
| 320 std::string text; | 320 std::string text; |
| 321 clipboard_client_->ReadAsciiText(buffer_type, &text); | 321 clipboard_client_->ReadAsciiText(buffer_type, &text); |
| 322 if (!text.empty()) | 322 if (!text.empty()) |
| 323 return StringVar::StringToPPVar(text); | 323 return StringVar::StringToPPVar(text); |
| 324 } | 324 } |
| 325 | 325 |
| 326 return PP_MakeNull(); | 326 return PP_MakeNull(); |
| 327 } | 327 } |
| 328 case PP_FLASH_CLIPBOARD_FORMAT_HTML: { | 328 case PP_FLASH_CLIPBOARD_FORMAT_HTML: { |
| 329 string16 html_stdstr; | 329 string16 html; |
| 330 GURL gurl; | 330 GURL gurl; |
| 331 uint32 fragment_start; | 331 uint32 fragment_start; |
| 332 uint32 fragment_end; | 332 uint32 fragment_end; |
| 333 clipboard_client_->ReadHTML(buffer_type, | 333 clipboard_client_->ReadHTML(buffer_type, |
| 334 &html_stdstr, | 334 &html, |
| 335 &gurl, | 335 &gurl, |
| 336 &fragment_start, | 336 &fragment_start, |
| 337 &fragment_end); | 337 &fragment_end); |
| 338 return StringVar::StringToPPVar(UTF16ToUTF8(html_stdstr)); | 338 return StringVar::StringToPPVar(UTF16ToUTF8( |
| 339 html.substr(fragment_start, fragment_end - fragment_start))); |
| 339 } | 340 } |
| 340 case PP_FLASH_CLIPBOARD_FORMAT_RTF: { | 341 case PP_FLASH_CLIPBOARD_FORMAT_RTF: { |
| 341 std::string result; | 342 std::string result; |
| 342 clipboard_client_->ReadRTF(buffer_type, &result); | 343 clipboard_client_->ReadRTF(buffer_type, &result); |
| 343 return ::ppapi::PpapiGlobals::Get()->GetVarTracker()-> | 344 return ::ppapi::PpapiGlobals::Get()->GetVarTracker()-> |
| 344 MakeArrayBufferPPVar(result.size(), result.data()); | 345 MakeArrayBufferPPVar(result.size(), result.data()); |
| 345 } | 346 } |
| 346 case PP_FLASH_CLIPBOARD_FORMAT_INVALID: | 347 case PP_FLASH_CLIPBOARD_FORMAT_INVALID: |
| 347 break; | 348 break; |
| 348 } | 349 } |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 } | 672 } |
| 672 case PP_FLASH_CLIPBOARD_FORMAT_INVALID: | 673 case PP_FLASH_CLIPBOARD_FORMAT_INVALID: |
| 673 break; | 674 break; |
| 674 } | 675 } |
| 675 | 676 |
| 676 return PP_ERROR_BADARGUMENT; | 677 return PP_ERROR_BADARGUMENT; |
| 677 } | 678 } |
| 678 | 679 |
| 679 } // namespace ppapi | 680 } // namespace ppapi |
| 680 } // namespace webkit | 681 } // namespace webkit |
| OLD | NEW |