Bug 1399388 - Only when new page is exactly 'about:home' will be treated as default home page. r=sdaswani
authorNevin Chen <cnevinchen@gmail.com>
Tue, 03 Apr 2018 18:45:48 +0300
changeset 412745 34bc360b2860f9cb3bbd84b9a74696441cfeeb38
parent 412744 6a08a924965023280eef73ee94ced91a30482575
child 412746 afc5b713ca78ac3cf84d2fe4c04ffaddeafc983b
push id33818
push userapavel@mozilla.com
push dateWed, 11 Apr 2018 14:36:40 +0000
treeherdermozilla-central@cfe6399e142c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssdaswani
bugs1399388
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1399388 - Only when new page is exactly 'about:home' will be treated as default home page. r=sdaswani
mobile/android/base/java/org/mozilla/gecko/AboutPages.java
mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/AboutPages.java
+++ b/mobile/android/base/java/org/mozilla/gecko/AboutPages.java
@@ -34,16 +34,23 @@ public class AboutPages {
         return url != null && url.startsWith("about:");
     }
 
     public static final boolean isTitlelessAboutPage(final String url) {
         return isAboutHome(url) ||
                PRIVATEBROWSING.equals(url);
     }
 
+    public static final boolean isDefaultHomePage(final String url) {
+        if (url == null) {
+            return false;
+        }
+        return HOME.equals(url);
+    }
+
     public static final boolean isAboutHome(final String url) {
         if (url == null || !url.startsWith(HOME)) {
             return false;
         }
         // We sometimes append a parameter to "about:home" to specify which page to
         // show when we open the home pager. Discard this parameter when checking
         // whether or not this URL is "about:home".
         return HOME.equals(url.split("\\?")[0]);
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -1461,17 +1461,17 @@ public abstract class GeckoApp extends G
         mWasFirstTabShownAfterActivityUnhidden = true; // Reset since we'll be loading a tab.
 
         final SafeIntent intent = new SafeIntent(getIntent());
         final String action = intent.getAction();
 
         final String passedUri = getIntentURI(intent);
 
         final boolean intentHasURL = passedUri != null;
-        final boolean isAboutHomeURL = intentHasURL && AboutPages.isAboutHome(passedUri);
+        final boolean isAboutHomeURL = intentHasURL && AboutPages.isDefaultHomePage(passedUri);
         final boolean isAssistIntent = Intent.ACTION_ASSIST.equals(action);
         final boolean needsNewForegroundTab = intentHasURL || isAssistIntent;
 
         // Start migrating as early as possible, can do this in
         // parallel with Gecko load.
         checkMigrateProfile();
 
         initializeChrome();