| 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 "base/pickle.h" | 7 #include "base/pickle.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 if (data[i].length() > kMaxClipboardWriteSize) { | 309 if (data[i].length() > kMaxClipboardWriteSize) { |
| 310 res = PP_ERROR_NOSPACE; | 310 res = PP_ERROR_NOSPACE; |
| 311 break; | 311 break; |
| 312 } | 312 } |
| 313 | 313 |
| 314 switch (formats[i]) { | 314 switch (formats[i]) { |
| 315 case PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT: | 315 case PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT: |
| 316 scw.WriteText(UTF8ToUTF16(data[i])); | 316 scw.WriteText(UTF8ToUTF16(data[i])); |
| 317 break; | 317 break; |
| 318 case PP_FLASH_CLIPBOARD_FORMAT_HTML: | 318 case PP_FLASH_CLIPBOARD_FORMAT_HTML: |
| 319 scw.WriteHTML(UTF8ToUTF16(data[i]), ""); | 319 scw.WriteHTML(UTF8ToUTF16(data[i]), std::string()); |
| 320 break; | 320 break; |
| 321 case PP_FLASH_CLIPBOARD_FORMAT_RTF: | 321 case PP_FLASH_CLIPBOARD_FORMAT_RTF: |
| 322 scw.WriteRTF(data[i]); | 322 scw.WriteRTF(data[i]); |
| 323 break; | 323 break; |
| 324 case PP_FLASH_CLIPBOARD_FORMAT_INVALID: | 324 case PP_FLASH_CLIPBOARD_FORMAT_INVALID: |
| 325 res = PP_ERROR_BADARGUMENT; | 325 res = PP_ERROR_BADARGUMENT; |
| 326 break; | 326 break; |
| 327 default: | 327 default: |
| 328 if (custom_formats_.IsFormatRegistered(formats[i])) { | 328 if (custom_formats_.IsFormatRegistered(formats[i])) { |
| 329 std::string format_name = custom_formats_.GetFormatName(formats[i]); | 329 std::string format_name = custom_formats_.GetFormatName(formats[i]); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 351 | 351 |
| 352 if (res != PP_OK) { | 352 if (res != PP_OK) { |
| 353 // Need to clear the objects so nothing is written. | 353 // Need to clear the objects so nothing is written. |
| 354 scw.Reset(); | 354 scw.Reset(); |
| 355 } | 355 } |
| 356 | 356 |
| 357 return res; | 357 return res; |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace chrome | 360 } // namespace chrome |
| OLD | NEW |