Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ppapi/proxy/pdf_resource.h" | 5 #include "ppapi/proxy/pdf_resource.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 } | 161 } |
| 162 | 162 |
| 163 void PDFResource::GetV8ExternalSnapshotData(const char** natives_data_out, | 163 void PDFResource::GetV8ExternalSnapshotData(const char** natives_data_out, |
| 164 int* natives_size_out, | 164 int* natives_size_out, |
| 165 const char** snapshot_data_out, | 165 const char** snapshot_data_out, |
| 166 int* snapshot_size_out) { | 166 int* snapshot_size_out) { |
| 167 gin::V8Initializer::GetV8ExternalSnapshotData( | 167 gin::V8Initializer::GetV8ExternalSnapshotData( |
| 168 natives_data_out, natives_size_out, snapshot_data_out, snapshot_size_out); | 168 natives_data_out, natives_size_out, snapshot_data_out, snapshot_size_out); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void PDFResource::SetAccessibilityDocInfo( | |
| 172 PP_PrivateAccessibilityDocInfo* doc_info) { | |
| 173 Post(RENDERER, PpapiHostMsg_PDF_SetAccessibilityDocInfo(*doc_info)); | |
| 174 } | |
| 175 | |
| 176 void PDFResource::SetAccessibilityViewportInfo( | |
| 177 PP_PrivateAccessibilityViewportInfo* viewport_info) { | |
| 178 Post(RENDERER, PpapiHostMsg_PDF_SetAccessibilityViewportInfo(*viewport_info)); | |
| 179 } | |
| 180 | |
| 181 void PDFResource::SetAccessibilityPageInfo( | |
| 182 PP_PrivateAccessibilityPageInfo* page_info, | |
| 183 PP_PrivateAccessibilityTextRunInfo text_runs[], | |
| 184 PP_PrivateAccessibilityCharInfo chars[]) { | |
| 185 std::vector<PP_PrivateAccessibilityTextRunInfo> text_run_vector; | |
|
raymes
2016/05/30 04:17:37
You should be able to initialize the vector with t
dmazzoni
2016/05/31 21:45:02
Good idea, done.
Since this is per-page it should
| |
| 186 text_run_vector.resize(page_info->text_run_count); | |
| 187 for (size_t i = 0; i < page_info->text_run_count; ++i) | |
| 188 text_run_vector[i] = text_runs[i]; | |
| 189 | |
| 190 std::vector<PP_PrivateAccessibilityCharInfo> char_vector; | |
|
raymes
2016/05/30 04:17:37
nit: same here
dmazzoni
2016/05/31 21:45:01
Done.
| |
| 191 char_vector.resize(page_info->char_count); | |
| 192 for (size_t i = 0; i < page_info->char_count; ++i) | |
| 193 char_vector[i] = chars[i]; | |
| 194 | |
| 195 Post(RENDERER, PpapiHostMsg_PDF_SetAccessibilityPageInfo( | |
| 196 *page_info, text_run_vector, char_vector)); | |
| 197 } | |
| 198 | |
| 171 } // namespace proxy | 199 } // namespace proxy |
| 172 } // namespace ppapi | 200 } // namespace ppapi |
| OLD | NEW |