Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2663)

Unified Diff: ppapi/proxy/ppb_flash_clipboard_proxy.cc

Issue 9921018: Added RTF support to pepper API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/c/private/ppb_flash_clipboard.h ('k') | ppapi/tests/test_flash_clipboard.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_flash_clipboard_proxy.cc
diff --git a/ppapi/proxy/ppb_flash_clipboard_proxy.cc b/ppapi/proxy/ppb_flash_clipboard_proxy.cc
index 268a8e4529c209a282156078b78024b0dada86f3..73b987eec496133c6621720af2fa288e45fd25ff 100644
--- a/ppapi/proxy/ppb_flash_clipboard_proxy.cc
+++ b/ppapi/proxy/ppb_flash_clipboard_proxy.cc
@@ -29,7 +29,8 @@ bool IsValidClipboardType(PP_Flash_Clipboard_Type clipboard_type) {
bool IsValidClipboardFormat(PP_Flash_Clipboard_Format format) {
// Purposely excludes |PP_FLASH_CLIPBOARD_FORMAT_INVALID|.
return format == PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT ||
- format == PP_FLASH_CLIPBOARD_FORMAT_HTML;
+ format == PP_FLASH_CLIPBOARD_FORMAT_HTML ||
+ format == PP_FLASH_CLIPBOARD_FORMAT_RTF;
}
} // namespace
@@ -86,6 +87,11 @@ int32_t PPB_Flash_Clipboard_Proxy::WriteData(
if (!IsValidClipboardType(clipboard_type))
return PP_ERROR_BADARGUMENT;
+ for (size_t i = 0; i < data_item_count; ++i) {
+ if (!IsValidClipboardFormat(formats[i]))
+ return PP_ERROR_BADARGUMENT;
+ }
+
std::vector<int> formats_vector(formats, formats + data_item_count);
std::vector<SerializedVar> data_items_vector;
« no previous file with comments | « ppapi/c/private/ppb_flash_clipboard.h ('k') | ppapi/tests/test_flash_clipboard.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698