OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/plugin_service.h" | 7 #include "chrome/browser/plugin_service.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 resource_dispatcher_host_(NULL), | 104 resource_dispatcher_host_(NULL), |
105 ui_locale_(ASCIIToWide(g_browser_process->GetApplicationLocale())) { | 105 ui_locale_(ASCIIToWide(g_browser_process->GetApplicationLocale())) { |
106 // Have the NPAPI plugin list search for Chrome plugins as well. | 106 // Have the NPAPI plugin list search for Chrome plugins as well. |
107 ChromePluginLib::RegisterPluginsWithNPAPI(); | 107 ChromePluginLib::RegisterPluginsWithNPAPI(); |
108 // Load the one specified on the command line as well. | 108 // Load the one specified on the command line as well. |
109 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 109 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
110 FilePath path = command_line->GetSwitchValuePath(switches::kLoadPlugin); | 110 FilePath path = command_line->GetSwitchValuePath(switches::kLoadPlugin); |
111 if (!path.empty()) { | 111 if (!path.empty()) { |
112 NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); | 112 NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); |
113 } | 113 } |
| 114 |
| 115 FilePath pdf; |
| 116 if (command_line->HasSwitch(switches::kInternalPDF) && |
| 117 PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf)) { |
| 118 NPAPI::PluginList::Singleton()->AddExtraPluginPath(pdf); |
| 119 } |
| 120 |
114 #ifndef DISABLE_NACL | 121 #ifndef DISABLE_NACL |
115 if (command_line->HasSwitch(switches::kInternalNaCl)) | 122 if (command_line->HasSwitch(switches::kInternalNaCl)) |
116 RegisterInternalNaClPlugin(); | 123 RegisterInternalNaClPlugin(); |
117 #endif | 124 #endif |
118 | 125 |
119 chrome::RegisterInternalGPUPlugin(); | 126 chrome::RegisterInternalGPUPlugin(); |
120 | 127 |
121 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
122 hkcu_key_.Create( | 129 hkcu_key_.Create( |
123 HKEY_CURRENT_USER, kRegistryMozillaPlugins, KEY_NOTIFY); | 130 HKEY_CURRENT_USER, kRegistryMozillaPlugins, KEY_NOTIFY); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 PrivatePluginMap::iterator it = private_plugins_.find(plugin_path); | 354 PrivatePluginMap::iterator it = private_plugins_.find(plugin_path); |
348 if (it == private_plugins_.end()) | 355 if (it == private_plugins_.end()) |
349 return true; // This plugin is not private, so it's allowed everywhere. | 356 return true; // This plugin is not private, so it's allowed everywhere. |
350 | 357 |
351 // We do a dumb compare of scheme and host, rather than using the domain | 358 // We do a dumb compare of scheme and host, rather than using the domain |
352 // service, since we only care about this for extensions. | 359 // service, since we only care about this for extensions. |
353 const GURL& required_url = it->second; | 360 const GURL& required_url = it->second; |
354 return (url.scheme() == required_url.scheme() && | 361 return (url.scheme() == required_url.scheme() && |
355 url.host() == required_url.host()); | 362 url.host() == required_url.host()); |
356 } | 363 } |
OLD | NEW |