Browse Source

Removed unnecessary code

master
Anthony Restaino 11 years ago
parent
commit
617e134e83
  1. 20
      src/acr/browser/lightning/BrowserActivity.java
  2. 1
      src/acr/browser/lightning/IncognitoActivity.java
  3. 1
      src/acr/browser/lightning/MainActivity.java

20
src/acr/browser/lightning/BrowserActivity.java

@ -531,14 +531,6 @@ public class BrowserActivity extends Activity implements BrowserController {
public synchronized void initializeTabs() { public synchronized void initializeTabs() {
} }
public void setIsIncognito(boolean letsAsk){
isIncognito = letsAsk;
}
public boolean isThisIncognito(){
return isIncognito;
}
public void restoreOrNewTab() { public void restoreOrNewTab() {
mIdGenerator = 0; mIdGenerator = 0;
@ -1095,19 +1087,19 @@ public class BrowserActivity extends Activity implements BrowserController {
mWebViews.remove(position); mWebViews.remove(position);
if (mPreferences.getBoolean( if (mPreferences.getBoolean(
PreferenceConstants.CLEAR_CACHE_EXIT, false) PreferenceConstants.CLEAR_CACHE_EXIT, false)
&& mCurrentView != null && !isThisIncognito()) { && mCurrentView != null && !isIncognito()) {
mCurrentView.clearCache(true); mCurrentView.clearCache(true);
Log.i(Constants.LOGTAG, "Cache Cleared"); Log.i(Constants.LOGTAG, "Cache Cleared");
} }
if (mPreferences.getBoolean(PreferenceConstants.CLEAR_HISTORY_EXIT, if (mPreferences.getBoolean(PreferenceConstants.CLEAR_HISTORY_EXIT,
false) && !isThisIncognito()) { false) && !isIncognito()) {
clearHistory(); clearHistory();
Log.i(Constants.LOGTAG, "History Cleared"); Log.i(Constants.LOGTAG, "History Cleared");
} }
if (mPreferences.getBoolean(PreferenceConstants.CLEAR_COOKIES_EXIT, if (mPreferences.getBoolean(PreferenceConstants.CLEAR_COOKIES_EXIT,
false) && !isThisIncognito()) { false) && !isIncognito()) {
clearCookies(); clearCookies();
Log.i(Constants.LOGTAG, "Cookies Cleared"); Log.i(Constants.LOGTAG, "Cookies Cleared");
@ -1138,19 +1130,19 @@ public class BrowserActivity extends Activity implements BrowserController {
public boolean onKeyLongPress(int keyCode, KeyEvent event) { public boolean onKeyLongPress(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) { if (keyCode == KeyEvent.KEYCODE_BACK) {
if (mPreferences.getBoolean(PreferenceConstants.CLEAR_CACHE_EXIT, if (mPreferences.getBoolean(PreferenceConstants.CLEAR_CACHE_EXIT,
false) && mCurrentView != null && !isThisIncognito()) { false) && mCurrentView != null && !isIncognito()) {
mCurrentView.clearCache(true); mCurrentView.clearCache(true);
Log.i(Constants.LOGTAG, "Cache Cleared"); Log.i(Constants.LOGTAG, "Cache Cleared");
} }
if (mPreferences.getBoolean(PreferenceConstants.CLEAR_HISTORY_EXIT, if (mPreferences.getBoolean(PreferenceConstants.CLEAR_HISTORY_EXIT,
false) && !isThisIncognito()) { false) && !isIncognito()) {
clearHistory(); clearHistory();
Log.i(Constants.LOGTAG, "History Cleared"); Log.i(Constants.LOGTAG, "History Cleared");
} }
if (mPreferences.getBoolean(PreferenceConstants.CLEAR_COOKIES_EXIT, if (mPreferences.getBoolean(PreferenceConstants.CLEAR_COOKIES_EXIT,
false) && !isThisIncognito()) { false) && !isIncognito()) {
clearCookies(); clearCookies();
Log.i(Constants.LOGTAG, "Cookies Cleared"); Log.i(Constants.LOGTAG, "Cookies Cleared");

1
src/acr/browser/lightning/IncognitoActivity.java

@ -16,7 +16,6 @@ public class IncognitoActivity extends BrowserActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
super.setIsIncognito(true);
} }
@Override @Override

1
src/acr/browser/lightning/MainActivity.java

@ -16,7 +16,6 @@ public class MainActivity extends BrowserActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0); mPreferences = getSharedPreferences(PreferenceConstants.PREFERENCES, 0);
super.setIsIncognito(false);
} }
@Override @Override

Loading…
Cancel
Save