handle pdf type in ExternalNavigationDelegateImpl.
commitc95d6ff011264d5d6b6524d93adfdea178abf6a0
authorqinmin <qinmin@chromium.org>
Wed, 6 May 2015 20:10:03 +0000 (6 13:10 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 6 May 2015 20:10:34 +0000 (6 20:10 +0000)
treee17528779ec0509fbc0017a37e07b87e8adb4b16
parente51f994462c6b364a397dd77b7bdc7f55b8d8ad8
handle pdf type in ExternalNavigationDelegateImpl.

On android, not all the pdf link are handled by the DownloadManagerService.
If a pdf link triggers a new tab to be opened, that is handled by ExternalNavigationHandler.
The ExternalNavigationHandler should use the same logic in DownloadManagerService to open the link in PdfViewer.
This change :
1. modifies the StartActivity() and StartAcvitityIfNeeded() call to handle pdf.
Both functions will now modify the intent if it can be handled by the PdfViewer.
We need to modify both calls because one is used for incognito and the other is for non-incognito mode.
2. Move the logic of pdf handling from DownloadManagerService to ExternalNavigationDelegateImpl for code reuse purpose.

BUG=478304

Review URL: https://codereview.chromium.org/1125993002

Cr-Commit-Position: refs/heads/master@{#328593}
chrome/android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java
chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationDelegateImpl.java