Bug 949216 - Handle toolbar's back press all in onBackPressed() (r=wesj)

This commit is contained in:
Lucas Rocha 2014-01-21 17:54:51 +00:00
parent 945c458c98
commit bc8555362f
2 changed files with 7 additions and 16 deletions

View File

@ -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;
}

View File

@ -370,6 +370,11 @@ public class BrowserToolbar extends GeckoRelativeLayout
}
public boolean onBackPressed() {
if (isEditing()) {
stopEditing();
return true;
}
return mUrlDisplayLayout.dismissSiteIdentityPopup();
}