mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 949216 - Handle toolbar's back press all in onBackPressed() (r=wesj)
This commit is contained in:
parent
945c458c98
commit
bc8555362f
@ -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;
|
||||
}
|
||||
|
||||
|
@ -370,6 +370,11 @@ public class BrowserToolbar extends GeckoRelativeLayout
|
||||
}
|
||||
|
||||
public boolean onBackPressed() {
|
||||
if (isEditing()) {
|
||||
stopEditing();
|
||||
return true;
|
||||
}
|
||||
|
||||
return mUrlDisplayLayout.dismissSiteIdentityPopup();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user