Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: ppapi/proxy/pdf_resource.cc

Issue 554893002: [WORK_IN_PROGRESS] PDF::Save() fix for out-of-process-pdf. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better fix for constrained windows Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/pdf_resource.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ppapi/proxy/pdf_resource.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698