Lightning browser with I2P configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.8 KiB

package acr.browser.lightning.activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import acr.browser.lightning.preference.PreferenceManager;
import acr.browser.lightning.R;
@SuppressWarnings("deprecation")
public class IncognitoActivity extends BrowserActivity {
10 years ago
private CookieManager mCookieManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void updateCookiePreference() {
mCookieManager = CookieManager.getInstance();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
CookieSyncManager.createInstance(this);
}
mCookieManager
.setAcceptCookie(PreferenceManager.getInstance().getIncognitoCookiesEnabled());
super.updateCookiePreference();
}
@Override
public synchronized void initializeTabs() {
super.initializeTabs();
10 years ago
// restoreOrNewTab();
newTab(null, true);
10 years ago
// if incognito mode use newTab(null, true); instead
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.incognito, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
protected void onNewIntent(Intent intent) {
10 years ago
// handleNewIntent(intent);
super.onNewIntent(intent);
}
@Override
protected void onPause() {
super.onPause();
10 years ago
// saveOpenTabs();
}
@Override
public void updateHistory(String title, String url) {
super.updateHistory(title, url);
10 years ago
// addItemToHistory(title, url);
}
@Override
public boolean isIncognito() {
return true;
}
@Override
public void closeActivity() {
closeDrawers();
finish();
}
@Override
public int getMenu() {
return R.menu.incognito;
}
}