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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentSettings.java

Issue 11192057: [Android] Add supportMultipleWindows setting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/public/android/java/src/org/chromium/content/browser/ContentSettings.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java b/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java
index 416bdcd5bb6c8a498bfbf10e81950f7d2bcf0737..571f218ef1a84e4e68ef73436aec904398d1058f 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentSettings.java
@@ -73,6 +73,7 @@ public class ContentSettings {
private boolean mAllowUniversalAccessFromFileURLs = false;
private boolean mAllowFileAccessFromFileURLs = false;
private boolean mJavaScriptCanOpenWindowsAutomatically = false;
+ private boolean mSupportMultipleWindows = false;
private PluginState mPluginState = PluginState.OFF;
private boolean mDomStorageEnabled = false;
@@ -859,6 +860,34 @@ public class ContentSettings {
}
/**
+ * Tells the WebView whether it supports multiple windows. TRUE means
+ * that {@link WebChromeClient#onCreateWindow(WebView, boolean,
+ * boolean, Message)} is implemented by the host application.
+ */
+ public synchronized void setSupportMultipleWindows(boolean support) {
benm (inactive) 2012/10/19 11:02:59 no need for the synchronized here, we use mContent
mnaganov (inactive) 2012/10/19 15:46:39 Sorry, copied the code from the interface definiti
+ assert mCanModifySettings;
+ synchronized (mContentSettingsLock) {
+ if (mSupportMultipleWindows != support) {
+ mSupportMultipleWindows = support;
+ mEventHandler.syncSettingsLocked();
+ }
+ }
+ }
+
+ /**
+ * Gets whether the WebView is supporting multiple windows.
+ *
+ * @return true if the WebView is supporting multiple windows. This means
+ * that {@link WebChromeClient#onCreateWindow(WebView, boolean,
+ * boolean, Message)} is implemented by the host application.
+ */
+ public synchronized boolean supportMultipleWindows() {
+ synchronized (mContentSettingsLock) {
+ return mSupportMultipleWindows;
+ }
+ }
+
+ /**
* Sets whether the DOM storage API is enabled. The default value is false.
*
* @param flag true if the ContentView should use the DOM storage API

Powered by Google App Engine
This is Rietveld 408576698