Move OverrideWebkitPrefs to WebContentsPreferences

This commit is contained in:
Cheng Zhao 2015-09-05 02:12:32 +09:00
parent 39975378bb
commit 880dce950d
5 changed files with 44 additions and 34 deletions

View file

@ -31,8 +31,6 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/renderer_preferences.h"
#include "content/public/common/web_preferences.h"
#include "ipc/ipc_message_macros.h"
#include "native_mate/dictionary.h"
#include "ui/gfx/codec/png_codec.h"
@ -382,34 +380,6 @@ void NativeWindow::AppendExtraCommandLineSwitches(
base::DoubleToString(zoom_factor_));
}
void NativeWindow::OverrideWebkitPrefs(content::WebPreferences* prefs) {
if (web_preferences_.IsEmpty())
return;
bool b;
if (web_preferences_.Get("javascript", &b))
prefs->javascript_enabled = b;
if (web_preferences_.Get("images", &b))
prefs->images_enabled = b;
if (web_preferences_.Get("java", &b))
prefs->java_enabled = b;
if (web_preferences_.Get("text-areas-are-resizable", &b))
prefs->text_areas_are_resizable = b;
if (web_preferences_.Get("webgl", &b))
prefs->experimental_webgl_enabled = b;
if (web_preferences_.Get("webaudio", &b))
prefs->webaudio_enabled = b;
if (web_preferences_.Get("web-security", &b)) {
prefs->web_security_enabled = b;
prefs->allow_displaying_insecure_content = !b;
prefs->allow_running_insecure_content = !b;
}
if (web_preferences_.Get("allow-displaying-insecure-content", &b))
prefs->allow_displaying_insecure_content = b;
if (web_preferences_.Get("allow-running-insecure-content", &b))
prefs->allow_running_insecure_content = b;
}
void NativeWindow::NotifyWindowClosed() {
if (is_closed_)
return;