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 <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 SendCreate(RENDERER, PpapiHostMsg_PDF_Create()); | 41 SendCreate(RENDERER, PpapiHostMsg_PDF_Create()); |
42 } | 42 } |
43 | 43 |
44 PDFResource::~PDFResource() { | 44 PDFResource::~PDFResource() { |
45 } | 45 } |
46 | 46 |
47 thunk::PPB_PDF_API* PDFResource::AsPPB_PDF_API() { | 47 thunk::PPB_PDF_API* PDFResource::AsPPB_PDF_API() { |
48 return this; | 48 return this; |
49 } | 49 } |
50 | 50 |
51 PP_Var PDFResource::GetLocalizedString(PP_ResourceString string_id) { | |
52 std::string localized_string; | |
53 int32_t result = SyncCall<PpapiPluginMsg_PDF_GetLocalizedStringReply>( | |
54 RENDERER, PpapiHostMsg_PDF_GetLocalizedString(string_id), | |
55 &localized_string); | |
56 if (result != PP_OK) | |
57 return PP_MakeUndefined(); | |
58 return ppapi::StringVar::StringToPPVar(localized_string); | |
59 } | |
60 | |
61 void PDFResource::SearchString(const unsigned short* input_string, | 51 void PDFResource::SearchString(const unsigned short* input_string, |
62 const unsigned short* input_term, | 52 const unsigned short* input_term, |
63 bool case_sensitive, | 53 bool case_sensitive, |
64 PP_PrivateFindResult** results, int* count) { | 54 PP_PrivateFindResult** results, int* count) { |
65 if (locale_.empty()) | 55 if (locale_.empty()) |
66 locale_ = GetLocale(); | 56 locale_ = GetLocale(); |
67 const base::char16* string = | 57 const base::char16* string = |
68 reinterpret_cast<const base::char16*>(input_string); | 58 reinterpret_cast<const base::char16*>(input_string); |
69 const base::char16* term = | 59 const base::char16* term = |
70 reinterpret_cast<const base::char16*>(input_term); | 60 reinterpret_cast<const base::char16*>(input_term); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 void PDFResource::GetV8ExternalSnapshotData(const char** natives_data_out, | 161 void PDFResource::GetV8ExternalSnapshotData(const char** natives_data_out, |
172 int* natives_size_out, | 162 int* natives_size_out, |
173 const char** snapshot_data_out, | 163 const char** snapshot_data_out, |
174 int* snapshot_size_out) { | 164 int* snapshot_size_out) { |
175 gin::V8Initializer::GetV8ExternalSnapshotData( | 165 gin::V8Initializer::GetV8ExternalSnapshotData( |
176 natives_data_out, natives_size_out, snapshot_data_out, snapshot_size_out); | 166 natives_data_out, natives_size_out, snapshot_data_out, snapshot_size_out); |
177 } | 167 } |
178 | 168 |
179 } // namespace proxy | 169 } // namespace proxy |
180 } // namespace ppapi | 170 } // namespace ppapi |
OLD | NEW |