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

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

Issue 10827008: [Android] Implement WebSettings.{get|set}DomStorageEnabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Downstream comments addressed Created 8 years, 5 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
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentSettings.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_settings.cc
diff --git a/content/browser/android/content_settings.cc b/content/browser/android/content_settings.cc
index 4511c37e2507787c61ef2de459247c81f88a50f9..5effd5873d0759875c32af9ad26c8fe267e61872 100644
--- a/content/browser/android/content_settings.cc
+++ b/content/browser/android/content_settings.cc
@@ -68,6 +68,8 @@ struct ContentSettings::FieldIds {
GetFieldID(env, clazz, "mJavaScriptEnabled", "Z");
java_script_can_open_windows_automatically =
GetFieldID(env, clazz, "mJavaScriptCanOpenWindowsAutomatically", "Z");
+ dom_storage_enabled =
+ GetFieldID(env, clazz, "mDomStorageEnabled", "Z");
}
// Field ids
@@ -86,6 +88,7 @@ struct ContentSettings::FieldIds {
jfieldID load_images_automatically;
jfieldID java_script_enabled;
jfieldID java_script_can_open_windows_automatically;
+ jfieldID dom_storage_enabled;
};
ContentSettings::ContentSettings(JNIEnv* env,
@@ -192,6 +195,12 @@ void ContentSettings::SyncFromNativeImpl() {
Java_ContentSettings_setPluginsDisabled(env, obj, !prefs.plugins_enabled);
CheckException(env);
+
+ env->SetBooleanField(
+ obj,
+ field_ids_->dom_storage_enabled,
+ prefs.local_storage_enabled);
+ CheckException(env);
}
void ContentSettings::SyncToNativeImpl() {
@@ -268,6 +277,9 @@ void ContentSettings::SyncToNativeImpl() {
prefs.plugins_enabled = !Java_ContentSettings_getPluginsDisabled(env, obj);
+ prefs.local_storage_enabled = env->GetBooleanField(
+ obj, field_ids_->dom_storage_enabled);
+
render_view_host->UpdateWebkitPreferences(prefs);
}
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentSettings.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698