summaryrefslogtreecommitdiff
path: root/public/fpdfview.h
AgeCommit message (Collapse)Author
2018-08-01Make FPDF_FormHandle be represented as an incomplete type.chromium/3510Tom Sepez
Make consistent with other public API types. Introduce CPDFSDKFormFillEnvironmentFromFPDFFormHandle() and FPDFFormHandleFromCPDFSDKFormFillEnvironment() helper functions. Use these to kill off some casts in the process. Change-Id: I6230ecdb4cecd03076f5e24c8cc49c45ad694da7 Reviewed-on: https://pdfium-review.googlesource.com/39250 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-07-10Create API for adding content marks and setting their params.chromium/3488Henrique Nakashima
This CL creates the following new functions in the public API: - FPDFPageObj_AddMark - FPDFPageObjMark_SetIntParam - FPDFPageObjMark_SetStringParam Bug: pdfium:1037 Change-Id: Icabf3fdd8e8153b9156bab807a3708d38a9365d8 Reviewed-on: https://pdfium-review.googlesource.com/37330 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-05-28Add const/non-const versions of remaining CPDF_Dictionary methods.Lei Zhang
GetObjectFor() and GetDirectObjectFor(). Change-Id: I588cd994dfccf0ffd4c8f91362a4806dc109251e Reviewed-on: https://pdfium-review.googlesource.com/32991 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-05-25Mark more CPDF_Objects as const in action and bookmark code.Lei Zhang
Change-Id: Ib5f4cdb9c7f9c33561028a85029649ba68f4a6e5 Reviewed-on: https://pdfium-review.googlesource.com/32912 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-05-08Mark CPDF_Object pointers as const in CPDF_ViewerPreferences.Lei Zhang
Work up the short call stack and mark FPDF_PAGERANGE as an opaque const pointer. Also fix CPDF_ViewerPreferences::GenericName() to return an optional string. Change-Id: I2356d38888fcff8d4da37dd3efc17b284ff90485 Reviewed-on: https://pdfium-review.googlesource.com/32174 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-05-08Add APIs to work with a FPDF_PAGERANGE.Lei Zhang
After getting a FPDF_PAGERANGE from FPDF_VIEWERREF_GetPrintPageRange(), one can now use FPDF_VIEWERREF_GetPrintPageRangeCount() to get the number of elements in the FPDF_PAGERANGE. One can then use FPDF_VIEWERREF_GetPrintPageRangeElement() to read the elements. Change-Id: I33eeff9026d01991ae1424e05b67f163245a35f9 Reviewed-on: https://pdfium-review.googlesource.com/32173 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-05-03Use strict types in FPDF API, try #3Tom Sepez
Rather than messing with actual inheritence, add type-checking wrappers and just blatantly cast to incomplete types. Along the way, this points out places where we would downcast without checking, which I fix. Change-Id: Ieb303eb46ad8522dfe082454f1f10f247ffd52d5 Reviewed-on: https://pdfium-review.googlesource.com/32030 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-05-01Check for NULL XFA context even when XFATom Sepez
Use strict typing for FPDF_Page to ensure we don't fall into code that expects the other page type when continuing from null context case. Change-Id: I7f028ef3e3d733f5557620030a87e22997da00d5 Reviewed-on: https://pdfium-review.googlesource.com/31770 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-05-01Make FPDF_Document always be CPDF_Document.Tom Sepez
Greatly minimize the impact between going back and forth from XFA being on/off, so that XFA case is just an extension beyond the non-XFA data structures we've shipped for years, instead of being a complete replacement of them. Change-Id: I6c98206e0ec99ea443547a4931eba912b1764d54 Reviewed-on: https://pdfium-review.googlesource.com/31690 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2018-04-25Add PostScript PASSTHROUGH options to FPDF_SetPrintMode().Lei Zhang
The existing PostScript modes write data into EMF comments. This satisfies Chromium's use case, but other embedders want to write data out via ExtEscape() in PASSTHROUGH mode. BUG=pdfium:1068 Change-Id: I998035e99fbb84b16dcd244b750b476cecc3bd22 Reviewed-on: https://pdfium-review.googlesource.com/31299 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
2018-04-12Add return value to FPDF_DeviceToPage().Lei Zhang
Do the same for FPDF_PageToDevice(). Clean up the internal implementation as well. Change-Id: Ia207bfa779d144cb9f0310e768750ab10e603b8f Reviewed-on: https://pdfium-review.googlesource.com/17370 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-04-05Remove spellchecking code from XFAchromium/3390Ryan Harrison
The existing code for spellchecking is non-functional and we are not planning on fixing/finishing it, so removing it, since it currently is marking everything as misspelt. BUG=pdfium:1054 Change-Id: I23aaa13c09aed483376d7d06f47fdf31d890786b Reviewed-on: https://pdfium-review.googlesource.com/29790 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-04-02Remove FPDF_SetPrintPostscriptLevel().chromium/3387Lei Zhang
This experimental API has been superceded by FPDF_SetPrintMode(). Change-Id: I41f8efbb2f40edea60df55c36f7ee3743ac20839 Reviewed-on: https://pdfium-review.googlesource.com/29510 Reviewed-by: Rebekah Potter <rbpotter@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-27Open FPDF_PAGEOBJECTMARK API.Henrique Nakashima
Initially it contains: - FPDFPageObj_CountMarks - FPDFPageObj_GetMark - FPDFPageObjMark_GetName This allows reading the content marks from a page object. Bug: pdfium:1037 Change-Id: I3d7554b71f938778890fdb44088e0d45dd2718d9 Reviewed-on: https://pdfium-review.googlesource.com/28710 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-01-16Add FPDF_GetPageBoundingBox API.chromium/3323Henrique Nakashima
This API returns the intersection of the media box and the crop box of a page. Bug: pdfium:973 Change-Id: I57a19ee526ea6d4cd621e1ad6019e51f69f92308 Reviewed-on: https://pdfium-review.googlesource.com/22810 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-01-15Correct doc for clipping param in FPDF_RenderPageBitmapWithMatrix.Henrique Nakashima
Change-Id: I29a164f3d7b42a0918a8c559c5de23febcaa311a Reviewed-on: https://pdfium-review.googlesource.com/22850 Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-01-11Improve documentation of FPDF_RenderPageBitmapWithMatrix.Henrique Nakashima
Change-Id: I5cb28dfd6b1e5670fc20093c5d2f9757ad6a4060 Reviewed-on: https://pdfium-review.googlesource.com/22830 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-01-10Add FPDFAnnot_GetAP to public API.Henrique Nakashima
The matching FPDFAnnot_SetAP will be added in a subsequent CL. Change-Id: If567e02c6c56138d218498879cb4a8ee91dff080 Reviewed-on: https://pdfium-review.googlesource.com/22450 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-09-25Update comments regarding dictionary keys in public APIS.chromium/3224Lei Zhang
Change-Id: I6420fb5a92c4121d68e9db91c822ea53655ae605 Reviewed-on: https://pdfium-review.googlesource.com/14730 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-09-20Add FPDFPath_GetPoint() APIchromium/3221Miklos Vajna
Combined with the previously added FPDFPath_CountPoint(), this allows getting the coordinates of all points of a path. Change-Id: Ic969723d4b01ee427498d38ce323c74147b87a9c Reviewed-on: https://pdfium-review.googlesource.com/14111 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-09-13Change behaviour of FPDF_RenderPageBitmapWithMatrixNicolas Pena
This CL changes the behavior of FPDF_RenderPageBitmapWithMatrix so it transforms the bitmap. Before, the page would be transformed and the assumption was that it would be drawn on a bitmap with the same dimensions as the original page. This does not work well because a transformation generally changes the dimensions of the page. The rectangles test is modified to include small rectangles in the corner of the page, so that it's clear that the whole original page is being displayed. Bug: pdfium:849 Change-Id: Ie89f959a1605fea59a15d239ca871ccd939ec92b Reviewed-on: https://pdfium-review.googlesource.com/13510 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2017-08-10Rename DLLEXPORT AND STDCALLDan Sinclair
This CL renames DLLEXPORT to FPDF_EXPORT and STDCALL to FPDF_CALLCONV to be more PDFium specific. This is split off of https://pdfium-review.googlesource.com/c/8970 by Felix Kauselmann. Bug: pdfium:825 Change-Id: I0aea9d43f1714b1e10e935c4a7eea685a5ad8998 Reviewed-on: https://pdfium-review.googlesource.com/10610 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-10Revert "Add a build target and a proper export header for shared library ↵Henrique Nakashima
builds." This reverts commit 00334675c18a0203f313cceb670c970a77280f49. Reason for revert: Breaking the deps roller - https://chromium-review.googlesource.com/c/609307 Original change's description: > Add a build target and a proper export header for shared library builds. > > This CL adds support for Chromium's component build feature to pdfium. > > The export header stub in fpdfview.h is expanded to match Chromium's > export mechanisms and patterns (fixes pdfium:825). > > A component/shared library build can be triggered by adding > > is_component_build = true > > as a gn argument. Please note that setting this will also affect some > of pdfiums dependencies like v8, which will be build as components > too. > > Additionally, this CL provides a "pdf_source_set" template which > dynamically enables the use of "source_set" when building a complete > static library or a shared library to reduce build time. > > When testing this it is recommended to only build the pdfium target as > most of pdfiums test rely on non-public functions which aren't exported > by the shared library. > > Bug: pdfium:825,pdfium:826 > Change-Id: Icedc538ec535e11d1e53c4d5fabc8c064b275752 > Reviewed-on: https://pdfium-review.googlesource.com/8970 > Reviewed-by: dsinclair <dsinclair@chromium.org> > Commit-Queue: dsinclair <dsinclair@chromium.org> TBR=thestig@chromium.org,tsepez@chromium.org,brucedawson@chromium.org,dsinclair@google.com,dsinclair@chromium.org,licorn@gmail.com Change-Id: Ib02af2298932481293f50d362ae87bfedf284821 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: pdfium:825, pdfium:826 Reviewed-on: https://pdfium-review.googlesource.com/10550 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2017-08-09Add a build target and a proper export header for shared library builds.Felix Kauselmann
This CL adds support for Chromium's component build feature to pdfium. The export header stub in fpdfview.h is expanded to match Chromium's export mechanisms and patterns (fixes pdfium:825). A component/shared library build can be triggered by adding is_component_build = true as a gn argument. Please note that setting this will also affect some of pdfiums dependencies like v8, which will be build as components too. Additionally, this CL provides a "pdf_source_set" template which dynamically enables the use of "source_set" when building a complete static library or a shared library to reduce build time. When testing this it is recommended to only build the pdfium target as most of pdfiums test rely on non-public functions which aren't exported by the shared library. Bug: pdfium:825,pdfium:826 Change-Id: Icedc538ec535e11d1e53c4d5fabc8c064b275752 Reviewed-on: https://pdfium-review.googlesource.com/8970 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-03APIs and tests for extracting bitmaps from image objectsJane Liu
Added FPDFImageObj_GetBitmap() that returns the bitmap of an image object, and a FPDFBitmap_GetFormat() that returns the format of a bitmap. * Fixed a small bitmap conversion bug in cfx_dibsource.cpp. * Enabled EmbedderTest::CompareBitmap() to support different formats of bitmaps. * Added an embedder test and a test PDF file with images of many different formats. Bug=pdfium:677 Change-Id: I6a72f9d969cf5f3577db9400ca33197c213622ed Reviewed-on: https://pdfium-review.googlesource.com/9690 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
2017-07-19Basic APIs and tests for extracting attachmentsJane Liu
1. Added API for extracting attachment properties and data. * Expanded the embedder test to cover all the new APIs. Bug=pdfium:174 Change-Id: I09bffd412410e9aea45faca442d2b72eefafef4e Reviewed-on: https://pdfium-review.googlesource.com/7790 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-07-13Restore FPDF_SetPrintingPostscriptLevel APIrbpotter
Need to restore this API so builds without the chromium text driver CL do not fail. BUG=chromium:734850 Change-Id: I320e482a54bf1224817efee8b50113169353f9be Reviewed-on: https://pdfium-review.googlesource.com/7830 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
2017-07-11Add Windows generic / text only printer driver support.rbpotter
BUG=chromium:734850 Change-Id: Icc0947e2e99e77a36d8963fcf0b6d3deea161d3e Reviewed-on: https://pdfium-review.googlesource.com/7194 Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-07-06Added APIs for getting/setting string pairs in annotation dictionariesJane Liu
1. Added APIs for getting/setting arbitary key + value string pairs in annotation dictionaries. * Added an embedder test testing all the new functions. Bug=pdfium:737 Change-Id: I93c9ca6fccf787028e106607ef8cf549ebca95d8 Reviewed-on: https://pdfium-review.googlesource.com/7150 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-06-01Basic APIs and tests for extracting annotationsJane Liu
1. Added API for extracting annotation properties: * Added testing flag "--annot" that outputs the annotation properties into a .txt file. * Added two embedder tests covering all the API functions. Bug=pdfium:737 Change-Id: I95943a9b2b3d5d431bc8a74a31b27b4f4b521026 Reviewed-on: https://pdfium-review.googlesource.com/6092 Commit-Queue: Jane Liu <janeliulwq@google.com> Reviewed-by: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-05-08Add raw PostScript output to pdfium_test on Windows.Lei Zhang
Activated by --ps2 and --ps3 for PostScript level 2 and 3, respectively. The raw output is not formatted in a way for most PostScript processing tools to recognize as actually PostScript. Also fix the type of the parameter to FPDF_SetPrintPostscriptLevel() even though it ends up being a no-op. Change-Id: Iaa34fd3dfaedad2b016fefe1227cbed9c974ae2a Reviewed-on: https://pdfium-review.googlesource.com/4996 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-03-16Introduce unique_ptr compatible deleters for FPDF typeschromium/3044Tom Sepez
Pre-requisite for easily fixing some leaks in sample code, fuzzers, etc. Kill off some types completely unused in the C API. Change-Id: I67f0a5c6eef63d8e062ca4bc97c9db03970fe337 Reviewed-on: https://pdfium-review.googlesource.com/3095 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-02-27Fix nits from commit db764708.Lei Zhang
- Constify test data - ASSERT_EQ() buffer size - EXPECT_EQ() arguments are reversed - Fix typos in comments Change-Id: I846bfcc29bbf43d0a8b333250d1cce1aae5a8d59 Reviewed-on: https://pdfium-review.googlesource.com/2841 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2017-01-12Add postscript pathrbpotter
This patch adds the additional functions required to make postscript printing functional. The most significant additions are are two added compression functions and a new API for setting the postscript level. Not currently called from Chromium, Chromium patch to come. BUG= Review-Url: https://codereview.chromium.org/2612243005
2016-11-23Add FPDF_RenderPageBitmapWithMatrix API.thestig
BUG=pdfium:522 Review-Url: https://codereview.chromium.org/2526473002
2016-11-23Add APIs for limited use of document tagged code.thestig
BUG=pdfium:568 Review-Url: https://codereview.chromium.org/2519343002
2016-11-04Implement FPDF_VIEWERREF_GetName() API.chromium/2910thestig
This is a generic API function to retrieve any viewer preference of type name. BUG=pdfium:414 Review-Url: https://codereview.chromium.org/2475923003
2016-09-09Define behaviors of FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw.chromium/2858chromium/2857chromium/2856jaepark
Previously, PDFium only supported widget annotations to draw forms. As we've implemented other annotations, the behavior of FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw changed. So, this CL clearly defines what needs to be done in FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw. This CL first assumes that PDFium users will always call FPDF_RenderPageBitmap_Retail and FPDF_FFLDraw to render PDF pages, because otherwise they are not able to support PDF forms. FPDF_RenderPageBitmap_Retail should only deal with non-widget annotations, such as highlight, underline, text, etc. If FPDF_ANNOT flag is passed, non-widget annotations are drawn. Otherwise, they are hidden. FPDF_FFLDraw should only deal with annotations that requires user-interaction, such as widget annotations and popup annotation. Since popup annotation is associated with non-widget annotation, they should not be drawn if the associated annotation is hidden. Thus, if FPDF_ANNOT flag is passed, popup annotations are drawn. Otherwise, they are hidden. Widget annotations should be always drawn regardless of FPDF_ANNOT flag since they need to be always displayed for PDF forms. Also, roll DEPS for testing/corpus to 8485b30. BUG=pdfium:594 Review-Url: https://codereview.chromium.org/2323203002
2016-07-18Implement CGdiPrinterDriver::DrawDeviceText().chromium/2801thestig
This is sufficient to print text with GDI for PDFs generated by Chromium and cannot print any arbitrary PDF. Text that cannot be printed will be drawn as glyphs as before. BUG=409472 Review-Url: https://codereview.chromium.org/2113563003
2016-05-26Remove checks for _WIN32_WCE.thestig
Review-Url: https://codereview.chromium.org/2011563006
2016-03-14Add bitmaps and skp output to Skia portCary Clark
This is a first-cut at supporting bitmaps. Also added a --skp option to pdfium_test to generate a Skia picture file. The picture file can be loaded in Skia's SampleApp, debugger, or skiaserver to examine the generated picture. (This also includes fixes suggested in the prior Skia CL. My apologies for fat-fingers abandoning that one.) R=dsinclair@chromium.org, tsepez@chromium.org, dsinclair Review URL: https://codereview.chromium.org/1776313002 .
2016-03-09Review and cleanup lint warnings.Dan Sinclair
This CL goes through the remaining list of list warnings and records why they are currently blacklisted, or fixes and enables them. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1773733002 .
2016-02-24Fixing whitespace lint errors.Dan Sinclair
This CL enables several of the diabled whitelist/* lint checks. R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1730553002 .
2015-11-30Allow building non-XFA (master) on the XFA branch.Tom Sepez
This first pass is GYP-only, will do GN in the next CL. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1480403002 .
2015-11-20Make XFA public more closely match master.Tom Sepez
There will be significant differences, but these are the minor ones. I removed a comment that doesn't seem to add a lot of value. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1465723002 .
2015-10-20[Merge to XFA] Minor documentation updates for fpdfview.h.Dan Sinclair
This does some minor copy editing and formatting of the documentation in the fpdfview.h header. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1411863004 . (cherry picked from commit 19169dae5bf92813b7419793f61dfca8b4fb9124) Review URL: https://codereview.chromium.org/1420593002 .
2015-10-07Merge to XFA: Pass v8::Isolate to PDFium at init time.Tom Sepez
New code changes in JS_Runtime.cpp. (cherry picked from commit 3dedace9623fef6161a8666e53a4ab2b9be61e4c) Original Review URL: https://codereview.chromium.org/1367033002 . Also merge to XFA: Run FXJS_V8 embedder tests against a shared isolate, since the two go together. (cherry picked from commit 4ea721cb7954898a9722c389dae86c62957352d0) Original Review URL: https://codereview.chromium.org/1377293004 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1381633008 .
2015-09-23Merge to XFA: Allow external font-path configuration from pdfium_test.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1268323004 . (cherry picked from commit 9311163b564785a3a3ccdcb09bd3b7d0b2976d1a) Review URL: https://codereview.chromium.org/1368513002 .
2015-08-04XFA: clang-format all pdfium code.Nico Weber
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none
2015-05-20Merge to XFA: Tidy public fpdfview.h and fpdf_flatten.h.Tom Sepez
Original Review URL: https://codereview.chromium.org/1139993003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1144973004