Make file tasks C++ control FilesApp PDF/SWF viewing actions
Viewing PDF files in a renderer (via chrome PDFium) is controlled by a system pref PluginsAlwaysOpenPdfExternally, which is read once-only at FileApp startup. Dynamic pref changes are ignored (see bug). Remove loadTimeData setters for PDF and SWF file viewing actions: file private_api_strings.cc ShouldBeOpenedWithPlugin calls begone, and same for the file_task.js loadTimeData code in FilesApp. Instead, call ShouldBeOpenedWithPlugin in file_tasks.cc. When the list of file tasks is requested by FilesApp, this new code enables/disables FilesApp PDF/SWF viewing actions ... dynamically based on prefs. Add an integration test: tests that QuickView does not show a PDF when the system PluginsAlwaysOpenPdfExternally pref is enabled. Test: browser_tests --gtest_filter="*QuickViewPdfPreviewsDisabled* Bug: 999103 Change-Id: I455fdbd794247a0a57105a2abd6ed929c752a8bd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808943 Commit-Queue: Noel Gordon <noel@chromium.org> Reviewed-by:Sam McNally <sammc@chromium.org> Cr-Commit-Position: refs/heads/master@{#697515}
Showing
Please register or sign in to comment