Bug 1145581 - Show tabs when opening fennec from the Tab Queue notification (r=mcomella)

This commit is contained in:
Martyn Haigh 2015-03-27 11:58:30 +00:00
parent 5718b3455d
commit 4dcce4682a
2 changed files with 13 additions and 1 deletions

View File

@ -3396,6 +3396,7 @@ public class BrowserApp extends GeckoApp
final boolean isViewAction = Intent.ACTION_VIEW.equals(action);
final boolean isBookmarkAction = GeckoApp.ACTION_HOMESCREEN_SHORTCUT.equals(action);
final boolean isTabQueueAction = TabQueueHelper.LOAD_URLS_ACTION.equals(action);
if (mInitialized && (isViewAction || isBookmarkAction)) {
// Dismiss editing mode if the user is loading a URL from an external app.
@ -3424,6 +3425,17 @@ public class BrowserApp extends GeckoApp
GuestSession.handleIntent(this, intent);
}
// If the user has clicked the tab queue notification then load the tabs.
if(AppConstants.NIGHTLY_BUILD && AppConstants.MOZ_ANDROID_TAB_QUEUE && mInitialized && isTabQueueAction) {
int queuedTabCount = TabQueueHelper.getTabQueueLength(this);
TabQueueHelper.openQueuedUrls(this, mProfile, TabQueueHelper.FILE_NAME);
// If there's more than one tab then also show the tabs panel.
if (queuedTabCount > 1) {
showNormalTabs();
}
}
if (!mInitialized || !Intent.ACTION_MAIN.equals(action)) {
return;
}

View File

@ -103,7 +103,7 @@ public class TabQueueHelper {
return tabQueueEnabled && tabsQueued > 0;
}
private static int getTabQueueLength(final Context context) {
public static int getTabQueueLength(final Context context) {
ThreadUtils.assertNotOnUiThread();
// TODO: Use profile shared prefs when bug 1147925 gets fixed.