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

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

Issue 12217134: [Android WebView] Implement WebSettings.{get|set}LoadWithOverviewMode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comment for the message Created 7 years, 10 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 13c8ac876e69b4a36e2c95db8250a9422676e853..45a4223a2849dae87a700c6b0f5da81ec0ca9ab8 100644
--- a/content/browser/android/content_settings.cc
+++ b/content/browser/android/content_settings.cc
@@ -84,6 +84,8 @@ struct ContentSettings::FieldIds {
GetFieldID(env, clazz, "mDatabaseEnabled", "Z");
use_wide_viewport =
GetFieldID(env, clazz, "mUseWideViewport", "Z");
+ load_with_overview_mode =
+ GetFieldID(env, clazz, "mLoadWithOverviewMode", "Z");
}
// Field ids
@@ -110,6 +112,7 @@ struct ContentSettings::FieldIds {
jfieldID dom_storage_enabled;
jfieldID database_enabled;
jfieldID use_wide_viewport;
+ jfieldID load_with_overview_mode;
};
ContentSettings::ContentSettings(JNIEnv* env,
@@ -275,6 +278,12 @@ void ContentSettings::SyncFromNativeImpl() {
field_ids_->use_wide_viewport,
prefs.viewport_enabled);
CheckException(env);
+
+ env->SetBooleanField(
+ obj,
+ field_ids_->load_with_overview_mode,
+ prefs.initialize_at_minimum_page_scale);
+ CheckException(env);
}
void ContentSettings::SyncToNativeImpl() {
@@ -389,6 +398,9 @@ void ContentSettings::SyncToNativeImpl() {
prefs.viewport_enabled = env->GetBooleanField(
obj, field_ids_->use_wide_viewport);
+ prefs.initialize_at_minimum_page_scale = env->GetBooleanField(
+ obj, field_ids_->load_with_overview_mode);
+
render_view_host->UpdateWebkitPreferences(prefs);
}

Powered by Google App Engine
This is Rietveld 408576698