mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix crashes when loading Flash plugins with extensions disabled (issue #2359)
This commit is contained in:
@ -680,11 +680,17 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
|
|||||||
// Propagate the following switches to the renderer command line (along with
|
// Propagate the following switches to the renderer command line (along with
|
||||||
// any associated values) if present in the browser command line.
|
// any associated values) if present in the browser command line.
|
||||||
static const char* const kSwitchNames[] = {
|
static const char* const kSwitchNames[] = {
|
||||||
switches::kDisableExtensions, switches::kDisablePdfExtension,
|
switches::kDisableExtensions,
|
||||||
switches::kDisableScrollBounce, switches::kDisableSpellChecking,
|
switches::kDisablePdfExtension,
|
||||||
switches::kEnableSpeechInput, switches::kEnableSystemFlash,
|
switches::kDisablePlugins,
|
||||||
switches::kPpapiFlashArgs, switches::kPpapiFlashPath,
|
switches::kDisableScrollBounce,
|
||||||
switches::kPpapiFlashVersion, switches::kUncaughtExceptionStackSize,
|
switches::kDisableSpellChecking,
|
||||||
|
switches::kEnableSpeechInput,
|
||||||
|
switches::kEnableSystemFlash,
|
||||||
|
switches::kPpapiFlashArgs,
|
||||||
|
switches::kPpapiFlashPath,
|
||||||
|
switches::kPpapiFlashVersion,
|
||||||
|
switches::kUncaughtExceptionStackSize,
|
||||||
};
|
};
|
||||||
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
|
||||||
arraysize(kSwitchNames));
|
arraysize(kSwitchNames));
|
||||||
|
@ -288,6 +288,8 @@ void SetCommandLinePrefDefaults(CommandLinePrefStore* prefs) {
|
|||||||
SetBool(prefs, prefs::kWebKitLoadsImagesAutomatically, false);
|
SetBool(prefs, prefs::kWebKitLoadsImagesAutomatically, false);
|
||||||
if (command_line->HasSwitch(switches::kDisableTabToLinks))
|
if (command_line->HasSwitch(switches::kDisableTabToLinks))
|
||||||
SetBool(prefs, prefs::kWebkitTabsToLinks, false);
|
SetBool(prefs, prefs::kWebkitTabsToLinks, false);
|
||||||
|
if (command_line->HasSwitch(switches::kDisablePlugins))
|
||||||
|
SetBool(prefs, prefs::kWebKitPluginsEnabled, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||||
|
@ -57,6 +57,9 @@ const char kDisableTextAreaResize[] = "disable-text-area-resize";
|
|||||||
// Disable using the tab key to advance focus to links.
|
// Disable using the tab key to advance focus to links.
|
||||||
const char kDisableTabToLinks[] = "disable-tab-to-links";
|
const char kDisableTabToLinks[] = "disable-tab-to-links";
|
||||||
|
|
||||||
|
// Disable plugins.
|
||||||
|
const char kDisablePlugins[] = "disable-plugins";
|
||||||
|
|
||||||
// Persist session cookies.
|
// Persist session cookies.
|
||||||
const char kPersistSessionCookies[] = "persist-session-cookies";
|
const char kPersistSessionCookies[] = "persist-session-cookies";
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ extern const char kDisableImageLoading[];
|
|||||||
extern const char kImageShrinkStandaloneToFit[];
|
extern const char kImageShrinkStandaloneToFit[];
|
||||||
extern const char kDisableTextAreaResize[];
|
extern const char kDisableTextAreaResize[];
|
||||||
extern const char kDisableTabToLinks[];
|
extern const char kDisableTabToLinks[];
|
||||||
|
extern const char kDisablePlugins[];
|
||||||
extern const char kPersistSessionCookies[];
|
extern const char kPersistSessionCookies[];
|
||||||
extern const char kPersistUserPreferences[];
|
extern const char kPersistUserPreferences[];
|
||||||
extern const char kEnableMediaStream[];
|
extern const char kEnableMediaStream[];
|
||||||
|
@ -717,7 +717,8 @@ void CefMainDelegate::InitializeResourceBundle() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extensions::ExtensionsEnabled()) {
|
if (extensions::ExtensionsEnabled() ||
|
||||||
|
!command_line->HasSwitch(switches::kDisablePlugins)) {
|
||||||
if (base::PathExists(cef_extensions_pak_file)) {
|
if (base::PathExists(cef_extensions_pak_file)) {
|
||||||
resource_bundle.AddDataPackFromPath(cef_extensions_pak_file,
|
resource_bundle.AddDataPackFromPath(cef_extensions_pak_file,
|
||||||
ui::SCALE_FACTOR_NONE);
|
ui::SCALE_FACTOR_NONE);
|
||||||
|
@ -187,3 +187,21 @@ index 5dc888bfb2df..297737be682e 100644
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case chrome::mojom::PluginStatus::kComponentUpdateRequired: {
|
case chrome::mojom::PluginStatus::kComponentUpdateRequired: {
|
||||||
|
diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc
|
||||||
|
index 7a814bb072dc..79c7d65118cb 100644
|
||||||
|
--- chrome/renderer/plugins/chrome_plugin_placeholder.cc
|
||||||
|
+++ chrome/renderer/plugins/chrome_plugin_placeholder.cc
|
||||||
|
@@ -349,8 +349,11 @@ void ChromePluginPlaceholder::OnBlockedContent(
|
||||||
|
|
||||||
|
if (status ==
|
||||||
|
content::RenderFrame::PeripheralContentStatus::CONTENT_STATUS_TINY) {
|
||||||
|
- ContentSettingsObserver::Get(render_frame())
|
||||||
|
- ->DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, title_);
|
||||||
|
+ ContentSettingsObserver* observer =
|
||||||
|
+ ContentSettingsObserver::Get(render_frame());
|
||||||
|
+ if (observer) {
|
||||||
|
+ observer->DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, title_);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string message = base::StringPrintf(
|
||||||
|
Reference in New Issue
Block a user