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

Side by Side Diff: samples/pdfium_test.cc

Issue 1639253008: Merge to XFA: Fix behaviour of app.alert() with a single object argument. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 10 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 | « fpdfsdk/src/javascript/app.cpp ('k') | testing/resources/javascript/app_alert.in » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <limits.h> 5 #include <limits.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // If a PS_NULL pen is used, the dimensions of the rectangle are 1 pixel less. 188 // If a PS_NULL pen is used, the dimensions of the rectangle are 1 pixel less.
189 Rectangle(dc, 0, 0, width + 1, height + 1); 189 Rectangle(dc, 0, 0, width + 1, height + 1);
190 190
191 FPDF_RenderPage(dc, page, 0, 0, width, height, 0, 191 FPDF_RenderPage(dc, page, 0, 0, width, height, 0,
192 FPDF_ANNOT | FPDF_PRINTING | FPDF_NO_CATCH); 192 FPDF_ANNOT | FPDF_PRINTING | FPDF_NO_CATCH);
193 193
194 DeleteEnhMetaFile(CloseEnhMetaFile(dc)); 194 DeleteEnhMetaFile(CloseEnhMetaFile(dc));
195 } 195 }
196 #endif 196 #endif
197 197
198 int ExampleAppAlert(IPDF_JSPLATFORM*, FPDF_WIDESTRING msg, FPDF_WIDESTRING, 198 int ExampleAppAlert(IPDF_JSPLATFORM*,
199 int, int) { 199 FPDF_WIDESTRING msg,
200 std::wstring platform_string = GetPlatformWString(msg); 200 FPDF_WIDESTRING title,
201 printf("Alert: %ls\n", platform_string.c_str()); 201 int nType,
202 int nIcon) {
203 printf("%ls", GetPlatformWString(title).c_str());
204 if (nIcon || nType)
205 printf("[icon=%d,type=%d]", nIcon, nType);
206 printf(": %ls\n", GetPlatformWString(msg).c_str());
202 return 0; 207 return 0;
203 } 208 }
204 209
205 void ExampleDocGotoPage(IPDF_JSPLATFORM*, int pageNumber) { 210 void ExampleDocGotoPage(IPDF_JSPLATFORM*, int pageNumber) {
206 printf("Goto Page: %d\n", pageNumber); 211 printf("Goto Page: %d\n", pageNumber);
207 } 212 }
208 213
209 void ExampleUnsupportedHandler(UNSUPPORT_INFO*, int type) { 214 void ExampleUnsupportedHandler(UNSUPPORT_INFO*, int type) {
210 std::string feature = "Unknown"; 215 std::string feature = "Unknown";
211 switch (type) { 216 switch (type) {
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 } 656 }
652 657
653 FPDF_DestroyLibrary(); 658 FPDF_DestroyLibrary();
654 #ifdef PDF_ENABLE_V8 659 #ifdef PDF_ENABLE_V8
655 v8::V8::ShutdownPlatform(); 660 v8::V8::ShutdownPlatform();
656 delete platform; 661 delete platform;
657 #endif // PDF_ENABLE_V8 662 #endif // PDF_ENABLE_V8
658 663
659 return 0; 664 return 0;
660 } 665 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/app.cpp ('k') | testing/resources/javascript/app_alert.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698