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

Unified Diff: chrome/browser/extensions/component_loader.cc

Issue 96233002: Add a PDF component extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/component_extension_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/component_loader.cc
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index 4d065c3104e4b9b40a2724b7647ff2b034ba61a8..f56a791d341bbf617271df0b609d3d2e734f5ea5 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -23,6 +23,7 @@
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/plugin_service.h"
#include "extensions/common/extension.h"
#include "extensions/common/id_util.h"
#include "extensions/common/manifest_constants.h"
@@ -560,6 +561,17 @@ void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages(
AddNetworkSpeechSynthesisExtension();
#endif
#endif // defined(GOOGLE_CHROME_BUILD)
+
+#if defined(ENABLE_PLUGINS)
+ base::FilePath pdf_path;
+ content::PluginService* plugin_service =
+ content::PluginService::GetInstance();
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kOutOfProcessPdf) &&
+ PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_path) &&
+ plugin_service->GetRegisteredPpapiPluginInfo(pdf_path)) {
+ Add(IDR_PDF_MANIFEST, base::FilePath(FILE_PATH_LITERAL("pdf")));
+ }
+#endif
}
void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) {
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/component_extension_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698