@ -187,7 +187,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -187,7 +187,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
LightningDialogBuilder bookmarksDialogBuilder ;
@Inject
TabsManager t absManager;
TabsManager mT absManager;
// Preference manager was moved on ThemeableBrowserActivity
@ -346,7 +346,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -346,7 +346,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
WebIconDatabase . getInstance ( ) . open ( getDir ( "icons" , MODE_PRIVATE ) . getPath ( ) ) ;
}
t absManager. restoreTabsAndHandleIntent ( this , getIntent ( ) , isIncognito ( ) ) ;
mT absManager. restoreTabsAndHandleIntent ( this , getIntent ( ) , isIncognito ( ) ) ;
// At this point we always have at least a tab in the tab manager
showTab ( 0 ) ;
@ -363,7 +363,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -363,7 +363,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
InputMethodManager imm = ( InputMethodManager ) getSystemService ( Context . INPUT_METHOD_SERVICE ) ;
imm . hideSoftInputFromWindow ( mSearch . getWindowToken ( ) , 0 ) ;
searchTheWeb ( mSearch . getText ( ) . toString ( ) ) ;
final LightningView currentView = t absManager. getCurrentTab ( ) ;
final LightningView currentView = mT absManager. getCurrentTab ( ) ;
if ( currentView ! = null ) {
currentView . requestFocus ( ) ;
}
@ -386,7 +386,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -386,7 +386,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
InputMethodManager imm = ( InputMethodManager ) getSystemService ( Context . INPUT_METHOD_SERVICE ) ;
imm . hideSoftInputFromWindow ( mSearch . getWindowToken ( ) , 0 ) ;
searchTheWeb ( mSearch . getText ( ) . toString ( ) ) ;
final LightningView currentView = t absManager. getCurrentTab ( ) ;
final LightningView currentView = mT absManager. getCurrentTab ( ) ;
if ( currentView ! = null ) {
currentView . requestFocus ( ) ;
}
@ -397,13 +397,13 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -397,13 +397,13 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Override
public void onFocusChange ( View v , final boolean hasFocus ) {
final LightningView currentView = t absManager. getCurrentTab ( ) ;
final LightningView currentView = mT absManager. getCurrentTab ( ) ;
if ( ! hasFocus & & currentView ! = null ) {
setIsLoading ( currentView . getProgress ( ) < 100 ) ;
updateUrl ( currentView . getUrl ( ) , true ) ;
} else if ( hasFocus & & currentView ! = null ) {
String url = currentView . getUrl ( ) ;
if ( url . startsWith ( Constants . FILE ) ) {
if ( UrlUtils . isSpecialUrl ( url ) ) {
mSearch . setText ( "" ) ;
} else {
mSearch . setText ( url ) ;
@ -553,8 +553,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -553,8 +553,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
}
private void initializePreferences ( ) {
final LightningView currentView = t absManager. getCurrentTab ( ) ;
final WebView currentWebView = t absManager. getCurrentWebView ( ) ;
final LightningView currentView = mT absManager. getCurrentTab ( ) ;
final WebView currentWebView = mT absManager. getCurrentWebView ( ) ;
mFullScreen = mPreferences . getFullScreenEnabled ( ) ;
boolean colorMode = mPreferences . getColorModeEnabled ( ) ;
colorMode & = ! mDarkTheme ;
@ -665,7 +665,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -665,7 +665,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Override
public boolean onOptionsItemSelected ( MenuItem item ) {
final LightningView currentView = t absManager. getCurrentTab ( ) ;
final LightningView currentView = mT absManager. getCurrentTab ( ) ;
// Handle action buttons
switch ( item . getItemId ( ) ) {
case android . R . id . home :
@ -691,7 +691,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -691,7 +691,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
overridePendingTransition ( R . anim . slide_up_in , R . anim . fade_out_scale ) ;
return true ;
case R . id . action_share :
if ( currentView ! = null & & ! currentView . getUrl ( ) . startsWith ( Constants . FILE ) ) {
if ( currentView ! = null & & ! UrlUtils . isSpecialUrl ( currentView . getUrl ( ) ) ) {
Intent shareIntent = new Intent ( Intent . ACTION_SEND ) ;
shareIntent . setType ( "text/plain" ) ;
shareIntent . putExtra ( Intent . EXTRA_SUBJECT , currentView . getTitle ( ) ) ;
@ -703,7 +703,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -703,7 +703,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
openBookmarks ( ) ;
return true ;
case R . id . action_copy :
if ( currentView ! = null & & ! currentView . getUrl ( ) . startsWith ( Constants . FILE ) ) {
if ( currentView ! = null & & ! UrlUtils . isSpecialUrl ( currentView . getUrl ( ) ) ) {
ClipboardManager clipboard = ( ClipboardManager ) getSystemService ( CLIPBOARD_SERVICE ) ;
ClipData clip = ClipData . newPlainText ( "label" , currentView . getUrl ( ) ) ;
clipboard . setPrimaryClip ( clip ) ;
@ -717,7 +717,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -717,7 +717,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
openHistory ( ) ;
return true ;
case R . id . action_add_bookmark :
if ( currentView ! = null & & ! currentView . getUrl ( ) . startsWith ( Constants . FILE ) ) {
if ( currentView ! = null & & ! UrlUtils . isSpecialUrl ( currentView . getUrl ( ) ) ) {
mEventBus . post ( new BrowserEvents . AddBookmark ( currentView . getTitle ( ) ,
currentView . getUrl ( ) ) ) ;
}
@ -761,7 +761,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -761,7 +761,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
}
private void showSearchInterfaceBar ( String text ) {
final LightningView currentView = t absManager. getCurrentTab ( ) ;
final LightningView currentView = mT absManager. getCurrentTab ( ) ;
if ( currentView ! = null ) {
currentView . find ( text ) ;
}
@ -815,9 +815,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -815,9 +815,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* @param position the poition of the tab to display
* /
private synchronized void showTab ( final int position ) {
final LightningView currentView = t absManager. getCurrentTab ( ) ;
final LightningView currentView = mT absManager. getCurrentTab ( ) ;
final WebView currentWebView = currentView ! = null ? currentView . getWebView ( ) : null ;
final LightningView newView = t absManager. switchToTab ( position ) ;
final LightningView newView = mT absManager. switchToTab ( position ) ;
final WebView newWebView = newView ! = null ? newView . getWebView ( ) : null ;
if ( newView = = null | | newWebView = = null ) {
return ;
@ -825,7 +825,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -825,7 +825,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
// Set the background color so the color mode color doesn't show through
mBrowserFrame . setBackgroundColor ( mBackgroundColor ) ;
if ( newView = = currentView & & ! currentView . isShown ( ) ) {
if ( newView = = currentView & & currentView . isShown ( ) ) {
return ;
}
mIsNewIntent = false ;
@ -845,6 +845,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -845,6 +845,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
updateProgress ( 0 ) ;
}
removeViewFromParent ( newWebView ) ;
mBrowserFrame . addView ( newWebView , MATCH_PARENT ) ;
newView . requestFocus ( ) ;
newView . onResume ( ) ;
@ -891,32 +892,53 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -891,32 +892,53 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
}
void handleNewIntent ( Intent intent ) {
private static void removeViewFromParent ( View view ) {
ViewGroup parent = ( ( ViewGroup ) view . getParent ( ) ) ;
if ( parent ! = null ) {
parent . removeView ( view ) ;
}
}
String url = null ;
void handleNewIntent ( Intent intent ) {
final String url ;
if ( intent ! = null ) {
url = intent . getDataString ( ) ;
} else {
url = null ;
}
int num = 0 ;
String source = null ;
final String source ;
if ( intent ! = null & & intent . getExtras ( ) ! = null ) {
num = intent . getExtras ( ) . getInt ( getPackageName ( ) + ".Origin" ) ;
source = intent . getExtras ( ) . getString ( "SOURCE" ) ;
} else {
source = null ;
}
if ( num = = 1 ) {
loadUrlInCurrentView ( url ) ;
} else if ( url ! = null ) {
if ( url . startsWith ( Constants . FILE ) ) {
Utils . showSnackbar ( this , R . string . message_blocked_local ) ;
url = null ;
AlertDialog . Builder builder = new AlertDialog . Builder ( this ) ;
builder . setCancelable ( true )
. setTitle ( R . string . title_warning )
. setMessage ( R . string . message_blocked_local )
. setNegativeButton ( android . R . string . cancel , null )
. setPositiveButton ( R . string . action_open , new DialogInterface . OnClickListener ( ) {
@Override
public void onClick ( DialogInterface dialog , int which ) {
newTab ( url , true ) ;
}
} )
. show ( ) ;
} else {
newTab ( url , true ) ;
}
newTab ( url , true ) ;
mIsNewIntent = ( source = = null ) ;
}
}
private void loadUrlInCurrentView ( final String url ) {
final LightningView currentTab = tabsManager . getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab = = null ) {
// This is a problem, probably an assert will be better than a return
return ;
@ -928,7 +950,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -928,7 +950,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Override
public void closeEmptyTab ( ) {
final WebView currentWebView = t absManager. getCurrentWebView ( ) ;
final WebView currentWebView = mT absManager. getCurrentWebView ( ) ;
if ( currentWebView ! = null & & currentWebView . copyBackForwardList ( ) . getSize ( ) = = 0 ) {
closeCurrentTab ( ) ;
}
@ -942,25 +964,25 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -942,25 +964,25 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
public void onTrimMemory ( int level ) {
if ( level > TRIM_MEMORY_MODERATE & & Build . VERSION . SDK_INT < Build . VERSION_CODES . KITKAT ) {
Log . d ( Constants . TAG , "Low Memory, Free Memory" ) ;
t absManager. freeMemory ( ) ;
mT absManager. freeMemory ( ) ;
}
}
private synchronized boolean newTab ( String url , boolean show ) {
// Limit number of tabs for limited version of app
if ( ! Constants . FULL_VERSION & & t absManager. size ( ) > = 10 ) {
if ( ! Constants . FULL_VERSION & & mT absManager. size ( ) > = 10 ) {
Utils . showSnackbar ( this , R . string . max_tabs ) ;
return false ;
}
mIsNewIntent = false ;
LightningView startingTab = t absManager. newTab ( this , url , isIncognito ( ) ) ;
LightningView startingTab = mT absManager. newTab ( this , url , isIncognito ( ) ) ;
if ( mIdGenerator = = 0 ) {
startingTab . resumeTimers ( ) ;
}
mIdGenerator + + ;
if ( show ) {
showTab ( t absManager. size ( ) - 1 ) ;
showTab ( mT absManager. size ( ) - 1 ) ;
}
// TODO Check is this is callable directly from LightningView
mEventBus . post ( new BrowserEvents . TabsChanged ( ) ) ;
@ -969,7 +991,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -969,7 +991,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// mDrawerListLeft.smoothScrollToPosition(t absManager.size() - 1);
// mDrawerListLeft.smoothScrollToPosition(mT absManager.size() - 1);
// }
// }, 300);
@ -977,16 +999,16 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -977,16 +999,16 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
}
private synchronized void deleteTab ( int position ) {
final LightningView tabToDelete = t absManager. getTabAtPosition ( position ) ;
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView tabToDelete = mT absManager. getTabAtPosition ( position ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( tabToDelete = = null ) {
return ;
}
int current = t absManager. positionOf ( currentTab ) ;
int current = mT absManager. positionOf ( currentTab ) ;
if ( ! tabToDelete . getUrl ( ) . startsWith ( Constants . FILE ) & & ! isIncognito ( ) ) {
if ( ! UrlUtils . isSpecialUrl ( tabToDelete . getUrl ( ) ) & & ! isIncognito ( ) ) {
mPreferences . setSavedUrl ( tabToDelete . getUrl ( ) ) ;
}
final boolean isShown = tabToDelete . isShown ( ) ;
@ -995,30 +1017,30 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -995,30 +1017,30 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
mBrowserFrame . setBackgroundColor ( mBackgroundColor ) ;
}
if ( current > position ) {
t absManager. deleteTab ( position ) ;
mT absManager. deleteTab ( position ) ;
mEventBus . post ( new BrowserEvents . TabsChanged ( ) ) ;
} else if ( t absManager. size ( ) > position + 1 ) {
} else if ( mT absManager. size ( ) > position + 1 ) {
if ( current = = position ) {
showTab ( position + 1 ) ;
t absManager. deleteTab ( position ) ;
mT absManager. deleteTab ( position ) ;
mEventBus . post ( new BrowserEvents . TabsChanged ( ) ) ;
} else {
t absManager. deleteTab ( position ) ;
mT absManager. deleteTab ( position ) ;
}
} else if ( t absManager. size ( ) > 1 ) {
} else if ( mT absManager. size ( ) > 1 ) {
if ( current = = position ) {
showTab ( position - 1 ) ;
t absManager. deleteTab ( position ) ;
mT absManager. deleteTab ( position ) ;
mEventBus . post ( new BrowserEvents . TabsChanged ( ) ) ;
} else {
t absManager. deleteTab ( position ) ;
mT absManager. deleteTab ( position ) ;
}
} else {
if ( currentTab ! = null & & ( currentTab . getUrl ( ) . startsWith ( Constants . FILE )
if ( currentTab ! = null & & ( UrlUtils . isSpecialUrl ( currentTab . getUrl ( ) )
| | currentTab . getUrl ( ) . equals ( mHomepage ) ) ) {
closeActivity ( ) ;
} else {
t absManager. deleteTab ( position ) ;
mT absManager. deleteTab ( position ) ;
performExitCleanUp ( ) ;
tabToDelete . pauseTimers ( ) ;
mEventBus . post ( new BrowserEvents . TabsChanged ( ) ) ;
@ -1036,7 +1058,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1036,7 +1058,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
}
private void performExitCleanUp ( ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( mPreferences . getClearCacheExit ( ) & & currentTab ! = null & & ! isIncognito ( ) ) {
WebUtils . clearCache ( currentTab . getWebView ( ) ) ;
Log . d ( Constants . TAG , "Cache Cleared" ) ;
@ -1059,9 +1081,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1059,9 +1081,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Override
public boolean onKeyLongPress ( int keyCode , KeyEvent event ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( keyCode = = KeyEvent . KEYCODE_BACK ) {
showCloseDialog ( t absManager. positionOf ( currentTab ) ) ;
showCloseDialog ( mT absManager. positionOf ( currentTab ) ) ;
}
return true ;
}
@ -1069,14 +1091,14 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1069,14 +1091,14 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
private void closeBrowser ( ) {
mBrowserFrame . setBackgroundColor ( mBackgroundColor ) ;
performExitCleanUp ( ) ;
t absManager. shutdown ( ) ;
mT absManager. shutdown ( ) ;
mEventBus . post ( new BrowserEvents . TabsChanged ( ) ) ;
finish ( ) ;
}
@Override
public synchronized void onBackPressed ( ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( mDrawerLayout . isDrawerOpen ( mDrawerLeft ) ) {
mDrawerLayout . closeDrawer ( mDrawerLeft ) ;
} else if ( mDrawerLayout . isDrawerOpen ( mDrawerRight ) ) {
@ -1096,7 +1118,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1096,7 +1118,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
if ( mCustomView ! = null | | mCustomViewCallback ! = null ) {
onHideCustomView ( ) ;
} else {
deleteTab ( t absManager. positionOf ( currentTab ) ) ;
deleteTab ( mT absManager. positionOf ( currentTab ) ) ;
}
}
} else {
@ -1109,7 +1131,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1109,7 +1131,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Override
protected void onPause ( ) {
super . onPause ( ) ;
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
Log . d ( Constants . TAG , "onPause" ) ;
if ( currentTab ! = null ) {
currentTab . pauseTimers ( ) ;
@ -1129,7 +1151,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1129,7 +1151,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
void saveOpenTabs ( ) {
if ( mPreferences . getRestoreLostTabsEnabled ( ) ) {
final String s = t absManager. tabsString ( ) ;
final String s = mT absManager. tabsString ( ) ;
mPreferences . setMemoryUrl ( s ) ;
}
}
@ -1159,7 +1181,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1159,7 +1181,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Override
protected void onResume ( ) {
super . onResume ( ) ;
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
Log . d ( Constants . TAG , "onResume" ) ;
if ( mSearchAdapter ! = null ) {
mSearchAdapter . refreshPreferences ( ) ;
@ -1170,7 +1192,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1170,7 +1192,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
currentTab . onResume ( ) ;
}
initializePreferences ( ) ;
t absManager. resume ( this ) ;
mT absManager. resume ( this ) ;
supportInvalidateOptionsMenu ( ) ;
@ -1186,7 +1208,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1186,7 +1208,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* checks if it is a search , url , etc .
* /
private void searchTheWeb ( @NonNull String query ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( query . isEmpty ( ) ) {
return ;
}
@ -1271,9 +1293,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1271,9 +1293,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
if ( url = = null | | mSearch = = null | | mSearch . hasFocus ( ) ) {
return ;
}
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
mEventBus . post ( new BrowserEvents . CurrentPageUrl ( url ) ) ;
if ( shortUrl & & ! url . startsWith ( Constants . FILE ) ) {
if ( shortUrl & & ! UrlUtils . isSpecialUrl ( url ) ) {
switch ( mPreferences . getUrlBoxContentChoice ( ) ) {
case 0 : // Default, show only the domain
url = url . replaceFirst ( Constants . HTTP , "" ) ;
@ -1292,7 +1314,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1292,7 +1314,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
break ;
}
} else {
if ( url . startsWith ( Constants . FILE ) ) {
if ( UrlUtils . isSpecialUrl ( url ) ) {
url = "" ;
}
mSearch . setText ( url ) ;
@ -1320,7 +1342,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1320,7 +1342,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
}
}
} ;
if ( ! url . startsWith ( Constants . FILE ) ) {
if ( ! UrlUtils . isSpecialUrl ( url ) ) {
new Thread ( update ) . start ( ) ;
}
}
@ -1355,7 +1377,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1355,7 +1377,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
searchTheWeb ( url ) ;
InputMethodManager imm = ( InputMethodManager ) getSystemService ( Context . INPUT_METHOD_SERVICE ) ;
imm . hideSoftInputFromWindow ( getUrl . getWindowToken ( ) , 0 ) ;
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab ! = null ) {
currentTab . requestFocus ( ) ;
}
@ -1522,7 +1544,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1522,7 +1544,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Override
public synchronized void onShowCustomView ( final View view , CustomViewCallback callback , int requestedOrientation ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( view = = null | | mCustomView ! = null ) {
if ( callback ! = null ) {
try {
@ -1569,7 +1591,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1569,7 +1591,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Override
public void onHideCustomView ( ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( mCustomView = = null | | mCustomViewCallback = = null | | currentTab = = null ) {
if ( mCustomViewCallback ! = null ) {
try {
@ -1687,7 +1709,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1687,7 +1709,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
return ;
}
if ( newTab ( "" , true ) ) {
LightningView newTab = t absManager. getTabAtPosition ( t absManager. size ( ) - 1 ) ;
LightningView newTab = mT absManager. getTabAtPosition ( mT absManager. size ( ) - 1 ) ;
if ( newTab ! = null ) {
final WebView webView = newTab . getWebView ( ) ;
if ( webView ! = null ) {
@ -1709,7 +1731,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1709,7 +1731,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* /
@Override
public void onCloseWindow ( LightningView view ) {
deleteTab ( t absManager. positionOf ( view ) ) ;
deleteTab ( mT absManager. positionOf ( view ) ) ;
}
/ * *
@ -1719,7 +1741,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1719,7 +1741,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* /
@Override
public void hideActionBar ( ) {
final WebView currentWebView = t absManager. getCurrentWebView ( ) ;
final WebView currentWebView = mT absManager. getCurrentWebView ( ) ;
if ( mFullScreen ) {
if ( mBrowserFrame . findViewById ( R . id . toolbar_layout ) = = null ) {
mUiLayout . removeView ( mToolbarLayout ) ;
@ -1759,7 +1781,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1759,7 +1781,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Override
public void showActionBar ( ) {
if ( mFullScreen ) {
final WebView view = t absManager. getCurrentWebView ( ) ;
final WebView view = mT absManager. getCurrentWebView ( ) ;
if ( mToolbarLayout = = null )
return ;
@ -1780,7 +1802,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1780,7 +1802,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
view . setTranslationY ( height ) ;
}
}
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab = = null )
return ;
@ -1823,7 +1845,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1823,7 +1845,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* See setIsFinishedLoading and setIsLoading for displaying the correct icon
* /
private void refreshOrStop ( ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab ! = null ) {
if ( currentTab . getProgress ( ) < 100 ) {
currentTab . stopLoading ( ) ;
@ -1842,7 +1864,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1842,7 +1864,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* /
@Override
public void onClick ( View v ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab = = null ) {
return ;
}
@ -1927,7 +1949,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1927,7 +1949,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
super . onReceive ( context , intent ) ;
boolean isConnected = isConnected ( context ) ;
Log . d ( Constants . TAG , "Network Connected: " + String . valueOf ( isConnected ) ) ;
t absManager. notifyConnectionStatus ( isConnected ) ;
mT absManager. notifyConnectionStatus ( isConnected ) ;
}
} ;
@ -1992,7 +2014,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -1992,7 +2014,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* /
@Subscribe
public void bookmarkCurrentPage ( final BookmarkEvents . WantToBookmarkCurrentPage event ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab ! = null ) {
mEventBus . post ( new BrowserEvents . AddBookmark ( currentTab . getTitle ( ) , currentTab . getUrl ( ) ) ) ;
}
@ -2016,9 +2038,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -2016,9 +2038,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* /
@Subscribe
public void bookmarkChanged ( final BookmarkEvents . BookmarkChanged event ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab ! = null & & currentTab . getUrl ( ) . startsWith ( Constants . FILE )
& & currentTab . getUrl ( ) . endsWith ( Constants . BOOKMARKS_ FILENAME) ) {
& & currentTab . getUrl ( ) . endsWith ( BookmarkPage . FILENAME ) ) {
currentTab . loadBookmarkpage ( ) ;
}
if ( currentTab ! = null ) {
@ -2033,9 +2055,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -2033,9 +2055,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* /
@Subscribe
public void bookmarkDeleted ( final BookmarkEvents . Deleted event ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab ! = null & & currentTab . getUrl ( ) . startsWith ( Constants . FILE )
& & currentTab . getUrl ( ) . endsWith ( Constants . BOOKMARKS_ FILENAME) ) {
& & currentTab . getUrl ( ) . endsWith ( BookmarkPage . FILENAME ) ) {
currentTab . loadBookmarkpage ( ) ;
}
if ( currentTab ! = null ) {
@ -2103,12 +2125,12 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -2103,12 +2125,12 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* /
@Subscribe
public void goBack ( final NavigationEvents . GoBack event ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab ! = null ) {
if ( currentTab . canGoBack ( ) ) {
currentTab . goBack ( ) ;
} else {
deleteTab ( t absManager. positionOf ( currentTab ) ) ;
deleteTab ( mT absManager. positionOf ( currentTab ) ) ;
}
}
}
@ -2120,7 +2142,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -2120,7 +2142,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
* /
@Subscribe
public void goForward ( final NavigationEvents . GoForward event ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab ! = null ) {
if ( currentTab . canGoForward ( ) ) {
currentTab . goForward ( ) ;
@ -2130,7 +2152,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@@ -2130,7 +2152,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
@Subscribe
public void goHome ( final NavigationEvents . GoHome event ) {
final LightningView currentTab = t absManager. getCurrentTab ( ) ;
final LightningView currentTab = mT absManager. getCurrentTab ( ) ;
if ( currentTab ! = null ) {
currentTab . loadHomepage ( ) ;
closeDrawers ( ) ;