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

Issue 1350073002: PDFs viewed inside a <webview> should navigate the same as PDFs in tabs. (Closed)

Created:
5 years, 3 months ago by wjmaclean
Modified:
5 years, 2 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, arv+watch_chromium.org, extensions-reviews_chromium.org, raymes
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PDFs viewed inside a <webview> should navigate the same as PDFs in tabs. This CL is (sort-of) a reland of (1) https://codereview.chromium.org/1234403005/ as well as a revert of (2) https://codereview.chromium.org/1275173004 CL (2) broke the CL (1), in that chrome.tabs.update will always update the active tab in the browser window. If a user left-clicks on a link in the PDF viewer, the expectation is that the PDF contents will be replaced by the contents at the link, but that cannot happen if the PDF is displayed in an app and chrome.tabs.update is used. Also, https://codereview.chromium.org/1275173004 suggests that the advantage of chrome.tabs.update is to navigate from one file:// url to another, but based on other discussions, https://code.google.com/p/chromium/issues/detail?id=528505 this may not be appropriate. Finally, CL (1) broke context-menu navigations for links within webviews, namely "open in new tab", "open in new window" and "open in incognito window". This CL restricts itself to CURRENT_TAB navigations in order to fix that. BUG=532621 Committed: https://crrev.com/cfe0de44de3d2916c2d7254027cb70e0c7c14e0d Cr-Commit-Position: refs/heads/master@{#351423}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use browserApi to determine when to use chrome.tabs.update(). #

Patch Set 3 : Pass tabId to Navigator() instead of browserApi_. #

Total comments: 1

Patch Set 4 : Bind tabId to current tab navigation callback. #

Patch Set 5 : Update test. #

Total comments: 2

Patch Set 6 : Fix binding. #

Total comments: 8

Patch Set 7 : Simplify argument binding. #

Total comments: 6

