summaryrefslogtreecommitdiff
path: root/chromium/ppapi/shared_impl
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ppapi/shared_impl')
-rw-r--r--chromium/ppapi/shared_impl/pdf_accessibility_shared.cc79
-rw-r--r--chromium/ppapi/shared_impl/pdf_accessibility_shared.h63
-rw-r--r--chromium/ppapi/shared_impl/ppb_opengles2_shared.cc2
-rw-r--r--chromium/ppapi/shared_impl/resource_tracker.cc1
4 files changed, 137 insertions, 8 deletions
diff --git a/chromium/ppapi/shared_impl/pdf_accessibility_shared.cc b/chromium/ppapi/shared_impl/pdf_accessibility_shared.cc
index 1769b4f4fe8..9615650d81e 100644
--- a/chromium/ppapi/shared_impl/pdf_accessibility_shared.cc
+++ b/chromium/ppapi/shared_impl/pdf_accessibility_shared.cc
@@ -88,10 +88,82 @@ PdfAccessibilityTextFieldInfo::PdfAccessibilityTextFieldInfo(
text_run_index(text_field.text_run_index),
bounds(text_field.bounds) {}
+PdfAccessibilityChoiceFieldOptionInfo::PdfAccessibilityChoiceFieldOptionInfo() =
+ default;
+
+PdfAccessibilityChoiceFieldOptionInfo::
+ ~PdfAccessibilityChoiceFieldOptionInfo() = default;
+
+PdfAccessibilityChoiceFieldOptionInfo::PdfAccessibilityChoiceFieldOptionInfo(
+ const PP_PrivateAccessibilityChoiceFieldOptionInfo& option)
+ : name(std::string(option.name, option.name_length)),
+ is_selected(option.is_selected),
+ bounds(option.bounds) {}
+
+PdfAccessibilityChoiceFieldInfo::PdfAccessibilityChoiceFieldInfo() = default;
+
+PdfAccessibilityChoiceFieldInfo::~PdfAccessibilityChoiceFieldInfo() = default;
+
+PdfAccessibilityChoiceFieldInfo::PdfAccessibilityChoiceFieldInfo(
+ const PP_PrivateAccessibilityChoiceFieldInfo& choice_field)
+ : name(std::string(choice_field.name, choice_field.name_length)),
+ type(choice_field.type),
+ is_read_only(choice_field.is_read_only),
+ is_multi_select(choice_field.is_multi_select),
+ has_editable_text_box(choice_field.has_editable_text_box),
+ index_in_page(choice_field.index_in_page),
+ text_run_index(choice_field.text_run_index),
+ bounds(choice_field.bounds) {
+ options.reserve(choice_field.options_length);
+ for (size_t i = 0; i < choice_field.options_length; i++) {
+ options.emplace_back(choice_field.options[i]);
+ }
+}
+
+PdfAccessibilityButtonInfo::PdfAccessibilityButtonInfo() = default;
+
+PdfAccessibilityButtonInfo::~PdfAccessibilityButtonInfo() = default;
+
+PdfAccessibilityButtonInfo::PdfAccessibilityButtonInfo(
+ const PP_PrivateAccessibilityButtonInfo& button)
+ : name(std::string(button.name, button.name_length)),
+ value(std::string(button.value, button.value_length)),
+ type(button.type),
+ is_read_only(button.is_read_only),
+ is_checked(button.is_checked),
+ control_count(button.control_count),
+ control_index(button.control_index),
+ index_in_page(button.index_in_page),
+ text_run_index(button.text_run_index),
+ bounds(button.bounds) {}
+
+PdfAccessibilityFormFieldInfo::PdfAccessibilityFormFieldInfo() = default;
+
+PdfAccessibilityFormFieldInfo::PdfAccessibilityFormFieldInfo(
+ const PP_PrivateAccessibilityFormFieldInfo& form_fields) {
+ text_fields.reserve(form_fields.text_field_count);
+ for (size_t i = 0; i < form_fields.text_field_count; i++) {
+ text_fields.emplace_back(form_fields.text_fields[i]);
+ }
+
+ choice_fields.reserve(form_fields.choice_field_count);
+ for (size_t i = 0; i < form_fields.choice_field_count; i++) {
+ choice_fields.emplace_back(form_fields.choice_fields[i]);
+ }
+
+ buttons.reserve(form_fields.button_count);
+ for (size_t i = 0; i < form_fields.button_count; i++) {
+ buttons.emplace_back(form_fields.buttons[i]);
+ }
+}
+
+PdfAccessibilityFormFieldInfo::~PdfAccessibilityFormFieldInfo() = default;
+
PdfAccessibilityPageObjects::PdfAccessibilityPageObjects() = default;
PdfAccessibilityPageObjects::PdfAccessibilityPageObjects(
- const PP_PrivateAccessibilityPageObjects& page_objects) {
+ const PP_PrivateAccessibilityPageObjects& page_objects)
+ : form_fields(page_objects.form_fields) {
links.reserve(page_objects.link_count);
for (size_t i = 0; i < page_objects.link_count; i++) {
links.emplace_back(page_objects.links[i]);
@@ -106,11 +178,6 @@ PdfAccessibilityPageObjects::PdfAccessibilityPageObjects(
for (size_t i = 0; i < page_objects.highlight_count; i++) {
highlights.emplace_back(page_objects.highlights[i]);
}
-
- text_fields.reserve(page_objects.text_field_count);
- for (size_t i = 0; i < page_objects.text_field_count; i++) {
- text_fields.emplace_back(page_objects.text_fields[i]);
- }
}
PdfAccessibilityPageObjects::~PdfAccessibilityPageObjects() = default;
diff --git a/chromium/ppapi/shared_impl/pdf_accessibility_shared.h b/chromium/ppapi/shared_impl/pdf_accessibility_shared.h
index cdacfdf2424..b49ab5be6bc 100644
--- a/chromium/ppapi/shared_impl/pdf_accessibility_shared.h
+++ b/chromium/ppapi/shared_impl/pdf_accessibility_shared.h
@@ -107,6 +107,67 @@ struct PPAPI_SHARED_EXPORT PdfAccessibilityTextFieldInfo {
PP_FloatRect bounds;
};
+// Needs to stay in sync with PP_PrivateAccessibilityChoiceFieldOptionInfo.
+struct PPAPI_SHARED_EXPORT PdfAccessibilityChoiceFieldOptionInfo {
+ PdfAccessibilityChoiceFieldOptionInfo();
+ explicit PdfAccessibilityChoiceFieldOptionInfo(
+ const PP_PrivateAccessibilityChoiceFieldOptionInfo& option);
+ ~PdfAccessibilityChoiceFieldOptionInfo();
+
+ std::string name;
+ bool is_selected;
+ PP_FloatRect bounds;
+};
+
+// Needs to stay in sync with PP_PrivateAccessibilityChoiceFieldInfo.
+struct PPAPI_SHARED_EXPORT PdfAccessibilityChoiceFieldInfo {
+ PdfAccessibilityChoiceFieldInfo();
+ explicit PdfAccessibilityChoiceFieldInfo(
+ const PP_PrivateAccessibilityChoiceFieldInfo& choice_field);
+ ~PdfAccessibilityChoiceFieldInfo();
+
+ std::string name;
+ std::vector<PdfAccessibilityChoiceFieldOptionInfo> options;
+ PP_PrivateChoiceFieldType type;
+ bool is_read_only;
+ bool is_multi_select;
+ bool has_editable_text_box;
+ uint32_t index_in_page;
+ uint32_t text_run_index;
+ PP_FloatRect bounds;
+};
+
+// Needs to stay in sync with PP_PrivateAccessibilityButtonInfo.
+struct PPAPI_SHARED_EXPORT PdfAccessibilityButtonInfo {
+ PdfAccessibilityButtonInfo();
+ explicit PdfAccessibilityButtonInfo(
+ const PP_PrivateAccessibilityButtonInfo& button);
+ ~PdfAccessibilityButtonInfo();
+
+ std::string name;
+ std::string value;
+ PP_PrivateButtonType type;
+ bool is_read_only;
+ bool is_checked;
+ uint32_t control_count;
+ uint32_t control_index;
+ uint32_t index_in_page;
+ uint32_t text_run_index;
+ PP_FloatRect bounds;
+};
+
+// Needs to stay in sync with PP_PrivateAccessibilityFormFieldInfo.
+struct PPAPI_SHARED_EXPORT PdfAccessibilityFormFieldInfo {
+ PdfAccessibilityFormFieldInfo();
+ explicit PdfAccessibilityFormFieldInfo(
+ const PP_PrivateAccessibilityFormFieldInfo& form_fields);
+ ~PdfAccessibilityFormFieldInfo();
+
+ std::vector<PdfAccessibilityTextFieldInfo> text_fields;
+ std::vector<PdfAccessibilityChoiceFieldInfo> choice_fields;
+ std::vector<PdfAccessibilityButtonInfo> buttons;
+};
+
// Needs to stay in sync with PP_PrivateAccessibilityPageObjects.
struct PPAPI_SHARED_EXPORT PdfAccessibilityPageObjects {
PdfAccessibilityPageObjects();
@@ -117,7 +178,7 @@ struct PPAPI_SHARED_EXPORT PdfAccessibilityPageObjects {
std::vector<PdfAccessibilityLinkInfo> links;
std::vector<PdfAccessibilityImageInfo> images;
std::vector<PdfAccessibilityHighlightInfo> highlights;
- std::vector<PdfAccessibilityTextFieldInfo> text_fields;
+ PdfAccessibilityFormFieldInfo form_fields;
};
} // namespace ppapi
diff --git a/chromium/ppapi/shared_impl/ppb_opengles2_shared.cc b/chromium/ppapi/shared_impl/ppb_opengles2_shared.cc
index a1529470c93..020b45c4e25 100644
--- a/chromium/ppapi/shared_impl/ppb_opengles2_shared.cc
+++ b/chromium/ppapi/shared_impl/ppb_opengles2_shared.cc
@@ -10,7 +10,7 @@
#include "ppapi/shared_impl/ppb_opengles2_shared.h"
-#include "base/check.h"
+#include "base/logging.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "ppapi/shared_impl/ppb_graphics_3d_shared.h"
#include "ppapi/thunk/enter.h"
diff --git a/chromium/ppapi/shared_impl/resource_tracker.cc b/chromium/ppapi/shared_impl/resource_tracker.cc
index 775b8d74a8d..c8b127c65db 100644
--- a/chromium/ppapi/shared_impl/resource_tracker.cc
+++ b/chromium/ppapi/shared_impl/resource_tracker.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
+#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "ppapi/shared_impl/callback_tracker.h"
#include "ppapi/shared_impl/id_assignment.h"