summaryrefslogtreecommitdiffstats
path: root/pdf
Commit message (Collapse)AuthorAgeFilesLines
* PDF: Correct typo in form fill environment functionsthestig2014-11-181-2/+2
| | | | | | | | | | | | | | | | Rolls PDF to 1dc4f4112d72c63e465d6f09695ebea1119d39a6. This brings in: 1dc4f411: Rename functions in test code also 2c021e02: Correct typo in form fill environment functions 893fe94f: Remove FX_LPCWSTR cast to wchar_t* literals d66fda28: Change from 'this' to L'this' and remove the cast Original CL: https://codereview.chromium.org/711553003/ Original Author: bo_xu@foxitsoftware.com Review URL: https://codereview.chromium.org/738543002 Cr-Commit-Position: refs/heads/master@{#304530}
* Initialize V8 in PDFium from external files (plugin process only)baixo2014-11-142-1/+13
| | | | | | | | BUG=421063 Review URL: https://codereview.chromium.org/718453003 Cr-Commit-Position: refs/heads/master@{#304223}
* Initialize V8 in PDFium from external files when plugin is running in the ↵baixo2014-11-132-0/+13
| | | | | | | | | | renderer process. BUG=421063 Review URL: https://codereview.chromium.org/705623002 Cr-Commit-Position: refs/heads/master@{#304020}
* Add pdf layer code for PDFium XFA module.tsepez2014-11-122-4/+385
| | | | | | | | | | | | This is a landing of the patch from issue 705823002. TBR because the same patch has already been LGTM'd in https://codereview.chromium.org/705823002. BUG=62400 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/722863002 Cr-Commit-Position: refs/heads/master@{#303923}
* PDF: Fix potential bad indexes in find results.thestig2014-11-044-55/+119
| | | | | | | | | | | Add a new FindTextData class to store the index to avoid all the size_t to int casts. BUG=416696 Review URL: https://codereview.chromium.org/691273003 Cr-Commit-Position: refs/heads/master@{#302532}
* Fix rotation shortcut keys in PDFdeepak.m12014-11-031-1/+2
| | | | | | | | | | Currently, if the control key is held down on non-mac platforms then we will never check whether the rotation keys are pressed (we will enter the first branch of the if-statement and so never enter the else-branch). This change ensures both branches are tested sequentially. BUG=429483 Review URL: https://codereview.chromium.org/689393002 Cr-Commit-Position: refs/heads/master@{#302418}
* Add a few missing overrides found by a new clang warning.thakis2014-10-302-92/+92
| | | | | | | | | | | | Namely, -Winconsistent-missing-override. While here, also remove "virtual" from the functions I'm marking override, like our new override style dictates. No behavior change. BUG=428099,417463 Review URL: https://codereview.chromium.org/690613005 Cr-Commit-Position: refs/heads/master@{#302018}
* Support non-integer scroll offsets being passed to the PDF plugin.raymes2014-10-292-16/+19
| | | | | | | | | | This broke as a result of non-integer scroll offsets being introduced into blink. BUG=303491 Review URL: https://codereview.chromium.org/685923002 Cr-Commit-Position: refs/heads/master@{#301765}
* fix PDF load issue (414827)gene2014-10-241-0/+9
| | | | | | | | BUG=414827 Review URL: https://codereview.chromium.org/672333002 Cr-Commit-Position: refs/heads/master@{#301009}
* PDF Viewer - PageUp/Down don't move pdf by page size in FitToPage moden.bansal2014-10-211-0/+8
| | | | | | | | | | | | | | | | Currently when pdf is scaled to fit to page mode, both page down and page up keys do not move pdf by page size. This is because both the keys are not handled in HandleInputEvent(). This patch updates HandleInputEvent() to factor in key codes for page up and page down to move pdf by page size in fit to page mode. Similar to left and right arrow keys. BUG=390599 Review URL: https://codereview.chromium.org/573523002 Cr-Commit-Position: refs/heads/master@{#300435}
* Replacing the OVERRIDE with override in /src/pdfanujk.sharma2014-10-102-37/+37
| | | | | | | | | | | This step is a giant search and replace for OVERRIDE to replace them with their lowercase versions. BUG=417463 Review URL: https://codereview.chromium.org/631683002 Cr-Commit-Position: refs/heads/master@{#299056}
* PDF Viewer - Search results don't work after rotating pdfn.bansal2014-10-032-5/+29
| | | | | | | | | | | | | | | | | | | | | | Currently search results are cleared when user rotates pdf document. As a result, the forward/backward buttons in find bar do not work if user rotates pdf document after finding some text in the document. This happens because |find_results_| is cleared in the method InvalidateAllPages(), which is called after rotation. This patch introduces a new method to restore find results state after invalidate operation is done. New find operation is done to ensure rects are correctly identified for search results and correct region is highlighted on pressing forward/backward buttons in find bar. BUG=389782 Review URL: https://codereview.chromium.org/555803002 Cr-Commit-Position: refs/heads/master@{#298083}
* Handle the keyboard event for ctrl+a inside pdf.js instead of ↵deepak.m12014-10-031-10/+4
| | | | | | | | | | | | out_of_process_pdf.cc This moves the logic to handle the ctrl+a keyboard event into the pdf.js container page, sending a message to the plugin to select all the text. This ensures that the event is handled, even if the plugin element doesn't have focus in the document. BUG=419986 Review URL: https://codereview.chromium.org/615853003 Cr-Commit-Position: refs/heads/master@{#297998}
* Add a getSelectedText method to the PDF plugin.jam2014-10-011-0/+5
| | | | | | Review URL: https://codereview.chromium.org/617163002 Cr-Commit-Position: refs/heads/master@{#297649}
* For loop is running un-nacessrily after match.deepak.m12014-09-291-1/+3
| | | | | | | | | | | loop should break after match as values are getting reset to empty rect after match.Changes done so that loop breaks after match. BUG=417621 Review URL: https://codereview.chromium.org/603903002 Cr-Commit-Position: refs/heads/master@{#297138}
* Memory allocation for WriteInto is not proper.deepak.m12014-09-272-4/+4
| | | | | | | | | | | | | Memory for WriteInto() should be greater than the url length, As in the WriteInto() it reserve the memory of size 'length_with_null' and then resize it to "length_with_null-1' Chnage done to give memory 1 greater than the url length size. BUG=417732 Review URL: https://codereview.chromium.org/599373003 Cr-Commit-Position: refs/heads/master@{#297102}
* Revert of PDF: Add some CHECKS to help debug a crash. (patchset #2 id:20001 ↵thestig2014-09-261-6/+0
| | | | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/457873003/) Reason for revert: No longer needed. Original issue's description: > PDF: Add some CHECKS to help debug a crash. > > BUG=402035 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=289822 TBR=gene@chromium.org NOTREECHECKS=true NOTRY=true BUG=402035 Review URL: https://codereview.chromium.org/607743005 Cr-Commit-Position: refs/heads/master@{#297067}
* PDF: Change the rotate shortcut keys to ctrl+[] on all platforms.thestig2014-09-261-14/+19
| | | | | | | | | | | The default modifier key on Mac is Command, but that conflicts with the forward and backward keys. BUG=111232,417902 Review URL: https://codereview.chromium.org/606933002 Cr-Commit-Position: refs/heads/master@{#297033}
* PDF Viewer - Add keyboard shortcuts for rotationn.bansal2014-09-192-0/+15
| | | | | | | | | | | | | | | Currently there are no keyboard shortcuts to rotate pdf documents. This patch adds the following keyboard shortcuts to rotate pdf documents : Rotate counterclockwise : Control + [ Rotate clockwise : Control + ] BUG=111232 Review URL: https://codereview.chromium.org/581913003 Cr-Commit-Position: refs/heads/master@{#295757}
* Let PDFium handle event when there is not yet a visible page.tsepez2014-09-181-0/+4
| | | | | | | | | | | Speculative fix for 415307. CF will confirm. The stack trace for that bug indicates an attempt to index by -1, which is consistent with no visible page. BUG=415307 Review URL: https://codereview.chromium.org/560133004 Cr-Commit-Position: refs/heads/master@{#295421}
* Check whether a number is passed as an argument to kJSSetZoomLevel rather ↵raymes2014-09-161-1/+1
| | | | | | | | | | | | | | | | than a double. In the in-process PDF plugin when checking the argument type of kJSSetZoomLevel calls to the plugin we would check if the argument is a double. But it may be an int and we really want to check if it's a number. This probably worked in the past by chance and broke when we switched to using gin to implement JS bindings for Pepper. BUG=413525 Review URL: https://codereview.chromium.org/569403004 Cr-Commit-Position: refs/heads/master@{#295008}
* Remove unneeded #include from out_of_proces_instance.ccraymes2014-09-161-1/+0
| | | | | | Review URL: https://codereview.chromium.org/571843002 Cr-Commit-Position: refs/heads/master@{#294995}
* PDF: Fix uninit memory access in PDFiumEngine.thestig2014-09-152-20/+59
| | | | | | | | | | This regressed in r294564. BUG=413850 Review URL: https://codereview.chromium.org/568803004 Cr-Commit-Position: refs/heads/master@{#294854}
* PDF: Manipulate the selected text buffer to deal with special 0xfffe hyphens.thestig2014-09-121-36/+69
| | | | | | | | | | | Also format text to match Adobe Reader. BUG=307523 TEST=Manual, see bug (and duplicates for more examples) Review URL: https://codereview.chromium.org/566773005 Cr-Commit-Position: refs/heads/master@{#294638}
* PDF links should open on mouse upn.bansal2014-09-122-7/+46
| | | | | | | | | | | | | | | Currently links in pdf open on mouse down. This doesn't give user any chance to cancel the action by moving the mouse without releasing the click. This patch adds the fix to make sure pdf opens link on mouse up and not on mouse down. BUG=409753 Review URL: https://codereview.chromium.org/553433002 Cr-Commit-Position: refs/heads/master@{#294564}
* PDF Viewer - Show context menu for links on right clickn.bansal2014-09-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | Currently context menu for page is shown when right clicked on links in the pdf. This happens because an empty string is returned as url to ContextMenuClientImpl::showContextMenu() from plugin. The reason for above is that GetLinkAtPosition() isn't passing a point in page coordinates to GetCharIndex() and GetCharIndex() expects the point to be in page coordinate. This means that when the document is zoomed or scrolled and right click is done then it doesn't work. This patch updates the point passed to GetCharIndex() to be in page coordinates by factoring in current position and zoom level. BUG=148665 Review URL: https://codereview.chromium.org/553453002 Cr-Commit-Position: refs/heads/master@{#294256}
* Fix uninitialized member from PageIndicator::PageIndicator().tsepez2014-09-101-0/+1
| | | | | | | | | | | | Per msan report, the line in question reads: if (timer_id == fade_out_timer_id_) { so initialize fade_out_timer_id_ in the constructor. BUG=411177 Review URL: https://codereview.chromium.org/557493002 Cr-Commit-Position: refs/heads/master@{#294055}
* PDFiumEngine::~PDFiumEngine - Unload() all pages_ before destroying any of them.tsepez2014-09-082-2/+5
| | | | | | | | | | | | | | | | | | | | Currently, destroying a PDFiumPage triggers an Unload() which can result in an access to other PDFiumPages. But these other pages may already have been destroyed as a previous element via STLDeleteElements(&pages_). Instead, unload all pages first, then destroy them all afterwards so that no access to other pages will be attempted after the destruction of the first one has begun. Move the STLDeleteElements() call to the bottom, to make it more closely mimic the ordering that might occur should pages_ someday be switched from vector to ScopedPtrVector or similar. BUG=384365 Review URL: https://codereview.chromium.org/544873002 Cr-Commit-Position: refs/heads/master@{#293800}
* Preven OOB memory access in chrome_pdf::AlphaBlend().tsepez2014-09-052-3/+9
| | | | | | | | | | | | | | Similar to bug 398384, but perform the same bounds check we introduced to chrome_pdf::CopyImage() in the chrome_pdf::AlphaBlend() function. Also change the return value from bool to void, since AlphaBlend() always returns true, and no-one was checking the return value anyways. BUG=384891 Review URL: https://codereview.chromium.org/544863002 Cr-Commit-Position: refs/heads/master@{#293454}
* Prevent the in-process PDF plugin re-entering into JS during blink layoutraymes2014-09-042-8/+26
| | | | | | | | | | | | | | | | | | | Layout changes trigger view changes which get sent to the plugin. With the in process plugin (PDF), the plugin is notified synchronously of the view change. It then might execute scripts synchronously in the plugin but scripts are not meant to be executed during layout changes. This change runs the scripts asynchronously. I tested print preview to ensure that it still works correctly. Note that once we remove in-process plugins this won't be an issue because view changes happen asynchronously out of process (besides the fact that synchronous script execution is limited to private plugins). BUG=351636 Review URL: https://codereview.chromium.org/530363002 Cr-Commit-Position: refs/heads/master@{#293256}
* Avoid OOB memcpy in chrome_pdf::CopyImage.tsepez2014-09-032-4/+13
| | | | | | | | | | | | This is a re-work of palmer's patch at https://codereview.chromium.org/515023002/ which has more context, but comes down to stricter bounds checking. We also correct an arithmetic bug when copying the image behind a control that is positioned before the origin of the image. BUG=398384 Review URL: https://codereview.chromium.org/519873002 Cr-Commit-Position: refs/heads/master@{#293213}
* Remove cevans@ from OWNERS files.thestig2014-08-291-2/+1
| | | | | | | | NOTRY=true Review URL: https://codereview.chromium.org/524433003 Cr-Commit-Position: refs/heads/master@{#292549}
* Extracted method to CreateSinglePageRasterPdf() to simplify ↵vitalybuka@chromium.org2014-08-202-46/+73
| | | | | | | | | | | | | PrintPagesAsRasterPDF(). Fixed page passed into FPDFPageObj_NewImgeObj(). BUG=385119 Review URL: https://codereview.chromium.org/485413002 Cr-Commit-Position: refs/heads/master@{#290780} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290780 0039d316-1c4b-4281-b951-d872f2087c98
* pdf: Use the default resource if high-dpi resources are unavailable.sadrul@chromium.org2014-08-201-3/+7
| | | | | | | | | | BUG=401242 R=thestig@chromium.org Review URL: https://codereview.chromium.org/484393002 Cr-Commit-Position: refs/heads/master@{#290766} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290766 0039d316-1c4b-4281-b951-d872f2087c98
* pdf: Early out from CopyImage if there's nothing to copy.sadrul@chromium.org2014-08-201-1/+3
| | | | | | | | | | | | | | If CopyImage is called with src is an empty rectangle (this can happen for example if one of the resources is not available), then the code ends up trying to read from null/uninitialized memory. So early out instead in such cases. BUG=401242 R=thestig@chromium.org Review URL: https://codereview.chromium.org/465133005 Cr-Commit-Position: refs/heads/master@{#290736} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290736 0039d316-1c4b-4281-b951-d872f2087c98
* OOP PDF - Add support for "page" open pdf parametern.bansal@samsung.com2014-08-191-55/+1
| | | | | | | | | | | | | | | This patch adds support for "page" feature of open PDF parameters in OOP PDF. When page is used as an open PDF parameter, then PDF should initially be loaded at the page specified by user. BUG=64309 Review URL: https://codereview.chromium.org/476733003 Cr-Commit-Position: refs/heads/master@{#290529} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290529 0039d316-1c4b-4281-b951-d872f2087c98
* Defer request to print a PDF when the user initiates the entire frame and ↵ivandavid@chromium.org2014-08-151-5/+6
| | | | | | | | | | | | | | | | the PDF hasn't loaded. Original fix: https://codereview.chromium.org/427723004/ The original fix was reverted, however it actually shouldn't have been because it was mostly correct. This fix is the same as the old one, with an additional change. The call to DidStopLoading() in Instance::DocumentLoadComplete was moved to an earlier part of the function, causing DidStopLoading to be called before the print preview request. BUG=376969 Review URL: https://codereview.chromium.org/467343003 Cr-Commit-Position: refs/heads/master@{#290010} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290010 0039d316-1c4b-4281-b951-d872f2087c98
* PDF: Add some CHECKS to help debug a crash.thestig@chromium.org2014-08-151-0/+6
| | | | | | | | | BUG=402035 Review URL: https://codereview.chromium.org/457873003 Cr-Commit-Position: refs/heads/master@{#289822} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289822 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 289312 "Move StringToUpperASCII and LowerCaseEqualsASCII ..."brettw@chromium.org2014-08-131-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > Move StringToUpperASCII and LowerCaseEqualsASCII to the base namespace > > Convert LowerCaseEqualsASCII to take StringPiece. In the current patch this is > generally a NOP but will allow me to delete the other 4 variants in a followup > (wanted to do that separately since that will require more review, since > callsites will be changed in nontrivial ways). > > In some cases, LowerCaseEqualsASCII is called with a WebString, which no > longer is implicitly converted. I added base::string16(...) around such > calls to force the right conversion. It happened in these files: > window_container_type.cc > savable_resources.cc > render_view_impl.cc > blink_ax_tree_source.cc > password_form_conversion_utils.cc > translate_helper.cc > chrome_render_view_observer.cc > dom_serializer_browsertest.cc > > R=jamesr@chromium.org > > Review URL: https://codereview.chromium.org/448143008 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/474483002 Cr-Commit-Position: refs/heads/master@{#289320} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289320 0039d316-1c4b-4281-b951-d872f2087c98
* Move StringToUpperASCII and LowerCaseEqualsASCII to the base namespacebrettw@chromium.org2014-08-131-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Convert LowerCaseEqualsASCII to take StringPiece. In the current patch this is generally a NOP but will allow me to delete the other 4 variants in a followup (wanted to do that separately since that will require more review, since callsites will be changed in nontrivial ways). In some cases, LowerCaseEqualsASCII is called with a WebString, which no longer is implicitly converted. I added base::string16(...) around such calls to force the right conversion. It happened in these files: window_container_type.cc savable_resources.cc render_view_impl.cc blink_ax_tree_source.cc password_form_conversion_utils.cc translate_helper.cc chrome_render_view_observer.cc dom_serializer_browsertest.cc R=jamesr@chromium.org Review URL: https://codereview.chromium.org/448143008 Cr-Commit-Position: refs/heads/master@{#289312} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289312 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crasher in the pdf tear down code path.ananta@chromium.org2014-08-131-0/+4
| | | | | | | | | | | | | | | The crash occurs because of a timer dereferencing a null engine pointer. The crash appears to have occurred due to this patch https://codereview.chromium.org/427583003/ Fix is to cancel all timers when the pdf instance is being torn down before destroying the engine. BUG=403036 Review URL: https://codereview.chromium.org/462283002 Cr-Commit-Position: refs/heads/master@{#289218} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289218 0039d316-1c4b-4281-b951-d872f2087c98
* Move StringToLowerASCII to base namespacebrettw@chromium.org2014-08-072-3/+3
| | | | | | | | TBR=sky Review URL: https://codereview.chromium.org/448853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288085 0039d316-1c4b-4281-b951-d872f2087c98
* Fix UAF in chrome_pdf::Instance::GetURL()tsepez@chromium.org2014-08-071-0/+3
| | | | | | | | | | | | | | The instance owns the engine via its engine_ scoped_ptr, so if the engine is being destroyed via the scoped_ptr destructor, it may not be safe to access anything in the instance since the instance may be partially destroyed. Instead, destroy the engine as the first step in the process so the instance is still intact. BUG=392956 Review URL: https://codereview.chromium.org/427583003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287955 0039d316-1c4b-4281-b951-d872f2087c98
* Fix scrollbar painting problems in pdf files in HiDPI mode with fractional ↵ananta@chromium.org2014-08-071-5/+0
| | | | | | | | | | | | | | | | scales. Reason for the bug is painting code in the pdf plugin which converts back and forth from pixels to DIP and back to pixels causing us to draw over the scrollbars. Division and multiplication with fractional scales Is a lossy operation. BUG=399150 TEST=Tested manually with fractional scales on Windows. Review URL: https://codereview.chromium.org/437873002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287952 0039d316-1c4b-4281-b951-d872f2087c98
* PDF: Handle the space bar key like page down.thestig@chromium.org2014-08-051-12/+12
| | | | | | | | BUG=397624 Review URL: https://codereview.chromium.org/431303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287520 0039d316-1c4b-4281-b951-d872f2087c98
* Remove OS_NACL #ifdefs in pdf/raymes@chromium.org2014-08-012-8/+0
| | | | | | | | | | | There are some OS_NACL ifdefs in pdf/{instance.cc/out_of_process_instance.cc}. I assume these are from long ago when we tried to get PDF running in NaCl but I believe that at present many more changes would be required to get it running in NaCl again so we might as well remove these. Review URL: https://codereview.chromium.org/424763008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286927 0039d316-1c4b-4281-b951-d872f2087c98
* Don't return uninitialized memory from PDFiumEngine::Form_Response().tsepez@chromium.org2014-07-291-2/+4
| | | | | | | | | | | | If the response is too long to return in the caller-supplied buffer, truncate it to fit per the description of the app_response method in third_party/pdfium/fpdfsdk/include/fpdfformfill.h BUG=397834 Review URL: https://codereview.chromium.org/424883002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286323 0039d316-1c4b-4281-b951-d872f2087c98
* Ensure pdf plugin sends DidStartLoading() consistentlyjaphet@chromium.org2014-07-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | There are situations where the pdf plugin will initialize itself in such a way that it never notifies content/renderer/ that it has started. In so doing, it also fails to send a stop message, since it tries to ensure it doesn't send mismatched start/stop messages. Print preview decides when to display the preview based on when loading stops. Since this only considers the page's content and not the pdf plugin's initialization, there is a race condition where we may try to preview before the plugin is ready. In this cases, we show "Loading preivew..." and never load the actual preview. There is a hack in place in print_preview_web_helper.cc to delay the process of showing the preview to maximize the chance that the pdf plugin will be ready. This change should allow us to rip that out. BUG=376969 Review URL: https://codereview.chromium.org/397713005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283837 0039d316-1c4b-4281-b951-d872f2087c98
* Fix potential integer overflow when initializing Rect.palmer@chromium.org2014-07-161-8/+10
| | | | | | | | BUG=350782 Review URL: https://codereview.chromium.org/385173004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283481 0039d316-1c4b-4281-b951-d872f2087c98
* PDF: Fix navigation for links that are just relative fragments.thestig@chromium.org2014-07-152-1/+23
| | | | | | | | | BUG=389333 TEST=Manual, see bug. Review URL: https://codereview.chromium.org/335993006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283268 0039d316-1c4b-4281-b951-d872f2087c98