]> khamidou — GitHub mirrors - electron.git/commitdiff
NPAPI has been removed, remove related option
authorCheng Zhao <zcbenz@gmail.com>
Fri, 4 Sep 2015 16:52:29 +0000 (01:52 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 6 Sep 2015 02:53:03 +0000 (10:53 +0800)
atom/browser/native_window.cc
atom/browser/web_contents_preferences.cc
atom/browser/web_contents_preferences.h

index 96085846bca8b08f09906eb65bc9d33cf78b85cc..b0b99081e3c1c7257b15a855d30e3120792edc51 100644 (file)
@@ -424,7 +424,6 @@ void NativeWindow::OverrideWebkitPrefs(content::WebPreferences* prefs) {
     return;
 
   bool b;
-  std::vector<base::FilePath> 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() {
index 8b956c1b41ac8dc3e1516ed425f6c55734af4456..fbd2c7661a74e9122bcc68eec97b4df0718111fe 100644 (file)
@@ -22,4 +22,11 @@ WebContentsPreferences::WebContentsPreferences(
 WebContentsPreferences::~WebContentsPreferences() {
 }
 
+// static
+WebContentsPreferences* WebContentsPreferences::From(
+    content::WebContents* web_contents) {
+  return static_cast<WebContentsPreferences*>(
+      web_contents->GetUserData(kWebPreferencesKey));
+}
+
 }  // namespace atom
index bbbc4cf5e2e6600b5e66efe7bd327c8d448fe8b3..c4c50dc070723c7aad735e1e05cbb5914c8f3aa1 100644 (file)
 
 namespace atom {
 
+// Stores and applies the preferences of WebContents.
 class WebContentsPreferences
     : public content::WebContentsUserData<WebContentsPreferences> {
  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;