OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.os.Handler; | 7 import android.os.Handler; |
8 import android.os.Looper; | 8 import android.os.Looper; |
9 import android.os.Message; | 9 import android.os.Message; |
10 import android.webkit.WebSettings.PluginState; | 10 import android.webkit.WebSettings.PluginState; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 private int mMinimumFontSize = 8; | 66 private int mMinimumFontSize = 8; |
67 private int mMinimumLogicalFontSize = 8; | 67 private int mMinimumLogicalFontSize = 8; |
68 private int mDefaultFontSize = 16; | 68 private int mDefaultFontSize = 16; |
69 private int mDefaultFixedFontSize = 13; | 69 private int mDefaultFixedFontSize = 13; |
70 private boolean mLoadsImagesAutomatically = true; | 70 private boolean mLoadsImagesAutomatically = true; |
71 private boolean mImagesEnabled = true; | 71 private boolean mImagesEnabled = true; |
72 private boolean mJavaScriptEnabled = false; | 72 private boolean mJavaScriptEnabled = false; |
73 private boolean mAllowUniversalAccessFromFileURLs = false; | 73 private boolean mAllowUniversalAccessFromFileURLs = false; |
74 private boolean mAllowFileAccessFromFileURLs = false; | 74 private boolean mAllowFileAccessFromFileURLs = false; |
75 private boolean mJavaScriptCanOpenWindowsAutomatically = false; | 75 private boolean mJavaScriptCanOpenWindowsAutomatically = false; |
76 private boolean mSupportMultipleWindows = false; | |
76 private PluginState mPluginState = PluginState.OFF; | 77 private PluginState mPluginState = PluginState.OFF; |
77 private boolean mDomStorageEnabled = false; | 78 private boolean mDomStorageEnabled = false; |
78 | 79 |
79 // Not accessed by the native side. | 80 // Not accessed by the native side. |
80 private String mDefaultUserAgent = ""; | 81 private String mDefaultUserAgent = ""; |
81 private boolean mSupportZoom = true; | 82 private boolean mSupportZoom = true; |
82 private boolean mBuiltInZoomControls = false; | 83 private boolean mBuiltInZoomControls = false; |
83 private boolean mDisplayZoomControls = true; | 84 private boolean mDisplayZoomControls = true; |
84 | 85 |
85 // Class to handle messages to be processed on the UI thread. | 86 // Class to handle messages to be processed on the UI thread. |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
852 * @return True if javascript can open windows automatically during | 853 * @return True if javascript can open windows automatically during |
853 * window.open(). | 854 * window.open(). |
854 */ | 855 */ |
855 public boolean getJavaScriptCanOpenWindowsAutomatically() { | 856 public boolean getJavaScriptCanOpenWindowsAutomatically() { |
856 synchronized (mContentSettingsLock) { | 857 synchronized (mContentSettingsLock) { |
857 return mJavaScriptCanOpenWindowsAutomatically; | 858 return mJavaScriptCanOpenWindowsAutomatically; |
858 } | 859 } |
859 } | 860 } |
860 | 861 |
861 /** | 862 /** |
863 * Tells the WebView whether it supports multiple windows. TRUE means | |
864 * that {@link WebChromeClient#onCreateWindow(WebView, boolean, | |
865 * boolean, Message)} is implemented by the host application. | |
866 */ | |
867 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
| |
868 assert mCanModifySettings; | |
869 synchronized (mContentSettingsLock) { | |
870 if (mSupportMultipleWindows != support) { | |
871 mSupportMultipleWindows = support; | |
872 mEventHandler.syncSettingsLocked(); | |
873 } | |
874 } | |
875 } | |
876 | |
877 /** | |
878 * Gets whether the WebView is supporting multiple windows. | |
879 * | |
880 * @return true if the WebView is supporting multiple windows. This means | |
881 * that {@link WebChromeClient#onCreateWindow(WebView, boolean, | |
882 * boolean, Message)} is implemented by the host application. | |
883 */ | |
884 public synchronized boolean supportMultipleWindows() { | |
885 synchronized (mContentSettingsLock) { | |
886 return mSupportMultipleWindows; | |
887 } | |
888 } | |
889 | |
890 /** | |
862 * Sets whether the DOM storage API is enabled. The default value is false. | 891 * Sets whether the DOM storage API is enabled. The default value is false. |
863 * | 892 * |
864 * @param flag true if the ContentView should use the DOM storage API | 893 * @param flag true if the ContentView should use the DOM storage API |
865 */ | 894 */ |
866 public void setDomStorageEnabled(boolean flag) { | 895 public void setDomStorageEnabled(boolean flag) { |
867 assert mCanModifySettings; | 896 assert mCanModifySettings; |
868 synchronized (mContentSettingsLock) { | 897 synchronized (mContentSettingsLock) { |
869 if (mDomStorageEnabled != flag) { | 898 if (mDomStorageEnabled != flag) { |
870 mDomStorageEnabled = flag; | 899 mDomStorageEnabled = flag; |
871 mEventHandler.syncSettingsLocked(); | 900 mEventHandler.syncSettingsLocked(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
943 private native int nativeInit(int contentViewPtr, boolean isMasterMode); | 972 private native int nativeInit(int contentViewPtr, boolean isMasterMode); |
944 | 973 |
945 private static native String nativeGetDefaultUserAgent(); | 974 private static native String nativeGetDefaultUserAgent(); |
946 | 975 |
947 // Synchronize Java settings from native settings. | 976 // Synchronize Java settings from native settings. |
948 private native void nativeSyncFromNative(int nativeContentSettings); | 977 private native void nativeSyncFromNative(int nativeContentSettings); |
949 | 978 |
950 // Synchronize native settings from Java settings. | 979 // Synchronize native settings from Java settings. |
951 private native void nativeSyncToNative(int nativeContentSettings); | 980 private native void nativeSyncToNative(int nativeContentSettings); |
952 } | 981 } |
OLD | NEW |