diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/ppapi | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ppapi')
-rw-r--r-- | chromium/ppapi/c/private/ppb_pdf.h | 143 | ||||
-rw-r--r-- | chromium/ppapi/cpp/private/pdf.cc | 70 | ||||
-rw-r--r-- | chromium/ppapi/cpp/private/pdf.h | 70 | ||||
-rw-r--r-- | chromium/ppapi/proxy/enter_proxy.h | 3 | ||||
-rw-r--r-- | chromium/ppapi/proxy/pdf_resource.cc | 27 | ||||
-rw-r--r-- | chromium/ppapi/proxy/ppapi_messages.h | 43 | ||||
-rw-r--r-- | chromium/ppapi/proxy/proxy_array_output.h | 2 | ||||
-rw-r--r-- | chromium/ppapi/proxy/proxy_completion_callback_factory.h | 2 | ||||
-rw-r--r-- | chromium/ppapi/proxy/raw_var_data.cc | 1 | ||||
-rw-r--r-- | chromium/ppapi/proxy/serialized_handle.h | 2 | ||||
-rw-r--r-- | chromium/ppapi/proxy/serialized_structs.h | 1 | ||||
-rw-r--r-- | chromium/ppapi/shared_impl/pdf_accessibility_shared.cc | 79 | ||||
-rw-r--r-- | chromium/ppapi/shared_impl/pdf_accessibility_shared.h | 63 | ||||
-rw-r--r-- | chromium/ppapi/shared_impl/ppb_opengles2_shared.cc | 2 | ||||
-rw-r--r-- | chromium/ppapi/shared_impl/resource_tracker.cc | 1 | ||||
-rw-r--r-- | chromium/ppapi/thunk/ppb_graphics_3d_thunk.cc | 1 |
16 files changed, 460 insertions, 50 deletions
diff --git a/chromium/ppapi/c/private/ppb_pdf.h b/chromium/ppapi/c/private/ppb_pdf.h index 7bcb8c684c1..267037219f6 100644 --- a/chromium/ppapi/c/private/ppb_pdf.h +++ b/chromium/ppapi/c/private/ppb_pdf.h @@ -116,12 +116,17 @@ struct PP_PrivateAccessibilityCharInfo { // This holds the link information provided by the PDF and will be used in // accessibility to provide the link information. Needs to stay in sync with // C++ versions (PdfAccessibilityLinkInfo and PrivateAccessibilityLinkInfo). +// This struct contains index state that should be validated using +// PdfAccessibilityTree::IsDataFromPluginValid() before usage. struct PP_PrivateAccessibilityLinkInfo { // URL of the link. const char* url; uint32_t url_length; // Index of the link in the page. This will be used to identify the link on // which action has to be performed in the page. + // |index_in_page| is populated and used in plugin process to handle + // accessiility actions from mimehandler process. It's value should be + // validated in plugin before usage. uint32_t index_in_page; // Link can either be part of the page text or not. If the link is part of the // page text, then |text_run_index| denotes the text run which contains the @@ -138,6 +143,8 @@ struct PP_PrivateAccessibilityLinkInfo { // This holds the image information provided by the PDF and will be used in // accessibility to provide the image information. Needs to stay in sync with // C++ versions (PdfAccessibilityImageInfo and PrivateAccessibilityImageInfo). +// This struct contains index state that should be validated using +// PdfAccessibilityTree::IsDataFromPluginValid() before usage. struct PP_PrivateAccessibilityImageInfo { // Alternate text for the image provided by PDF. const char* alt_text; @@ -155,12 +162,17 @@ struct PP_PrivateAccessibilityImageInfo { // popup note, the data of which is also captured here. // Needs to stay in sync with C++ versions (PdfAccessibilityHighlightInfo and // PrivateAccessibilityHighlightInfo). +// This struct contains index state that should be validated using +// PdfAccessibilityTree::IsDataFromPluginValid() before usage. struct PP_PrivateAccessibilityHighlightInfo { // Represents the text of the associated popup note, if present. const char* note_text; uint32_t note_text_length; // Index of the highlight in the page annotation list. Used to identify the // annotation on which action needs to be performed. + // |index_in_page| is populated and used in plugin process to handle + // accessiility actions from mimehandler process. It's value should be + // validated in plugin before usage. uint32_t index_in_page; // Highlights are annotations over existing page text. |text_run_index| // denotes the index of the text run where the highlight starts and @@ -178,6 +190,8 @@ struct PP_PrivateAccessibilityHighlightInfo { // This holds text form field information provided by the PDF and will be used // in accessibility to expose it. Needs to stay in sync with C++ versions // (PdfAccessibilityTextFieldInfo and PrivateAccessibilityTextFieldInfo). +// This struct contains index state that should be validated using +// PdfAccessibilityTree::IsDataFromPluginValid() before usage. struct PP_PrivateAccessibilityTextFieldInfo { // Represents the name property of text field, if present. const char* name; @@ -194,6 +208,9 @@ struct PP_PrivateAccessibilityTextFieldInfo { bool is_password; // Index of the text field in the collection of text fields in the page. Used // to identify the annotation on which action needs to be performed. + // |index_in_page| is populated and used in plugin process to handle + // accessiility actions from mimehandler process. It's value should be + // validated in plugin before usage. uint32_t index_in_page; // We anchor the text field to a text run index, this denotes the text run // before which the text field should be inserted in the accessibility tree. @@ -202,10 +219,125 @@ struct PP_PrivateAccessibilityTextFieldInfo { struct PP_FloatRect bounds; }; -// Holds links, images and highlights within a PDF page so that IPC messages -// passing accessibility objects do not have too many parameters. -// Needs to stay in sync with C++ versions (PdfAccessibilityPageObjects and -// PrivateAccessibilityPageObjects). +// This holds choice form field option information provided by the PDF and +// will be used in accessibility to expose it. Needs to stay in sync with C++ +// versions (PdfAccessibilityChoiceFieldOptionInfo and +// PrivateAccessibilityChoiceFieldOptionInfo). +struct PP_PrivateAccessibilityChoiceFieldOptionInfo { + // Represents the name property of choice field option. + const char* name; + uint32_t name_length; + // Represents if a choice field option is selected or not. + bool is_selected; + // Bounding box of the choice field option. + struct PP_FloatRect bounds; +}; + +typedef enum { + PP_PRIVATECHOICEFIELD_LISTBOX = 0, + PP_PRIVATECHOICEFIELD_COMBOBOX = 1, + PP_PRIVATECHOICEFIELD_LAST = PP_PRIVATECHOICEFIELD_COMBOBOX +} PP_PrivateChoiceFieldType; + +// This holds choice form field information provided by the PDF and will be used +// in accessibility to expose it. Needs to stay in sync with C++ versions +// (PdfAccessibilityChoiceFieldInfo and PrivateAccessibilityChoiceFieldInfo). +// This struct contains index state that should be validated using +// PdfAccessibilityTree::IsDataFromPluginValid() before usage. +struct PP_PrivateAccessibilityChoiceFieldInfo { + // Represents the name property of choice field, if present. + const char* name; + uint32_t name_length; + // Represents list of options in choice field, if present. + struct PP_PrivateAccessibilityChoiceFieldOptionInfo* options; + uint32_t options_length; + // Represents type of choice field. + PP_PrivateChoiceFieldType type; + // Represents if the choice field is non-editable. + bool is_read_only; + // Represents if the choice field is multi-selectable. + bool is_multi_select; + // Represents if the choice field includes an editable text box. + bool has_editable_text_box; + // Index of the choice field in the collection of choice fields in the page. + // Used to identify the annotation on which action needs to be performed. + // |index_in_page| is populated and used in plugin process to handle + // accessiility actions from mimehandler process. It's value should be + // validated in plugin before usage. + uint32_t index_in_page; + // We anchor the choice field to a text run index, this denotes the text run + // before which the choice field should be inserted in the accessibility tree. + uint32_t text_run_index; + // Bounding box of the choice field. + struct PP_FloatRect bounds; +}; + +typedef enum { + PP_PRIVATEBUTTON_PUSHBUTTON = 1, + PP_PRIVATEBUTTON_FIRST = PP_PRIVATEBUTTON_PUSHBUTTON, + PP_PRIVATEBUTTON_CHECKBOX = 2, + PP_PRIVATEBUTTON_RADIOBUTTON = 3, + PP_PRIVATEBUTTON_LAST = PP_PRIVATEBUTTON_RADIOBUTTON +} PP_PrivateButtonType; + +// This holds button form field information provided by the PDF and will be +// used in accessibility to expose it. Needs to stay in sync with C++ versions +// (PdfAccessibilityButtonInfo and PrivateAccessibilityButtonInfo). +// This struct contains index states that should be validated using +// PdfAccessibilityTree::IsDataFromPluginValid() before usage. +struct PP_PrivateAccessibilityButtonInfo { + // Represents the name property of button, if present. + const char* name; + uint32_t name_length; + // Represents the value property of button, if present. + const char* value; + uint32_t value_length; + // Represents the button type. + PP_PrivateButtonType type; + // Represents if the button is non-editable. + bool is_read_only; + // Represents if the radio button or check box is checked or not. + bool is_checked; + // Represents count of controls in the control group. A group of interactive + // form annotations is collectively called a form control group. Here, an + // interactive form annotation, should be either a radio button or a checkbox. + // Value of |control_count| is >= 1. + uint32_t control_count; + // Represents index of the control in the control group. A group of + // interactive form annotations is collectively called a form control group. + // Here, an interactive form annotation, should be either a radio button or a + // checkbox. Value of |control_index| should always be less than + // |control_count|. + uint32_t control_index; + // Index of the button in the collection of buttons in the page. Used + // to identify the annotation on which action needs to be performed. + // |index_in_page| is populated and used in plugin process to handle + // accessiility actions from mimehandler process. It's value should be + // validated in plugin before usage. + uint32_t index_in_page; + // We anchor the button to a text run index, this denotes the text run + // before which the button should be inserted in the accessibility tree. + uint32_t text_run_index; + // Bounding box of the button. + struct PP_FloatRect bounds; +}; + +// This holds form fields within a PDF page. Needs to stay in sync with C++ +// versions (PdfAccessibilityFormFieldInfo and +// PrivateAccessibilityFormFieldInfo). +struct PP_PrivateAccessibilityFormFieldInfo { + struct PP_PrivateAccessibilityTextFieldInfo* text_fields; + uint32_t text_field_count; + struct PP_PrivateAccessibilityChoiceFieldInfo* choice_fields; + uint32_t choice_field_count; + struct PP_PrivateAccessibilityButtonInfo* buttons; + uint32_t button_count; +}; + +// This holds different PDF page objects - links, images, highlights and +// form fields within a PDF page so that IPC messages passing accessibility +// objects do not have too many parameters. Needs to stay in sync with C++ +// versions (PdfAccessibilityPageObjects and PrivateAccessibilityPageObjects). struct PP_PrivateAccessibilityPageObjects { struct PP_PrivateAccessibilityLinkInfo* links; uint32_t link_count; @@ -213,8 +345,7 @@ struct PP_PrivateAccessibilityPageObjects { uint32_t image_count; struct PP_PrivateAccessibilityHighlightInfo* highlights; uint32_t highlight_count; - struct PP_PrivateAccessibilityTextFieldInfo* text_fields; - uint32_t text_field_count; + struct PP_PrivateAccessibilityFormFieldInfo form_fields; }; struct PPB_PDF { diff --git a/chromium/ppapi/cpp/private/pdf.cc b/chromium/ppapi/cpp/private/pdf.cc index d91f54ecb55..ddfbde65f16 100644 --- a/chromium/ppapi/cpp/private/pdf.cc +++ b/chromium/ppapi/cpp/private/pdf.cc @@ -88,6 +88,48 @@ void ConvertPrivateAccessibilityTextFieldInfo( info->bounds = text_field.bounds; } +void ConvertPrivateAccessibilityChoiceFieldInfo( + const PDF::PrivateAccessibilityChoiceFieldInfo& choice_field, + PP_PrivateAccessibilityChoiceFieldInfo* info, + std::vector<PP_PrivateAccessibilityChoiceFieldOptionInfo>* option_info) { + info->name = choice_field.name.c_str(); + info->name_length = choice_field.name.size(); + + option_info->resize(choice_field.options.size()); + info->options = option_info->data(); + for (size_t i = 0; i < choice_field.options.size(); i++) { + info->options[i].name = choice_field.options[i].name.c_str(); + info->options[i].name_length = choice_field.options[i].name.size(); + info->options[i].is_selected = choice_field.options[i].is_selected; + info->options[i].bounds = choice_field.options[i].bounds; + } + info->options_length = choice_field.options.size(); + info->type = choice_field.type; + info->is_read_only = choice_field.is_read_only; + info->is_multi_select = choice_field.is_multi_select; + info->has_editable_text_box = choice_field.has_editable_text_box; + info->index_in_page = choice_field.index_in_page; + info->text_run_index = choice_field.text_run_index; + info->bounds = choice_field.bounds; +} + +void ConvertPrivateAccessibilityButtonInfo( + const PDF::PrivateAccessibilityButtonInfo& button, + PP_PrivateAccessibilityButtonInfo* info) { + info->name = button.name.c_str(); + info->name_length = button.name.size(); + info->value = button.value.c_str(); + info->value_length = button.value.size(); + info->type = button.type; + info->is_read_only = button.is_read_only; + info->is_checked = button.is_checked; + info->control_count = button.control_count; + info->control_index = button.control_index; + info->index_in_page = button.index_in_page; + info->text_run_index = button.text_run_index; + info->bounds = button.bounds; +} + } // namespace // static @@ -299,7 +341,7 @@ void PDF::SetAccessibilityPageInfo( } const std::vector<PrivateAccessibilityTextFieldInfo>& text_fields = - page_objects.text_fields; + page_objects.form_fields.text_fields; std::vector<PP_PrivateAccessibilityTextFieldInfo> text_field_info( text_fields.size()); for (size_t i = 0; i < text_fields.size(); ++i) { @@ -307,6 +349,24 @@ void PDF::SetAccessibilityPageInfo( &text_field_info[i]); } + const std::vector<PrivateAccessibilityChoiceFieldInfo>& choice_fields = + page_objects.form_fields.choice_fields; + std::vector<PP_PrivateAccessibilityChoiceFieldInfo> choice_field_info( + choice_fields.size()); + std::vector<std::vector<PP_PrivateAccessibilityChoiceFieldOptionInfo> > + choice_field_option_info(choice_fields.size()); + for (size_t i = 0; i < choice_fields.size(); ++i) { + ConvertPrivateAccessibilityChoiceFieldInfo(choice_fields[i], + &choice_field_info[i], + &choice_field_option_info[i]); + } + + const std::vector<PrivateAccessibilityButtonInfo>& buttons = + page_objects.form_fields.buttons; + std::vector<PP_PrivateAccessibilityButtonInfo> button_info(buttons.size()); + for (size_t i = 0; i < buttons.size(); ++i) + ConvertPrivateAccessibilityButtonInfo(buttons[i], &button_info[i]); + PP_PrivateAccessibilityPageObjects pp_page_objects; pp_page_objects.links = link_info.data(); pp_page_objects.link_count = link_info.size(); @@ -314,8 +374,12 @@ void PDF::SetAccessibilityPageInfo( pp_page_objects.image_count = image_info.size(); pp_page_objects.highlights = highlight_info.data(); pp_page_objects.highlight_count = highlight_info.size(); - pp_page_objects.text_fields = text_field_info.data(); - pp_page_objects.text_field_count = text_field_info.size(); + pp_page_objects.form_fields.text_fields = text_field_info.data(); + pp_page_objects.form_fields.text_field_count = text_field_info.size(); + pp_page_objects.form_fields.choice_fields = choice_field_info.data(); + pp_page_objects.form_fields.choice_field_count = choice_field_info.size(); + pp_page_objects.form_fields.buttons = button_info.data(); + pp_page_objects.form_fields.button_count = button_info.size(); get_interface<PPB_PDF>()->SetAccessibilityPageInfo( instance.pp_instance(), page_info, text_run_info.data(), chars.data(), diff --git a/chromium/ppapi/cpp/private/pdf.h b/chromium/ppapi/cpp/private/pdf.h index 03881cea825..0853430d828 100644 --- a/chromium/ppapi/cpp/private/pdf.h +++ b/chromium/ppapi/cpp/private/pdf.h @@ -98,13 +98,81 @@ class PDF { FloatRect bounds; }; + // C++ version of PP_PrivateAccessibilityChoiceFieldOptionInfo. + // Needs to stay in sync with the C version. + struct PrivateAccessibilityChoiceFieldOptionInfo { + std::string name; + bool is_selected; + FloatRect bounds; + }; + + // C++ version of PP_PrivateAccessibilityChoiceFieldInfo. + // Needs to stay in sync with the C version. + struct PrivateAccessibilityChoiceFieldInfo { + std::string name; + std::vector<PrivateAccessibilityChoiceFieldOptionInfo> options; + PP_PrivateChoiceFieldType type; + // Represents if the choice field is non-editable. + bool is_read_only; + // Represents if the choice field is multi-selectable. + bool is_multi_select; + // Represents if the choice field includes an editable text box. + bool has_editable_text_box; + // Index of this choice field in the collection of choice fields in the + // page. + uint32_t index_in_page; + // We anchor the choice field to a text run index, this denotes the text run + // before which the choice field should be inserted in the accessibility + // tree. + uint32_t text_run_index; + FloatRect bounds; + }; + + // C++ version of PP_PrivateAccessibilityButtonInfo. + // Needs to stay in sync with the C version. + struct PrivateAccessibilityButtonInfo { + std::string name; + std::string value; + // Represents the button type. + PP_PrivateButtonType type; + // Represents if the button is non-editable. + bool is_read_only; + // Represents if the radio button or check box is checked or not. + bool is_checked; + // Represents count of controls in the control group. A group of interactive + // form annotations is collectively called a form control group. Here, an + // interactive form annotation, should be either a radio button or a + // checkbox. Value of |control_count| is >= 1. + uint32_t control_count; + // Represents index of the control in the control group. A group of + // interactive form annotations is collectively called a form control group. + // Here, an interactive form annotation, should be either a radio button or + // a checkbox. Value of |control_index| should always be less than + // |control_count|. + uint32_t control_index; + // Index of this button in the collection of buttons in the page. + uint32_t index_in_page; + // We anchor the button to a text run index, this denotes the text run + // before which the button should be inserted in the accessibility tree. + uint32_t text_run_index; + FloatRect bounds; + }; + + // C++ version of PP_PrivateAccessibilityFormFieldInfo. + // Needs to stay in sync with the C version. + struct PrivateAccessibilityFormFieldInfo { + std::vector<PrivateAccessibilityTextFieldInfo> text_fields; + std::vector<PrivateAccessibilityChoiceFieldInfo> choice_fields; + std::vector<PrivateAccessibilityButtonInfo> buttons; + }; + // C++ version of PP_PrivateAccessibilityPageObjects. // Needs to stay in sync with the C version. struct PrivateAccessibilityPageObjects { std::vector<PrivateAccessibilityLinkInfo> links; std::vector<PrivateAccessibilityImageInfo> images; std::vector<PrivateAccessibilityHighlightInfo> highlights; - std::vector<PrivateAccessibilityTextFieldInfo> text_fields; + PrivateAccessibilityFormFieldInfo form_fields; }; // Returns true if the required interface is available. diff --git a/chromium/ppapi/proxy/enter_proxy.h b/chromium/ppapi/proxy/enter_proxy.h index b7dbef288c6..c57879fc4d5 100644 --- a/chromium/ppapi/proxy/enter_proxy.h +++ b/chromium/ppapi/proxy/enter_proxy.h @@ -7,7 +7,8 @@ #include <stdint.h> -#include "base/logging.h" +#include "base/check.h" +#include "base/notreached.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/proxy/host_dispatcher.h" #include "ppapi/proxy/plugin_dispatcher.h" diff --git a/chromium/ppapi/proxy/pdf_resource.cc b/chromium/ppapi/proxy/pdf_resource.cc index 48addd20cb5..de83fb6c1e0 100644 --- a/chromium/ppapi/proxy/pdf_resource.cc +++ b/chromium/ppapi/proxy/pdf_resource.cc @@ -226,32 +226,7 @@ void PDFResource::SetAccessibilityPageInfo( text_run_vector.reserve(page_info->text_run_count); for (size_t i = 0; i < page_info->text_run_count; i++) text_run_vector.emplace_back(text_runs[i]); - std::vector<ppapi::PdfAccessibilityLinkInfo> link_vector; - link_vector.reserve(page_objects->link_count); - for (size_t i = 0; i < page_objects->link_count; i++) { - link_vector.emplace_back(page_objects->links[i]); - } - std::vector<ppapi::PdfAccessibilityImageInfo> image_vector; - image_vector.reserve(page_objects->image_count); - for (size_t i = 0; i < page_objects->image_count; i++) { - image_vector.emplace_back(page_objects->images[i]); - } - std::vector<ppapi::PdfAccessibilityHighlightInfo> highlight_vector; - highlight_vector.reserve(page_objects->highlight_count); - for (size_t i = 0; i < page_objects->highlight_count; i++) { - highlight_vector.emplace_back(page_objects->highlights[i]); - } - std::vector<ppapi::PdfAccessibilityTextFieldInfo> text_field_vector; - text_field_vector.reserve(page_objects->text_field_count); - for (size_t i = 0; i < page_objects->text_field_count; i++) { - text_field_vector.emplace_back(page_objects->text_fields[i]); - } - - ppapi::PdfAccessibilityPageObjects ppapi_page_objects; - ppapi_page_objects.links = std::move(link_vector); - ppapi_page_objects.images = std::move(image_vector); - ppapi_page_objects.highlights = std::move(highlight_vector); - ppapi_page_objects.text_fields = std::move(text_field_vector); + ppapi::PdfAccessibilityPageObjects ppapi_page_objects(*page_objects); Post(RENDERER, PpapiHostMsg_PDF_SetAccessibilityPageInfo( diff --git a/chromium/ppapi/proxy/ppapi_messages.h b/chromium/ppapi/proxy/ppapi_messages.h index e610cb13ba6..bf83177f6e8 100644 --- a/chromium/ppapi/proxy/ppapi_messages.h +++ b/chromium/ppapi/proxy/ppapi_messages.h @@ -159,6 +159,10 @@ IPC_ENUM_TRAITS_MAX_VALUE(PP_PdfAccessibilityScrollAlignment, PP_PDF_ACCESSIBILITYSCROLLALIGNMENT_LAST) IPC_ENUM_TRAITS_MAX_VALUE(PP_PdfAccessibilityAnnotationType, PP_PDF_ACCESSIBILITY_ANNOTATIONTYPE_LAST) +IPC_ENUM_TRAITS_MAX_VALUE(PP_PrivateChoiceFieldType, PP_PRIVATECHOICEFIELD_LAST) +IPC_ENUM_TRAITS_MIN_MAX_VALUE(PP_PrivateButtonType, + PP_PRIVATEBUTTON_FIRST, + PP_PRIVATEBUTTON_LAST) IPC_STRUCT_TRAITS_BEGIN(PP_Point) IPC_STRUCT_TRAITS_MEMBER(x) @@ -346,11 +350,48 @@ IPC_STRUCT_TRAITS_BEGIN(ppapi::PdfAccessibilityTextFieldInfo) IPC_STRUCT_TRAITS_MEMBER(bounds) IPC_STRUCT_TRAITS_END() +IPC_STRUCT_TRAITS_BEGIN(ppapi::PdfAccessibilityChoiceFieldOptionInfo) + IPC_STRUCT_TRAITS_MEMBER(name) + IPC_STRUCT_TRAITS_MEMBER(is_selected) + IPC_STRUCT_TRAITS_MEMBER(bounds) +IPC_STRUCT_TRAITS_END() + +IPC_STRUCT_TRAITS_BEGIN(ppapi::PdfAccessibilityChoiceFieldInfo) + IPC_STRUCT_TRAITS_MEMBER(name) + IPC_STRUCT_TRAITS_MEMBER(options) + IPC_STRUCT_TRAITS_MEMBER(type) + IPC_STRUCT_TRAITS_MEMBER(is_read_only) + IPC_STRUCT_TRAITS_MEMBER(is_multi_select) + IPC_STRUCT_TRAITS_MEMBER(has_editable_text_box) + IPC_STRUCT_TRAITS_MEMBER(index_in_page) + IPC_STRUCT_TRAITS_MEMBER(text_run_index) + IPC_STRUCT_TRAITS_MEMBER(bounds) +IPC_STRUCT_TRAITS_END() + +IPC_STRUCT_TRAITS_BEGIN(ppapi::PdfAccessibilityButtonInfo) + IPC_STRUCT_TRAITS_MEMBER(name) + IPC_STRUCT_TRAITS_MEMBER(value) + IPC_STRUCT_TRAITS_MEMBER(type) + IPC_STRUCT_TRAITS_MEMBER(is_read_only) + IPC_STRUCT_TRAITS_MEMBER(is_checked) + IPC_STRUCT_TRAITS_MEMBER(control_count) + IPC_STRUCT_TRAITS_MEMBER(control_index) + IPC_STRUCT_TRAITS_MEMBER(index_in_page) + IPC_STRUCT_TRAITS_MEMBER(text_run_index) + IPC_STRUCT_TRAITS_MEMBER(bounds) +IPC_STRUCT_TRAITS_END() + +IPC_STRUCT_TRAITS_BEGIN(ppapi::PdfAccessibilityFormFieldInfo) + IPC_STRUCT_TRAITS_MEMBER(text_fields) + IPC_STRUCT_TRAITS_MEMBER(choice_fields) + IPC_STRUCT_TRAITS_MEMBER(buttons) +IPC_STRUCT_TRAITS_END() + IPC_STRUCT_TRAITS_BEGIN(ppapi::PdfAccessibilityPageObjects) IPC_STRUCT_TRAITS_MEMBER(links) IPC_STRUCT_TRAITS_MEMBER(images) IPC_STRUCT_TRAITS_MEMBER(highlights) - IPC_STRUCT_TRAITS_MEMBER(text_fields) + IPC_STRUCT_TRAITS_MEMBER(form_fields) IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_BEGIN(PP_URLComponent_Dev) diff --git a/chromium/ppapi/proxy/proxy_array_output.h b/chromium/ppapi/proxy/proxy_array_output.h index 455b026d33e..075879b4ff1 100644 --- a/chromium/ppapi/proxy/proxy_array_output.h +++ b/chromium/ppapi/proxy/proxy_array_output.h @@ -9,7 +9,7 @@ #include <vector> -#include "base/logging.h" +#include "base/check.h" #include "base/memory/ref_counted.h" #include "ppapi/c/pp_array_output.h" diff --git a/chromium/ppapi/proxy/proxy_completion_callback_factory.h b/chromium/ppapi/proxy/proxy_completion_callback_factory.h index 4b8bafe676a..2765827c8cb 100644 --- a/chromium/ppapi/proxy/proxy_completion_callback_factory.h +++ b/chromium/ppapi/proxy/proxy_completion_callback_factory.h @@ -7,7 +7,7 @@ #include <stdint.h> -#include "base/logging.h" +#include "base/check.h" #include "base/sequence_checker.h" #include "ppapi/cpp/completion_callback.h" #include "ppapi/utility/completion_callback_factory.h" diff --git a/chromium/ppapi/proxy/raw_var_data.cc b/chromium/ppapi/proxy/raw_var_data.cc index c1940827460..ee87df2ee19 100644 --- a/chromium/ppapi/proxy/raw_var_data.cc +++ b/chromium/ppapi/proxy/raw_var_data.cc @@ -5,6 +5,7 @@ #include "ppapi/proxy/raw_var_data.h" #include "base/containers/stack.h" +#include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/memory/unsafe_shared_memory_region.h" #include "base/stl_util.h" diff --git a/chromium/ppapi/proxy/serialized_handle.h b/chromium/ppapi/proxy/serialized_handle.h index 92370446772..4e1d1ec0981 100644 --- a/chromium/ppapi/proxy/serialized_handle.h +++ b/chromium/ppapi/proxy/serialized_handle.h @@ -11,7 +11,7 @@ #include <vector> #include "base/atomicops.h" -#include "base/logging.h" +#include "base/check_op.h" #include "base/memory/platform_shared_memory_region.h" #include "base/memory/read_only_shared_memory_region.h" #include "base/memory/ref_counted.h" diff --git a/chromium/ppapi/proxy/serialized_structs.h b/chromium/ppapi/proxy/serialized_structs.h index 0c95cbe34c6..522d61795ae 100644 --- a/chromium/ppapi/proxy/serialized_structs.h +++ b/chromium/ppapi/proxy/serialized_structs.h @@ -10,7 +10,6 @@ #include <string> #include <vector> -#include "base/logging.h" #include "build/build_config.h" #include "ppapi/c/dev/ppb_truetype_font_dev.h" #include "ppapi/c/pp_bool.h" 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" diff --git a/chromium/ppapi/thunk/ppb_graphics_3d_thunk.cc b/chromium/ppapi/thunk/ppb_graphics_3d_thunk.cc index d0babbb31bb..8489eef5490 100644 --- a/chromium/ppapi/thunk/ppb_graphics_3d_thunk.cc +++ b/chromium/ppapi/thunk/ppb_graphics_3d_thunk.cc @@ -6,6 +6,7 @@ #include <stdint.h> +#include "base/logging.h" #include "ppapi/c/pp_completion_callback.h" #include "ppapi/c/pp_errors.h" #include "ppapi/c/ppb_graphics_3d.h" |