Loading api/current.xml +27 −0 Original line number Diff line number Diff line Loading @@ -212151,6 +212151,22 @@ <parameter name="defStyle" type="int"> </parameter> </constructor> <constructor name="WebView" type="android.webkit.WebView" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="context" type="android.content.Context"> </parameter> <parameter name="attrs" type="android.util.AttributeSet"> </parameter> <parameter name="defStyle" type="int"> </parameter> <parameter name="privateBrowsing" type="boolean"> </parameter> </constructor> <method name="addJavascriptInterface" return="void" abstract="false" Loading Loading @@ -212639,6 +212655,17 @@ visibility="public" > </method> <method name="isPrivateBrowsingEnabled" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="loadData" return="void" abstract="false" core/java/android/webkit/WebSettings.java +19 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class WebSettings { private boolean mSupportMultipleWindows = false; private boolean mShrinksStandaloneImagesToFit = false; private long mMaximumDecodedImageSize = 0; // 0 means default private boolean mPrivateBrowsingEnabled = false; // HTML5 API flags private boolean mAppCacheEnabled = false; private boolean mDatabaseEnabled = false; Loading Loading @@ -1468,6 +1469,24 @@ public class WebSettings { } } /** * Returns whether private browsing is enabled. */ /* package */ boolean isPrivateBrowsingEnabled() { return mPrivateBrowsingEnabled; } /** * Sets whether private browsing is enabled. * @param flag Whether private browsing should be enabled. */ /* package */ synchronized void setPrivateBrowsingEnabled(boolean flag) { if (mPrivateBrowsingEnabled != flag) { mPrivateBrowsingEnabled = flag; postSync(); } } int getDoubleTapToastCount() { return mDoubleTapToastCount; } Loading core/java/android/webkit/WebView.java +47 −2 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.URLDecoder; import java.util.ArrayList; import java.util.HashMap; Loading Loading @@ -825,7 +827,18 @@ public class WebView extends AbsoluteLayout * @param defStyle The default style resource ID. */ public WebView(Context context, AttributeSet attrs, int defStyle) { this(context, attrs, defStyle, null); this(context, attrs, defStyle, false); } /** * Construct a new WebView with layout parameters and a default style. * @param context A Context object used to access application assets. * @param attrs An AttributeSet passed to our parent. * @param defStyle The default style resource ID. */ public WebView(Context context, AttributeSet attrs, int defStyle, boolean privateBrowsing) { this(context, attrs, defStyle, null, privateBrowsing); } /** Loading @@ -841,7 +854,7 @@ public class WebView extends AbsoluteLayout * @hide pending API council approval. */ protected WebView(Context context, AttributeSet attrs, int defStyle, Map<String, Object> javascriptInterfaces) { Map<String, Object> javascriptInterfaces, boolean privateBrowsing) { super(context, attrs, defStyle); if (AccessibilityManager.getInstance(context).isEnabled()) { Loading @@ -863,6 +876,10 @@ public class WebView extends AbsoluteLayout */ init(); updateMultiTouchSupport(context); if (privateBrowsing) { startPrivateBrowsing(); } } void updateMultiTouchSupport(Context context) { Loading Loading @@ -1668,6 +1685,34 @@ public class WebView extends AbsoluteLayout } } /** * Returns true if private browsing is enabled in this WebView. */ public boolean isPrivateBrowsingEnabled () { return getSettings().isPrivateBrowsingEnabled(); } private void startPrivateBrowsing () { boolean wasPrivateBrowsingEnabled = isPrivateBrowsingEnabled(); getSettings().setPrivateBrowsingEnabled(true); if (!wasPrivateBrowsingEnabled) { StringBuilder data = new StringBuilder(1024); try { InputStreamReader file = new InputStreamReader(mContext.getResources().openRawResource(com.android.internal.R.raw.incognito_mode_start_page)); int size; char[] buffer = new char[1024]; while ((size = file.read(buffer)) != -1) { data.append(buffer, 0, size); } } catch (IOException e) { // This should never happen since this is a static resource. } loadDataWithBaseURL(null, data.toString(), "text/html", "utf-8", null); } } private boolean extendScroll(int y) { int finalY = mScroller.getFinalY(); int newY = pinLocY(finalY + y); Loading core/res/res/raw/incognito_mode_start_page.html 0 → 100644 +24 −0 Original line number Diff line number Diff line <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> <title>New incognito window</title> </head> <body> <p><strong>You've gone incognito</strong>. Pages you view in this window won't appear in your browser history or search history, and they won't leave other traces, like cookies, on your computer after you close the incognito window. Any files you download or bookmarks you create will be preserved, however.</p> <p><strong>Going incognito doesn't affect the behavior of other people, servers, or software. Be wary of:</strong></p> <ul> <li>Websites that collect or share information about you</li> <li>Internet service providers or employers that track the pages you visit</li> <li>Malicious software that tracks your keystrokes in exchange for free smileys</li> <li>Surveillance by secret agents</li> <li>People standing behind you</li> </ul> </body> </html> tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -754,7 +754,7 @@ public class TestShellActivity extends Activity implements LayoutTestController private static class NewWindowWebView extends WebView { public NewWindowWebView(Context context, Map<String, Object> jsIfaces) { super(context, null, 0, jsIfaces); super(context, null, 0, jsIfaces, false); } } Loading Loading
api/current.xml +27 −0 Original line number Diff line number Diff line Loading @@ -212151,6 +212151,22 @@ <parameter name="defStyle" type="int"> </parameter> </constructor> <constructor name="WebView" type="android.webkit.WebView" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="context" type="android.content.Context"> </parameter> <parameter name="attrs" type="android.util.AttributeSet"> </parameter> <parameter name="defStyle" type="int"> </parameter> <parameter name="privateBrowsing" type="boolean"> </parameter> </constructor> <method name="addJavascriptInterface" return="void" abstract="false" Loading Loading @@ -212639,6 +212655,17 @@ visibility="public" > </method> <method name="isPrivateBrowsingEnabled" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="loadData" return="void" abstract="false"
core/java/android/webkit/WebSettings.java +19 −0 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public class WebSettings { private boolean mSupportMultipleWindows = false; private boolean mShrinksStandaloneImagesToFit = false; private long mMaximumDecodedImageSize = 0; // 0 means default private boolean mPrivateBrowsingEnabled = false; // HTML5 API flags private boolean mAppCacheEnabled = false; private boolean mDatabaseEnabled = false; Loading Loading @@ -1468,6 +1469,24 @@ public class WebSettings { } } /** * Returns whether private browsing is enabled. */ /* package */ boolean isPrivateBrowsingEnabled() { return mPrivateBrowsingEnabled; } /** * Sets whether private browsing is enabled. * @param flag Whether private browsing should be enabled. */ /* package */ synchronized void setPrivateBrowsingEnabled(boolean flag) { if (mPrivateBrowsingEnabled != flag) { mPrivateBrowsingEnabled = flag; postSync(); } } int getDoubleTapToastCount() { return mDoubleTapToastCount; } Loading
core/java/android/webkit/WebView.java +47 −2 Original line number Diff line number Diff line Loading @@ -86,6 +86,8 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.URLDecoder; import java.util.ArrayList; import java.util.HashMap; Loading Loading @@ -825,7 +827,18 @@ public class WebView extends AbsoluteLayout * @param defStyle The default style resource ID. */ public WebView(Context context, AttributeSet attrs, int defStyle) { this(context, attrs, defStyle, null); this(context, attrs, defStyle, false); } /** * Construct a new WebView with layout parameters and a default style. * @param context A Context object used to access application assets. * @param attrs An AttributeSet passed to our parent. * @param defStyle The default style resource ID. */ public WebView(Context context, AttributeSet attrs, int defStyle, boolean privateBrowsing) { this(context, attrs, defStyle, null, privateBrowsing); } /** Loading @@ -841,7 +854,7 @@ public class WebView extends AbsoluteLayout * @hide pending API council approval. */ protected WebView(Context context, AttributeSet attrs, int defStyle, Map<String, Object> javascriptInterfaces) { Map<String, Object> javascriptInterfaces, boolean privateBrowsing) { super(context, attrs, defStyle); if (AccessibilityManager.getInstance(context).isEnabled()) { Loading @@ -863,6 +876,10 @@ public class WebView extends AbsoluteLayout */ init(); updateMultiTouchSupport(context); if (privateBrowsing) { startPrivateBrowsing(); } } void updateMultiTouchSupport(Context context) { Loading Loading @@ -1668,6 +1685,34 @@ public class WebView extends AbsoluteLayout } } /** * Returns true if private browsing is enabled in this WebView. */ public boolean isPrivateBrowsingEnabled () { return getSettings().isPrivateBrowsingEnabled(); } private void startPrivateBrowsing () { boolean wasPrivateBrowsingEnabled = isPrivateBrowsingEnabled(); getSettings().setPrivateBrowsingEnabled(true); if (!wasPrivateBrowsingEnabled) { StringBuilder data = new StringBuilder(1024); try { InputStreamReader file = new InputStreamReader(mContext.getResources().openRawResource(com.android.internal.R.raw.incognito_mode_start_page)); int size; char[] buffer = new char[1024]; while ((size = file.read(buffer)) != -1) { data.append(buffer, 0, size); } } catch (IOException e) { // This should never happen since this is a static resource. } loadDataWithBaseURL(null, data.toString(), "text/html", "utf-8", null); } } private boolean extendScroll(int y) { int finalY = mScroller.getFinalY(); int newY = pinLocY(finalY + y); Loading
core/res/res/raw/incognito_mode_start_page.html 0 → 100644 +24 −0 Original line number Diff line number Diff line <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> <title>New incognito window</title> </head> <body> <p><strong>You've gone incognito</strong>. Pages you view in this window won't appear in your browser history or search history, and they won't leave other traces, like cookies, on your computer after you close the incognito window. Any files you download or bookmarks you create will be preserved, however.</p> <p><strong>Going incognito doesn't affect the behavior of other people, servers, or software. Be wary of:</strong></p> <ul> <li>Websites that collect or share information about you</li> <li>Internet service providers or employers that track the pages you visit</li> <li>Malicious software that tracks your keystrokes in exchange for free smileys</li> <li>Surveillance by secret agents</li> <li>People standing behind you</li> </ul> </body> </html>
tests/DumpRenderTree/src/com/android/dumprendertree/TestShellActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -754,7 +754,7 @@ public class TestShellActivity extends Activity implements LayoutTestController private static class NewWindowWebView extends WebView { public NewWindowWebView(Context context, Map<String, Object> jsIfaces) { super(context, null, 0, jsIfaces); super(context, null, 0, jsIfaces, false); } } Loading