Bug 1339919 - 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 570780 0785bc425745f795a2434a51e50f23b90ae5ac59
parent 570775 5278e2a35fc8f2be390243db1e62858bf0982055
child 626567 b7f6157411e0d16d4b74dccdc6d04cbf04190431
push id56574
push userbmo:mail@friedger.de
push dateSun, 30 Apr 2017 21:14:45 +0000
bugs1339919
milestone55.0a1
Bug 1339919 - 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: LyYNqm7Snl2
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);
             }