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

Issue 2400743002: Improved Pinch-Zoom for PDF. (Closed)

Created:
4 years, 2 months ago by Kevin McNee - google account
Modified:
4 years, 1 month ago
CC:
arv+watch_chromium.org, chromium-reviews, oshima+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Improved Pinch-Zoom for PDF. Currently, when the PDF viewer is pinch-zoomed, the content is not rerastered and the viewer's controls are scaled off screen. We now have the viewer handle the pinch-zoom events, instead of the browser. We compute scrollbars and scale after a pinch and apply transforms on the existing bitmap. This allows us to keep the controls fixed and only scale the content as well as reraster the content when needed. BUG=605379 patch from issue 1901903002 at patchset 80001 (http://crrev.com/1901903002#ps80001) This is a continuation of 1901903002 under a new owner (alessandroa -> mcnee). CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/6e1abbfb2450eedddb1ab128be1b31cc93104e41 Cr-Commit-Position: refs/heads/master@{#430973}

Patch Set 1 #

Total comments: 71

Patch Set 2 : Fix presubmit errors, code clean up, and refactor. #

Total comments: 24

Patch Set 3 : Code review changes. #

Total comments: 21

Patch Set 4 : More code review changes. #

Total comments: 12

Patch Set 5 : Clarify names and behaviours. #

Patch Set 6 : Use our own touch gesture detection. #

Total comments: 32

Patch Set 7 : Code review changes and GestureDetector tests. #

Total comments: 22

Patch Set 8 : JS code review changes. #

Total comments: 4

Patch Set 9 : Small changes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+782 lines, -13 lines) Patch
M chrome/browser/pdf/pdf_extension_test.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/resources/component_extension_resources.grd View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A chrome/browser/resources/pdf/gesture_detector.js View 1 2 3 4 5 6 1 chunk +160 lines, -0 lines 0 comments Download
M chrome/browser/resources/pdf/index.html View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/resources/pdf/pdf.js View 1 2 3 4 5 6 7 8 3 chunks +61 lines, -1 line 0 comments Download
M chrome/browser/resources/pdf/viewport.js View 1 2 3 4 5 6 7 8 6 chunks +192 lines, -0 lines 0 comments Download
A chrome/test/data/pdf/gesture_detector_test.js View 1 2 3 4 5 6 7 1 chunk +192 lines, -0 lines 0 comments Download
M pdf/out_of_process_instance.h View 1 2 3 4 5 6 1 chunk +22 lines, -2 lines 0 comments Download
M pdf/out_of_process_instance.cc View 1 2 3 4 5 6 4 chunks +90 lines, -2 lines 0 comments Download
M pdf/paint_manager.h View 1 2 3 4 3 chunks +16 lines, -0 lines 0 comments Download
M pdf/paint_manager.cc View 1 2 3 4 5 chunks +43 lines, -8 lines 0 comments Download

Messages

