Disable navigating on drag/drop (#12655)

* Disable navigating on drag/drop

* Add a WebPreferences option to re-enable navigate on drag/drop
This commit is contained in:
Jeremy Apthorp 2018-04-26 08:23:27 -07:00 committed by Charles Kerr
parent 4fcd178c36
commit 1a64b9f0c2
3 changed files with 5 additions and 0 deletions

View file

@ -211,6 +211,7 @@ void AtomBrowserClient::OverrideWebkitPrefs(content::RenderViewHost* host,
prefs->webgl1_enabled = true;
prefs->webgl2_enabled = true;
prefs->allow_running_insecure_content = false;
prefs->navigate_on_drag_drop = false;
// Custom preferences of guest page.
auto* web_contents = content::WebContents::FromRenderViewHost(host);

View file

@ -284,6 +284,8 @@ void WebContentsPreferences::OverrideWebkitPrefs(
}
if (dict_.GetBoolean("allowRunningInsecureContent", &b))
prefs->allow_running_insecure_content = b;
if (dict_.GetBoolean("navigateOnDragDrop", &b))
prefs->navigate_on_drag_drop = b;
const base::DictionaryValue* fonts = nullptr;
if (dict_.GetDictionary("defaultFontFamily", &fonts)) {
base::string16 font;