Improve #1317
authorCheng Zhao <zcbenz@gmail.com>
Fri, 27 Mar 2015 08:29:14 +0000 (16:29 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 27 Mar 2015 08:29:14 +0000 (16:29 +0800)
atom/browser/native_window.cc

index d1bf51d..7d54af0 100644 (file)
@@ -459,14 +459,13 @@ void NativeWindow::OverrideWebkitPrefs(const GURL& url,
     prefs->experimental_webgl_enabled = b;
   if (web_preferences_.Get("webaudio", &b))
     prefs->webaudio_enabled = b;
-
-  auto isSupported = content::PluginService::GetInstance()
-                                  ->NPAPIPluginsSupported();
-  if (web_preferences_.Get("extra-plugin-dirs", &list) && isSupported) {
-    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";
+  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";
+    }
   }
 }