From b89329b0face9fdc70bcc3e5e312eab2596ef0eb Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 24 Aug 2016 16:25:11 +0300 Subject: [PATCH] Use the same PDF plugin name as official Chrome --- libcef/browser/extensions/pdf_extension_util.cc | 5 ++++- tests/unittests/plugin_unittest.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libcef/browser/extensions/pdf_extension_util.cc b/libcef/browser/extensions/pdf_extension_util.cc index 1faa4da00..158f4e19d 100644 --- a/libcef/browser/extensions/pdf_extension_util.cc +++ b/libcef/browser/extensions/pdf_extension_util.cc @@ -26,7 +26,10 @@ const char kPdfResourceIdentifier[] = "google-chrome-pdf"; const char kPdfResourceIdentifier[] = "chromium-pdf"; #endif -const char kPdfPluginName[] = "Chromium PDF Viewer"; +// Match the GOOGLE_CHROME_BUILD value from ChromeContentClient::kPDFPluginName +// to avoid breaking Websites that specifically look for this string in the +// plugin list. +const char kPdfPluginName[] = "Chrome PDF Viewer"; std::string GetManifest() { std::string manifest_contents = diff --git a/tests/unittests/plugin_unittest.cc b/tests/unittests/plugin_unittest.cc index e7774fba3..4f345abaf 100644 --- a/tests/unittests/plugin_unittest.cc +++ b/tests/unittests/plugin_unittest.cc @@ -233,7 +233,7 @@ class PluginTestHandler : public RoutingTestHandler, void WaitForNavigatorPlugins(CefRefPtr frame) const { // Test if the `navigator.plugins` list includes the PDF extension. const std::string& code = - " if (navigator.plugins['Chromium PDF Viewer'].filename == " + " if (navigator.plugins['Chrome PDF Viewer'].filename == " " 'mhjfbmdgcfjbbpaeojofohoefgiehjai') {" " window.testQuery({request:'pdf_plugin_found'});" "} else {"