Bug 1339921 - Clicking the "New Tab" icon from the widget should always show the newly opened tab draft
authorfriedger <friedger@gmail.com>
Sun, 30 Apr 2017 22:58:07 +0200
changeset 570779 7fc1078115dbec0fb849404f08ea5e3030df909c
parent 570775 5278e2a35fc8f2be390243db1e62858bf0982055
child 626566 f9ceeaf325d80f6c830db51d46423dce55fde7fe
push id56573
push userbmo:mail@friedger.de
push dateSun, 30 Apr 2017 21:06:55 +0000
bugs1339921
milestone55.0a1
Bug 1339921 - Clicking the "New Tab" icon from the widget should always show the newly opened tab Add check for open tabs panel when opening url from external app MozReview-Commit-ID: 2HVzZaIa9yl
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -3872,16 +3872,21 @@ public class BrowserApp extends GeckoApp
         final boolean isBookmarkAction = GeckoApp.ACTION_HOMESCREEN_SHORTCUT.equals(action);
         final boolean isTabQueueAction = TabQueueHelper.LOAD_URLS_ACTION.equals(action);
         final boolean isViewMultipleAction = ACTION_VIEW_MULTIPLE.equals(action);
 
         if (mInitialized && (isViewAction || isBookmarkAction)) {
             // Dismiss editing mode if the user is loading a URL from an external app.
             mBrowserToolbar.cancelEdit();
 
+            // Dismiss tabs panel if the user is loading a URL from an external app.
+            if (areTabsShown()) {
+                mTabsPanel.hide();
+            }
+
             // Hide firstrun-pane if the user is loading a URL from an external app.
             hideFirstrunPager(TelemetryContract.Method.NONE);
 
             if (isBookmarkAction) {
                 // GeckoApp.ACTION_HOMESCREEN_SHORTCUT means we're opening a bookmark that
                 // was added to Android's homescreen.
                 Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.HOMESCREEN);
             }