Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: content/browser/android/content_settings.cc

Issue 10920033: Implement Android WebView BlockNetworkImages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add javadoc to new method in TestWebServer. Fix style nit again. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/android/content_settings.cc
diff --git a/content/browser/android/content_settings.cc b/content/browser/android/content_settings.cc
index a436c382388b63ba7871410b9612e004ad344efb..e8632d6089b25089b57f0eab7788f279009ccf5f 100644
--- a/content/browser/android/content_settings.cc
+++ b/content/browser/android/content_settings.cc
@@ -65,6 +65,8 @@ struct ContentSettings::FieldIds {
GetFieldID(env, clazz, "mDefaultFixedFontSize", "I");
load_images_automatically =
GetFieldID(env, clazz, "mLoadsImagesAutomatically", "Z");
+ images_enabled =
+ GetFieldID(env, clazz, "mImagesEnabled", "Z");
java_script_enabled =
GetFieldID(env, clazz, "mJavaScriptEnabled", "Z");
allow_universal_access_from_file_urls =
@@ -95,6 +97,7 @@ struct ContentSettings::FieldIds {
jfieldID default_font_size;
jfieldID default_fixed_font_size;
jfieldID load_images_automatically;
+ jfieldID images_enabled;
jfieldID java_script_enabled;
jfieldID allow_universal_access_from_file_urls;
jfieldID allow_file_access_from_file_urls;
@@ -197,6 +200,11 @@ void ContentSettings::SyncFromNativeImpl() {
CheckException(env);
env->SetBooleanField(
+ obj,
+ field_ids_->images_enabled, prefs.images_enabled);
+ CheckException(env);
+
+ env->SetBooleanField(
obj, field_ids_->java_script_enabled, prefs.javascript_enabled);
CheckException(env);
@@ -294,6 +302,9 @@ void ContentSettings::SyncToNativeImpl() {
prefs.loads_images_automatically =
env->GetBooleanField(obj, field_ids_->load_images_automatically);
+ prefs.images_enabled =
+ env->GetBooleanField(obj, field_ids_->images_enabled);
+
prefs.javascript_enabled =
env->GetBooleanField(obj, field_ids_->java_script_enabled);

Powered by Google App Engine
This is Rietveld 408576698