| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/c/private/ppb_pdf.h" | 9 #include "ppapi/c/private/ppb_pdf.h" |
| 10 #include "ppapi/thunk/enter.h" | 10 #include "ppapi/thunk/enter.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 int* natives_size_out, | 124 int* natives_size_out, |
| 125 const char** snapshot_data_out, | 125 const char** snapshot_data_out, |
| 126 int* snapshot_size_out) { | 126 int* snapshot_size_out) { |
| 127 EnterInstanceAPI<PPB_PDF_API> enter(instance); | 127 EnterInstanceAPI<PPB_PDF_API> enter(instance); |
| 128 if (enter.failed()) | 128 if (enter.failed()) |
| 129 return; | 129 return; |
| 130 enter.functions()->GetV8ExternalSnapshotData(natives_data_out, | 130 enter.functions()->GetV8ExternalSnapshotData(natives_data_out, |
| 131 natives_size_out, snapshot_data_out, snapshot_size_out); | 131 natives_size_out, snapshot_data_out, snapshot_size_out); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void SetAccessibilityViewportInfo( |
| 135 PP_Instance instance, |
| 136 PP_PrivateAccessibilityViewportInfo* viewport_info) { |
| 137 EnterInstanceAPI<PPB_PDF_API> enter(instance); |
| 138 if (enter.failed()) |
| 139 return; |
| 140 enter.functions()->SetAccessibilityViewportInfo(viewport_info); |
| 141 } |
| 142 |
| 143 void SetAccessibilityDocInfo( |
| 144 PP_Instance instance, |
| 145 PP_PrivateAccessibilityDocInfo* doc_info) { |
| 146 EnterInstanceAPI<PPB_PDF_API> enter(instance); |
| 147 if (enter.failed()) |
| 148 return; |
| 149 enter.functions()->SetAccessibilityDocInfo(doc_info); |
| 150 } |
| 151 |
| 152 void SetAccessibilityPageInfo( |
| 153 PP_Instance instance, |
| 154 uint32_t page_index, |
| 155 PP_PrivateAccessibilityPageInfo* page_info) { |
| 156 EnterInstanceAPI<PPB_PDF_API> enter(instance); |
| 157 if (enter.failed()) |
| 158 return; |
| 159 enter.functions()->SetAccessibilityPageInfo(page_index, page_info); |
| 160 } |
| 161 |
| 162 void SetAccessibilityTextRunInfo( |
| 163 PP_Instance instance, |
| 164 uint32_t page_index, |
| 165 uint32_t text_run_index, |
| 166 PP_PrivateAccessibilityTextRunInfo* text_run_info, |
| 167 PP_PrivateAccessibilityCharInfo chars[]) { |
| 168 EnterInstanceAPI<PPB_PDF_API> enter(instance); |
| 169 if (enter.failed()) |
| 170 return; |
| 171 enter.functions()->SetAccessibilityTextRunInfo( |
| 172 page_index, text_run_index, text_run_info, chars); |
| 173 } |
| 174 |
| 134 const PPB_PDF g_ppb_pdf_thunk = { | 175 const PPB_PDF g_ppb_pdf_thunk = { |
| 135 &GetFontFileWithFallback, | 176 &GetFontFileWithFallback, |
| 136 &GetFontTableForPrivateFontFile, | 177 &GetFontTableForPrivateFontFile, |
| 137 &SearchString, | 178 &SearchString, |
| 138 &DidStartLoading, | 179 &DidStartLoading, |
| 139 &DidStopLoading, | 180 &DidStopLoading, |
| 140 &SetContentRestriction, | 181 &SetContentRestriction, |
| 141 &UserMetricsRecordAction, | 182 &UserMetricsRecordAction, |
| 142 &HasUnsupportedFeature, | 183 &HasUnsupportedFeature, |
| 143 &SaveAs, | 184 &SaveAs, |
| 144 &Print, | 185 &Print, |
| 145 &IsFeatureEnabled, | 186 &IsFeatureEnabled, |
| 146 &SetSelectedText, | 187 &SetSelectedText, |
| 147 &SetLinkUnderCursor, | 188 &SetLinkUnderCursor, |
| 148 &GetV8ExternalSnapshotData, | 189 &GetV8ExternalSnapshotData, |
| 190 &SetAccessibilityViewportInfo, |
| 191 &SetAccessibilityDocInfo, |
| 192 &SetAccessibilityPageInfo, |
| 193 &SetAccessibilityTextRunInfo |
| 149 }; | 194 }; |
| 150 | 195 |
| 151 } // namespace | 196 } // namespace |
| 152 | 197 |
| 153 const PPB_PDF* GetPPB_PDF_Thunk() { | 198 const PPB_PDF* GetPPB_PDF_Thunk() { |
| 154 return &g_ppb_pdf_thunk; | 199 return &g_ppb_pdf_thunk; |
| 155 } | 200 } |
| 156 | 201 |
| 157 } // namespace thunk | 202 } // namespace thunk |
| 158 } // namespace ppapi | 203 } // namespace ppapi |
| OLD | NEW |