Patch Set 8 : Pass boolean instead of tabId. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -16 lines) Patch
M chrome/browser/apps/guest_view/web_view_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +21 lines, -0 lines 0 comments Download
M chrome/browser/resources/pdf/pdf.js View 1 2 3 4 5 6 7 2 chunks +9 lines, -5 lines 2 comments Download
M extensions/browser/guest_view/web_view/web_view_guest.cc View 1 chunk +14 lines, -11 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 64 (22 generated)
wjmaclean
Please take a look.
5 years, 3 months ago (2015-09-17 17:47:49 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350073002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350073002/1
5 years, 3 months ago (2015-09-17 17:48:26 UTC) #4
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-17 18:42:53 UTC) #6
Lei Zhang
This CL would cause https://crbug.com/517780 to reopen. If we have file:///tmp/foo.html, and it has a ...
5 years, 3 months ago (2015-09-17 22:54:00 UTC) #7
Sam McNally
https://codereview.chromium.org/1350073002/diff/1/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (left): https://codereview.chromium.org/1350073002/diff/1/chrome/browser/resources/pdf/pdf.js#oldcode49 chrome/browser/resources/pdf/pdf.js:49: if (chrome.tabs) Could we change this to if (chrome.tabs ...
5 years, 3 months ago (2015-09-18 01:03:47 UTC) #9
wjmaclean
https://codereview.chromium.org/1350073002/diff/1/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (left): https://codereview.chromium.org/1350073002/diff/1/chrome/browser/resources/pdf/pdf.js#oldcode49 chrome/browser/resources/pdf/pdf.js:49: if (chrome.tabs) On 2015/09/18 01:03:47, Sam McNally wrote: > ...
5 years, 3 months ago (2015-09-18 16:20:45 UTC) #11
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350073002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350073002/20001
5 years, 3 months ago (2015-09-18 16:21:18 UTC) #12
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/105097)
5 years, 3 months ago (2015-09-18 17:08:56 UTC) #14
Lei Zhang
Patch set 2 has broken tests, BTW.
5 years, 3 months ago (2015-09-19 01:05:51 UTC) #15
wjmaclean
On 2015/09/19 01:05:51, Lei Zhang wrote: > Patch set 2 has broken tests, BTW. Yes, ...
5 years, 3 months ago (2015-09-21 14:02:13 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350073002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350073002/40001
5 years, 3 months ago (2015-09-22 19:20:03 UTC) #18
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-22 21:06:26 UTC) #20
wjmaclean
thestig@ & sammc@ ... is this ok now?
5 years, 3 months ago (2015-09-23 13:35:02 UTC) #21
raymes
https://codereview.chromium.org/1350073002/diff/40001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/40001/chrome/browser/resources/pdf/pdf.js#newcode257 chrome/browser/resources/pdf/pdf.js:257: onNavigateInCurrentTab, onNavigateInNewTab); can we bind the tabId to onNavigateInCurrentTab ...
5 years, 3 months ago (2015-09-24 00:09:42 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350073002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350073002/60001
5 years, 3 months ago (2015-09-24 21:51:33 UTC) #25
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/107608) linux_chromium_rel_ng on ...
5 years, 3 months ago (2015-09-24 22:34:58 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350073002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350073002/80001
5 years, 2 months ago (2015-09-25 12:52:03 UTC) #29
wjmaclean
raymes@ - is this ok? There is some urgency to try and get this in ...
5 years, 2 months ago (2015-09-25 12:52:26 UTC) #30
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-09-25 13:56:24 UTC) #32
Lei Zhang
https://codereview.chromium.org/1350073002/diff/80001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/80001/chrome/browser/resources/pdf/pdf.js#newcode63 chrome/browser/resources/pdf/pdf.js:63: if (chrome.tabs) Do we need to add a tabId ...
5 years, 2 months ago (2015-09-25 19:01:43 UTC) #33
wjmaclean
https://codereview.chromium.org/1350073002/diff/80001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/80001/chrome/browser/resources/pdf/pdf.js#newcode63 chrome/browser/resources/pdf/pdf.js:63: if (chrome.tabs) On 2015/09/25 19:01:43, Lei Zhang wrote: > ...
5 years, 2 months ago (2015-09-25 19:04:12 UTC) #34
Lei Zhang
The https://crbug.com/514387 test case is still broken with this CL. In the JS code, |tabId| ...
5 years, 2 months ago (2015-09-25 19:14:23 UTC) #35
wjmaclean
My bad, apparently I misunderstood how to bind properly in JS (I'm really not a ...
5 years, 2 months ago (2015-09-25 19:59:17 UTC) #37
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350073002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350073002/100001
5 years, 2 months ago (2015-09-25 19:59:43 UTC) #38
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-09-25 20:52:32 UTC) #40
Dan Beam
https://codereview.chromium.org/1350073002/diff/100001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/100001/chrome/browser/resources/pdf/pdf.js#newcode44 chrome/browser/resources/pdf/pdf.js:44: * @param {int} tabId The id of the current ...
5 years, 2 months ago (2015-09-25 20:57:32 UTC) #42
raymes
https://codereview.chromium.org/1350073002/diff/100001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/100001/chrome/browser/resources/pdf/pdf.js#newcode261 chrome/browser/resources/pdf/pdf.js:261: onNavigateBoundToCurrentTab, I think you should be able to delete ...
5 years, 2 months ago (2015-09-27 23:02:02 UTC) #43
wjmaclean
https://codereview.chromium.org/1350073002/diff/100001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/100001/chrome/browser/resources/pdf/pdf.js#newcode44 chrome/browser/resources/pdf/pdf.js:44: * @param {int} tabId The id of the current ...
5 years, 2 months ago (2015-09-28 13:29:35 UTC) #45
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350073002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350073002/120001
5 years, 2 months ago (2015-09-28 13:29:41 UTC) #46
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-09-28 14:30:30 UTC) #48
Dan Beam
https://codereview.chromium.org/1350073002/diff/120001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/120001/chrome/browser/resources/pdf/pdf.js#newcode50 chrome/browser/resources/pdf/pdf.js:50: if (chrome.tabs && tabId != -1) are you using ...
5 years, 2 months ago (2015-09-28 15:59:12 UTC) #49
wjmaclean
https://codereview.chromium.org/1350073002/diff/120001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/120001/chrome/browser/resources/pdf/pdf.js#newcode50 chrome/browser/resources/pdf/pdf.js:50: if (chrome.tabs && tabId != -1) On 2015/09/28 15:59:11, ...
5 years, 2 months ago (2015-09-28 16:10:09 UTC) #50
raymes
chrome/browser/resources/pdf/pdf.js lgtm https://codereview.chromium.org/1350073002/diff/120001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/120001/chrome/browser/resources/pdf/pdf.js#newcode50 chrome/browser/resources/pdf/pdf.js:50: if (chrome.tabs && tabId != -1) I ...
5 years, 2 months ago (2015-09-29 01:46:27 UTC) #51
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350073002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350073002/140001
5 years, 2 months ago (2015-09-29 13:34:15 UTC) #53
wjmaclean
dbeam@ - does this look ok to you?
5 years, 2 months ago (2015-09-29 13:43:21 UTC) #54
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-09-29 14:22:09 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1350073002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1350073002/140001
5 years, 2 months ago (2015-09-29 22:28:06 UTC) #59
Dan Beam
this is more readable, IMO https://codereview.chromium.org/1350073002/diff/140001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/140001/chrome/browser/resources/pdf/pdf.js#newcode265 chrome/browser/resources/pdf/pdf.js:265: isInTab), function() { onNavigateInCurrentTab(isInTab); ...
5 years, 2 months ago (2015-09-29 22:38:26 UTC) #60
Dan Beam
https://codereview.chromium.org/1350073002/diff/140001/chrome/browser/resources/pdf/pdf.js File chrome/browser/resources/pdf/pdf.js (right): https://codereview.chromium.org/1350073002/diff/140001/chrome/browser/resources/pdf/pdf.js#newcode265 chrome/browser/resources/pdf/pdf.js:265: isInTab), On 2015/09/29 22:38:26, Dan Beam wrote: > function() ...
5 years, 2 months ago (2015-09-29 22:38:59 UTC) #61
Dan Beam
otherwise lgtm
5 years, 2 months ago (2015-09-29 22:39:12 UTC) #62
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 2 months ago (2015-09-29 22:44:25 UTC) #63
commit-bot: I haz the power
5 years, 2 months ago (2015-09-29 22:45:48 UTC) #64
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/cfe0de44de3d2916c2d7254027cb70e0c7c14e0d
Cr-Commit-Position: refs/heads/master@{#351423}

Powered by Google App Engine
This is Rietveld 408576698