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

Unified Diff: ppapi/cpp/private/flash_clipboard.cc

Issue 10787039: PPAPI Flash: Remove support for PPB_Flash 12.0-12.2 and PPB_Flash_Clipboard 3.0 from C++ wrappers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/cpp/private/flash.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/private/flash_clipboard.cc
diff --git a/ppapi/cpp/private/flash_clipboard.cc b/ppapi/cpp/private/flash_clipboard.cc
index 6f554e4bb55b6c17073574e9e476ac6e453f3d8d..6107f98526f1c60b9907f248f8a4b687576bd2b0 100644
--- a/ppapi/cpp/private/flash_clipboard.cc
+++ b/ppapi/cpp/private/flash_clipboard.cc
@@ -16,12 +16,8 @@ namespace pp {
namespace {
-template <> const char* interface_name<PPB_Flash_Clipboard>() {
- return PPB_FLASH_CLIPBOARD_INTERFACE;
-}
-
-template <> const char* interface_name<PPB_Flash_Clipboard_3_0>() {
- return PPB_FLASH_CLIPBOARD_INTERFACE_3_0;
+template <> const char* interface_name<PPB_Flash_Clipboard_4_0>() {
+ return PPB_FLASH_CLIPBOARD_INTERFACE_4_0;
}
} // namespace
@@ -30,8 +26,7 @@ namespace flash {
// static
bool Clipboard::IsAvailable() {
- return has_interface<PPB_Flash_Clipboard>() ||
- has_interface<PPB_Flash_Clipboard_3_0>();
+ return has_interface<PPB_Flash_Clipboard_4_0>();
}
// static
@@ -39,8 +34,8 @@ bool Clipboard::IsFormatAvailable(const InstanceHandle& instance,
PP_Flash_Clipboard_Type clipboard_type,
PP_Flash_Clipboard_Format format) {
bool rv = false;
- if (has_interface<PPB_Flash_Clipboard>()) {
- rv = PP_ToBool(get_interface<PPB_Flash_Clipboard>()->IsFormatAvailable(
+ if (has_interface<PPB_Flash_Clipboard_4_0>()) {
+ rv = PP_ToBool(get_interface<PPB_Flash_Clipboard_4_0>()->IsFormatAvailable(
instance.pp_instance(), clipboard_type, format));
}
return rv;
@@ -53,20 +48,13 @@ bool Clipboard::ReadData(
PP_Flash_Clipboard_Format clipboard_format,
Var* out) {
bool rv = false;
- if (has_interface<PPB_Flash_Clipboard>()) {
- PP_Var result = get_interface<PPB_Flash_Clipboard>()->ReadData(
+ if (has_interface<PPB_Flash_Clipboard_4_0>()) {
+ PP_Var result = get_interface<PPB_Flash_Clipboard_4_0>()->ReadData(
instance.pp_instance(),
clipboard_type,
clipboard_format);
*out = Var(PASS_REF, result);
rv = true;
- } else if (has_interface<PPB_Flash_Clipboard_3_0>() &&
- clipboard_format == PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT) {
- PP_Var result = get_interface<PPB_Flash_Clipboard_3_0>()->ReadPlainText(
- instance.pp_instance(),
- clipboard_type);
- *out = Var(PASS_REF, result);
- rv = true;
}
return rv;
}
@@ -81,7 +69,7 @@ bool Clipboard::WriteData(
return false;
bool rv = false;
- if (has_interface<PPB_Flash_Clipboard>()) {
+ if (has_interface<PPB_Flash_Clipboard_4_0>()) {
// Convert vector of pp::Var into a vector of PP_Var.
std::vector<PP_Var> data_items_vector;
for (uint32_t i = 0; i < data_items.size(); ++i)
@@ -97,25 +85,12 @@ bool Clipboard::WriteData(
data_items_ptr = &data_items_vector[0];
}
- rv = (get_interface<PPB_Flash_Clipboard>()->WriteData(
+ rv = (get_interface<PPB_Flash_Clipboard_4_0>()->WriteData(
instance.pp_instance(),
clipboard_type,
data_items.size(),
formats_ptr,
data_items_ptr) == PP_OK);
- } else if (has_interface<PPB_Flash_Clipboard_3_0>()) {
- // The API specifies that only the last item of each format needs to be
- // written. Since we are only writing plain text items for the 3_0
- // interface, we just need to write the last one in the array.
- for (int32_t i = formats.size() - 1; i >= 0; --i) {
- if (formats[i] == PP_FLASH_CLIPBOARD_FORMAT_PLAINTEXT) {
- rv = (get_interface<PPB_Flash_Clipboard_3_0>()->WritePlainText(
- instance.pp_instance(),
- clipboard_type,
- data_items[i].pp_var()) == PP_OK);
- break;
- }
- }
}
return rv;
« no previous file with comments | « ppapi/cpp/private/flash.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698