diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index fa3710b88031..6b9d9aa11c1c 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -488,7 +488,7 @@ abstract public class BrowserApp extends GeckoApp mBrowserToolbar.setOnDismissListener(new BrowserToolbar.OnDismissListener() { public void onDismiss() { - dismissEditingMode(); + mBrowserToolbar.cancelEdit(); } }); @@ -610,10 +610,6 @@ abstract public class BrowserApp extends GeckoApp return; } - if (dismissEditingMode()) { - return; - } - if (mBrowserToolbar.onBackPressed()) { return; } @@ -1574,16 +1570,6 @@ abstract public class BrowserApp extends GeckoApp } } - private boolean dismissEditingMode() { - if (!mBrowserToolbar.isEditing()) { - return false; - } - - mBrowserToolbar.cancelEdit(); - - return true; - } - void filterEditingMode(String searchTerm, AutocompleteHandler handler) { if (TextUtils.isEmpty(searchTerm)) { hideBrowserSearch(); @@ -2400,7 +2386,7 @@ abstract public class BrowserApp extends GeckoApp // Dismiss editing mode if the user is loading a URL from an external app. if (Intent.ACTION_VIEW.equals(action)) { - dismissEditingMode(); + mBrowserToolbar.cancelEdit(); return; } diff --git a/mobile/android/base/toolbar/BrowserToolbar.java b/mobile/android/base/toolbar/BrowserToolbar.java index ce7d988ef37f..e81ce1cf61bd 100644 --- a/mobile/android/base/toolbar/BrowserToolbar.java +++ b/mobile/android/base/toolbar/BrowserToolbar.java @@ -370,6 +370,11 @@ public class BrowserToolbar extends GeckoRelativeLayout } public boolean onBackPressed() { + if (isEditing()) { + stopEditing(); + return true; + } + return mUrlDisplayLayout.dismissSiteIdentityPopup(); }