Bug 1227538 - Reset site identity after entering new URL. r=margaret
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 07 Jun 2016 16:54:13 +0200
changeset 326361 b240666f8af8cd36887c3b312a41045ab8882f88
parent 326360 6bbfe13ae5981d877f72b1d1fda6031d432ca62f
child 326362 63b15ddaadae76e75d262878926b37fc989e9a85
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs1227538
milestone50.0a1
Bug 1227538 - Reset site identity after entering new URL. r=margaret MozReview-Commit-ID: oOPYDUPVq9
mobile/android/base/java/org/mozilla/gecko/Tab.java
mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
--- a/mobile/android/base/java/org/mozilla/gecko/Tab.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Tab.java
@@ -300,16 +300,23 @@ public class Tab {
     public boolean hasOpenSearch() {
         return mHasOpenSearch;
     }
 
     public SiteIdentity getSiteIdentity() {
         return mSiteIdentity;
     }
 
+    public void resetSiteIdentity() {
+        if (mSiteIdentity != null) {
+            mSiteIdentity.reset();
+            Tabs.getInstance().notifyListeners(this, Tabs.TabEvents.SECURITY_CHANGE);
+        }
+    }
+
     public SiteLogins getSiteLogins() {
         return mSiteLogins;
     }
 
     public boolean isBookmark() {
         return mBookmark;
     }
 
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/BrowserToolbar.java
@@ -10,16 +10,17 @@ import java.util.EnumSet;
 import java.util.List;
 
 import android.support.annotation.Nullable;
 import android.support.v4.content.ContextCompat;
 import org.mozilla.gecko.AppConstants.Versions;
 import org.mozilla.gecko.BrowserApp;
 import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.R;
+import org.mozilla.gecko.SiteIdentity;
 import org.mozilla.gecko.Tab;
 import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.TouchEventInterceptor;
 import org.mozilla.gecko.animation.PropertyAnimator;
 import org.mozilla.gecko.animation.PropertyAnimator.PropertyAnimationListener;
 import org.mozilla.gecko.animation.ViewHelper;
@@ -799,16 +800,21 @@ public abstract class BrowserToolbar ext
     }
 
     /**
      * Exits edit mode, updating the toolbar title with the url that was just entered.
      *
      * @return the url that was entered
      */
     public String commitEdit() {
+        Tab tab = Tabs.getInstance().getSelectedTab();
+        if (tab != null) {
+            tab.resetSiteIdentity();
+        }
+
         final String url = stopEditing();
         if (!TextUtils.isEmpty(url)) {
             setTitle(url);
         }
         return url;
     }
 
     private String stopEditing() {