From: Cheng Zhao Date: Fri, 4 Sep 2015 16:52:29 +0000 (+0900) Subject: NPAPI has been removed, remove related option X-Git-Tag: v0.32.0~10^2~15 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=96771c7098fa66a29fd5422158d900883c7803f3;p=electron.git NPAPI has been removed, remove related option --- diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index 96085846..b0b99081 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -424,7 +424,6 @@ void NativeWindow::OverrideWebkitPrefs(content::WebPreferences* prefs) { return; bool b; - std::vector list; if (web_preferences_.Get("javascript", &b)) prefs->javascript_enabled = b; if (web_preferences_.Get("images", &b)) @@ -446,14 +445,6 @@ void NativeWindow::OverrideWebkitPrefs(content::WebPreferences* prefs) { prefs->allow_displaying_insecure_content = b; if (web_preferences_.Get("allow-running-insecure-content", &b)) prefs->allow_running_insecure_content = b; - if (web_preferences_.Get("extra-plugin-dirs", &list)) { - if (content::PluginService::GetInstance()->NPAPIPluginsSupported()) { - for (size_t i = 0; i < list.size(); ++i) - content::PluginService::GetInstance()->AddExtraPluginDir(list[i]); - } else { - LOG(WARNING) << "NPAPI plugins not supported on this platform"; - } - } } void NativeWindow::NotifyWindowClosed() { diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 8b956c1b..fbd2c766 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -22,4 +22,11 @@ WebContentsPreferences::WebContentsPreferences( WebContentsPreferences::~WebContentsPreferences() { } +// static +WebContentsPreferences* WebContentsPreferences::From( + content::WebContents* web_contents) { + return static_cast( + web_contents->GetUserData(kWebPreferencesKey)); +} + } // namespace atom diff --git a/atom/browser/web_contents_preferences.h b/atom/browser/web_contents_preferences.h index bbbc4cf5..c4c50dc0 100644 --- a/atom/browser/web_contents_preferences.h +++ b/atom/browser/web_contents_preferences.h @@ -10,9 +10,13 @@ namespace atom { +// Stores and applies the preferences of WebContents. class WebContentsPreferences : public content::WebContentsUserData { public: + // Get the preferences of |web_contents|. + static WebContentsPreferences* From(content::WebContents* web_contents); + WebContentsPreferences(content::WebContents* web_contents, base::DictionaryValue&& web_preferences); ~WebContentsPreferences() override;