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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 void PDFResource::HasUnsupportedFeature() { | 136 void PDFResource::HasUnsupportedFeature() { |
137 Post(RENDERER, PpapiHostMsg_PDF_HasUnsupportedFeature()); | 137 Post(RENDERER, PpapiHostMsg_PDF_HasUnsupportedFeature()); |
138 } | 138 } |
139 | 139 |
140 void PDFResource::Print() { | 140 void PDFResource::Print() { |
141 Post(RENDERER, PpapiHostMsg_PDF_Print()); | 141 Post(RENDERER, PpapiHostMsg_PDF_Print()); |
142 } | 142 } |
143 | 143 |
144 void PDFResource::SaveAs() { | 144 void PDFResource::SaveAs(const PP_Var& url) { |
145 Post(RENDERER, PpapiHostMsg_PDF_SaveAs()); | 145 printf("PDFResource::SaveAs() would send PpapiHostMsg_PDF_SaveAs()\n"); |
| 146 scoped_refptr<ppapi::StringVar> url_str( |
| 147 ppapi::StringVar::FromPPVar(url)); |
| 148 std::string url_to_use; |
| 149 if (url_str.get()) { |
| 150 url_to_use = url_str->value(); |
| 151 } |
| 152 Post(RENDERER, PpapiHostMsg_PDF_SaveAs(url_to_use)); |
146 } | 153 } |
147 | 154 |
148 PP_Bool PDFResource::IsFeatureEnabled(PP_PDFFeature feature) { | 155 PP_Bool PDFResource::IsFeatureEnabled(PP_PDFFeature feature) { |
149 PP_Bool result = PP_FALSE; | 156 PP_Bool result = PP_FALSE; |
150 switch (feature) { | 157 switch (feature) { |
151 case PP_PDFFEATURE_HIDPI: | 158 case PP_PDFFEATURE_HIDPI: |
152 result = PP_TRUE; | 159 result = PP_TRUE; |
153 break; | 160 break; |
154 case PP_PDFFEATURE_PRINTING: | 161 case PP_PDFFEATURE_PRINTING: |
155 // TODO(raymes): Use PrintWebViewHelper::IsPrintingEnabled. | 162 // TODO(raymes): Use PrintWebViewHelper::IsPrintingEnabled. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 Post(RENDERER, | 206 Post(RENDERER, |
200 PpapiHostMsg_PDF_SetSelectedText(base::UTF8ToUTF16(selected_text))); | 207 PpapiHostMsg_PDF_SetSelectedText(base::UTF8ToUTF16(selected_text))); |
201 } | 208 } |
202 | 209 |
203 void PDFResource::SetLinkUnderCursor(const char* url) { | 210 void PDFResource::SetLinkUnderCursor(const char* url) { |
204 Post(RENDERER, PpapiHostMsg_PDF_SetLinkUnderCursor(url)); | 211 Post(RENDERER, PpapiHostMsg_PDF_SetLinkUnderCursor(url)); |
205 } | 212 } |
206 | 213 |
207 } // namespace proxy | 214 } // namespace proxy |
208 } // namespace ppapi | 215 } // namespace ppapi |
OLD | NEW |