From b9aed893efed3119799011c5c1b61f35cf541581 Mon Sep 17 00:00:00 2001 From: Anthony Restaino Date: Sun, 31 Aug 2014 21:59:54 -0400 Subject: [PATCH] Fixed: Stay inside incognito mode even when URL could be loaded externally --- src/acr/browser/lightning/BrowserActivity.java | 1 + src/acr/browser/lightning/BrowserController.java | 2 ++ src/acr/browser/lightning/LightningView.java | 3 +++ 3 files changed, 6 insertions(+) diff --git a/src/acr/browser/lightning/BrowserActivity.java b/src/acr/browser/lightning/BrowserActivity.java index 1f7fbb6..d74eda1 100644 --- a/src/acr/browser/lightning/BrowserActivity.java +++ b/src/acr/browser/lightning/BrowserActivity.java @@ -1770,6 +1770,7 @@ public class BrowserActivity extends Activity implements BrowserController { getUrl.setAdapter(mSearchAdapter); } + @Override public boolean isIncognito() { return false; } diff --git a/src/acr/browser/lightning/BrowserController.java b/src/acr/browser/lightning/BrowserController.java index f6b2f6d..5cc4a94 100644 --- a/src/acr/browser/lightning/BrowserController.java +++ b/src/acr/browser/lightning/BrowserController.java @@ -49,4 +49,6 @@ public interface BrowserController { public boolean isActionBarShowing(); public void closeEmptyTab(); + + public boolean isIncognito(); } diff --git a/src/acr/browser/lightning/LightningView.java b/src/acr/browser/lightning/LightningView.java index 51a7eee..47df3c1 100644 --- a/src/acr/browser/lightning/LightningView.java +++ b/src/acr/browser/lightning/LightningView.java @@ -844,6 +844,9 @@ public class LightningView { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (mBrowserController.isIncognito()) { + return super.shouldOverrideUrlLoading(view, url); + } if (url.startsWith("about:")) { return super.shouldOverrideUrlLoading(view, url); }