Total messages: 67 (27 generated)
Kevin McNee - google account
Hello. I'm taking ownership of this issue. This is a continuation of https://codereview.chromium.org/1901903002/ . The ...
4 years, 2 months ago (2016-10-06 18:31:17 UTC) #4
Kevin McNee - google account
Here are the unresolved comments from the previous code review along with some of my ...
4 years, 2 months ago (2016-10-06 21:53:18 UTC) #5
bokan
On 2016/10/06 18:31:17, Kevin McNee wrote: > Hello. I'm taking ownership of this issue. Awesome! ...
4 years, 2 months ago (2016-10-06 21:56:16 UTC) #6
wjmaclean
Thanks for getting this underway again, and for porting over 'state' from the previous review ...
4 years, 2 months ago (2016-10-07 12:30:21 UTC) #7
Kevin McNee - google account
A few more js code quality comments and a question for bokan@ about requestAnimationFrame at ...
4 years, 2 months ago (2016-10-07 19:08:50 UTC) #8
bokan
https://codereview.chromium.org/2400743002/diff/1/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/2400743002/diff/1/chrome/browser/resources/pdf/pdf.js#newcode227 chrome/browser/resources/pdf/pdf.js:227: window.requestAnimationFrame(function() { On 2016/10/07 19:08:49, Kevin McNee wrote: > ...
4 years, 2 months ago (2016-10-07 19:16:03 UTC) #9
Kevin McNee - google account
https://codereview.chromium.org/2400743002/diff/1/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/2400743002/diff/1/chrome/browser/resources/pdf/pdf.js#newcode227 chrome/browser/resources/pdf/pdf.js:227: window.requestAnimationFrame(function() { On 2016/10/07 19:16:03, bokan wrote: > On ...
4 years, 2 months ago (2016-10-07 19:38:11 UTC) #10
Kevin McNee - google account
https://codereview.chromium.org/2400743002/diff/1/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/2400743002/diff/1/chrome/browser/resources/pdf/pdf.js#newcode227 chrome/browser/resources/pdf/pdf.js:227: window.requestAnimationFrame(function() { On 2016/10/07 19:38:11, Kevin McNee wrote: > ...
4 years, 2 months ago (2016-10-13 18:04:02 UTC) #11
Kevin McNee - google account
https://codereview.chromium.org/2400743002/diff/1/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/2400743002/diff/1/chrome/browser/resources/pdf/pdf.js#newcode215 chrome/browser/resources/pdf/pdf.js:215: if(!this.didPinch_) { On 2016/10/06 21:53:17, Kevin McNee wrote: > ...
4 years, 2 months ago (2016-10-13 18:19:25 UTC) #12
bokan
Sorry, I'm a little busy at the moment but I'll take a look at it ...
4 years, 2 months ago (2016-10-14 18:01:46 UTC) #14
bokan
This is looking good, mostly just nits and comment clarifications, though I'll want to play ...
4 years, 2 months ago (2016-10-17 22:20:16 UTC) #15
Kevin McNee - google account
bokan: I found the issue causing the delay for the reraster. It was a problem ...
4 years, 1 month ago (2016-10-24 15:57:55 UTC) #16
Kevin McNee - google account
https://codereview.chromium.org/2400743002/diff/20001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/2400743002/diff/20001/chrome/browser/resources/pdf/pdf.js#newcode197 chrome/browser/resources/pdf/pdf.js:197: // We must preventDefault if there is a two ...
4 years, 1 month ago (2016-10-24 21:11:48 UTC) #17
bokan
Thanks, code lgtm. Could you give me a demo sometime to see how this feels? ...
4 years, 1 month ago (2016-10-26 16:30:41 UTC) #18
Kevin McNee - google account
avi@chromium.org: Please review changes in ui/ thestig@chromium.org: Please review pdf related changes jochen@chromium.org: Please review ...
4 years, 1 month ago (2016-10-27 14:48:07 UTC) #20
Avi (use Gerrit)
https://codereview.chromium.org/2400743002/diff/40001/ui/webui/resources/webui_resources.grd File ui/webui/resources/webui_resources.grd (right): https://codereview.chromium.org/2400743002/diff/40001/ui/webui/resources/webui_resources.grd#newcode19 ui/webui/resources/webui_resources.grd:19: <include name="IDR_WEBUI_HAMMER_JS" file="js/hammer.js" flattenhtml="true" type="BINDATA" /> Is there some ...
4 years, 1 month ago (2016-10-27 14:55:26 UTC) #21
Kevin McNee - google account
https://codereview.chromium.org/2400743002/diff/40001/third_party/hammer/OWNERS File third_party/hammer/OWNERS (right): https://codereview.chromium.org/2400743002/diff/40001/third_party/hammer/OWNERS#newcode3 third_party/hammer/OWNERS:3: mcnee@google.com On 2016/10/26 16:30:41, bokan wrote: > Do you ...
4 years, 1 month ago (2016-10-27 16:00:35 UTC) #22
Lei Zhang
On 2016/10/27 14:48:07, Kevin McNee wrote: > mailto:jochen@chromium.org: Please review changes in third_party/ Adding third ...
4 years, 1 month ago (2016-10-27 16:35:50 UTC) #23
Lei Zhang
Raymes can probably do a better review of the JS code. https://codereview.chromium.org/2400743002/diff/40001/pdf/out_of_process_instance.cc File pdf/out_of_process_instance.cc (right): ...
4 years, 1 month ago (2016-10-27 16:56:36 UTC) #25
Kevin McNee - google account
So after discussing with wjmaclean@, we're thinking it would be better to just implement the ...
4 years, 1 month ago (2016-10-27 21:40:31 UTC) #26
Lei Zhang
https://codereview.chromium.org/2400743002/diff/60001/pdf/out_of_process_instance.cc File pdf/out_of_process_instance.cc (right): https://codereview.chromium.org/2400743002/diff/60001/pdf/out_of_process_instance.cc#newcode422 pdf/out_of_process_instance.cc:422: old_zoom_ = zoom; From just reading the header, I ...
4 years, 1 month ago (2016-10-27 23:04:33 UTC) #27
Kevin McNee - google account
https://codereview.chromium.org/2400743002/diff/60001/pdf/out_of_process_instance.cc File pdf/out_of_process_instance.cc (right): https://codereview.chromium.org/2400743002/diff/60001/pdf/out_of_process_instance.cc#newcode422 pdf/out_of_process_instance.cc:422: old_zoom_ = zoom; On 2016/10/27 23:04:33, Lei Zhang wrote: ...
4 years, 1 month ago (2016-10-28 19:19:38 UTC) #28
raymes
I'm a bit busy with other things to review new PDF features (which I'm not ...
4 years, 1 month ago (2016-10-31 00:00:45 UTC) #30
jochen (gone - plz use gerrit)
please follow the process outlined here: https://www.chromium.org/developers/adding-3rd-party-libraries#TOC-Get-a-Review to add a new third_party library
4 years, 1 month ago (2016-10-31 10:39:52 UTC) #31
Kevin McNee - google account
As discussed, we're now using our own gesture detection rather than bringing in a third ...
4 years, 1 month ago (2016-10-31 22:10:56 UTC) #33
Lei Zhang
On 2016/10/31 00:00:45, raymes wrote: > I'm a bit busy with other things to review ...
4 years, 1 month ago (2016-10-31 22:19:21 UTC) #35
Lei Zhang
lgtm on the C++ side https://codereview.chromium.org/2400743002/diff/90001/pdf/out_of_process_instance.cc File pdf/out_of_process_instance.cc (right): https://codereview.chromium.org/2400743002/diff/90001/pdf/out_of_process_instance.cc#newcode285 pdf/out_of_process_instance.cc:285: last_current_scroll_(0, 0), Not needed. ...
4 years, 1 month ago (2016-10-31 22:49:04 UTC) #38
dpapad
https://codereview.chromium.org/2400743002/diff/90001/chrome/browser/resources/pdf/gesture_detector.js File chrome/browser/resources/pdf/gesture_detector.js (right): https://codereview.chromium.org/2400743002/diff/90001/chrome/browser/resources/pdf/gesture_detector.js#newcode40 chrome/browser/resources/pdf/gesture_detector.js:40: if (this.listeners_[type]) { Since you are already using ES6 ...
4 years, 1 month ago (2016-10-31 23:02:23 UTC) #39
raymes
https://codereview.chromium.org/2400743002/diff/90001/chrome/browser/resources/pdf/viewport.js File chrome/browser/resources/pdf/viewport.js (right): https://codereview.chromium.org/2400743002/diff/90001/chrome/browser/resources/pdf/viewport.js#newcode353 chrome/browser/resources/pdf/viewport.js:353: * @return {Object} the content coordinates On 2016/10/31 23:02:23, ...
4 years, 1 month ago (2016-10-31 23:53:52 UTC) #40
jochen (gone - plz use gerrit)
since there are no more third_party changes, I assume I'm no longer needed
4 years, 1 month ago (2016-11-02 10:55:06 UTC) #44
Kevin McNee - google account
On 2016/11/02 10:55:06, jochen wrote: > since there are no more third_party changes, I assume ...
4 years, 1 month ago (2016-11-03 20:36:41 UTC) #45
Kevin McNee - google account
In addition to addressing the code review comments, I've gone ahead and added some basic ...
4 years, 1 month ago (2016-11-07 23:08:28 UTC) #46
Avi (use Gerrit)
Wandering off then...
4 years, 1 month ago (2016-11-08 16:27:58 UTC) #52
dpapad
https://codereview.chromium.org/2400743002/diff/110001/chrome/browser/resources/pdf/viewport.js File chrome/browser/resources/pdf/viewport.js (right): https://codereview.chromium.org/2400743002/diff/110001/chrome/browser/resources/pdf/viewport.js#newcode75 chrome/browser/resources/pdf/viewport.js:75: PINCH_NONE: 0, Nit: You can probably drop PINCH_ prefix ...
4 years, 1 month ago (2016-11-08 18:32:36 UTC) #53
Kevin McNee - google account
https://codereview.chromium.org/2400743002/diff/110001/chrome/browser/resources/pdf/viewport.js File chrome/browser/resources/pdf/viewport.js (right): https://codereview.chromium.org/2400743002/diff/110001/chrome/browser/resources/pdf/viewport.js#newcode75 chrome/browser/resources/pdf/viewport.js:75: PINCH_NONE: 0, On 2016/11/08 18:32:34, dpapad wrote: > Nit: ...
4 years, 1 month ago (2016-11-08 23:08:21 UTC) #54
dpapad
JS LGTM https://codereview.chromium.org/2400743002/diff/130001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/2400743002/diff/130001/chrome/browser/resources/pdf/pdf.js#newcode694 chrome/browser/resources/pdf/pdf.js:694: var pinchVector = this.viewport_.pinchPanVector; Nit: var pinchVector ...
4 years, 1 month ago (2016-11-09 01:12:27 UTC) #55
Kevin McNee - google account
https://codereview.chromium.org/2400743002/diff/130001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/2400743002/diff/130001/chrome/browser/resources/pdf/pdf.js#newcode694 chrome/browser/resources/pdf/pdf.js:694: var pinchVector = this.viewport_.pinchPanVector; On 2016/11/09 01:12:26, dpapad wrote: ...
4 years, 1 month ago (2016-11-09 16:36:09 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2400743002/150001
4 years, 1 month ago (2016-11-09 18:00:41 UTC) #63
commit-bot: I haz the power
Committed patchset #9 (id:150001)
4 years, 1 month ago (2016-11-09 18:05:59 UTC) #65
commit-bot: I haz the power
4 years, 1 month ago (2016-11-09 18:18:22 UTC) #67
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/6e1abbfb2450eedddb1ab128be1b31cc93104e41
Cr-Commit-Position: refs/heads/master@{#430973}

Powered by Google App Engine
This is Rietveld 408576698