return;
bool b;
- std::vector<base::FilePath> list;
if (web_preferences_.Get("javascript", &b))
prefs->javascript_enabled = b;
if (web_preferences_.Get("images", &b))
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() {
WebContentsPreferences::~WebContentsPreferences() {
}
+// static
+WebContentsPreferences* WebContentsPreferences::From(
+ content::WebContents* web_contents) {
+ return static_cast<WebContentsPreferences*>(
+ web_contents->GetUserData(kWebPreferencesKey));
+}
+
} // namespace atom
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;