зеркало из https://github.com/mozilla/gecko-dev.git
Bug 997996 - Make ToolbarComponent.dismissEditingMode use the cancel editing mode button. r=mcomella
This commit is contained in:
Родитель
7a88b6f747
Коммит
058e3a8dc1
|
@ -86,6 +86,13 @@ public class ToolbarComponent extends BaseComponent {
|
|||
return (ImageButton) getToolbarView().findViewById(R.id.forward);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the View for the edit cancel button in the browser toolbar.
|
||||
*/
|
||||
private ImageButton getEditCancelButton() {
|
||||
return (ImageButton) getToolbarView().findViewById(R.id.edit_cancel);
|
||||
}
|
||||
|
||||
private CharSequence getTitle() {
|
||||
return getTitleHelper(true);
|
||||
}
|
||||
|
@ -145,14 +152,19 @@ public class ToolbarComponent extends BaseComponent {
|
|||
public ToolbarComponent dismissEditingMode() {
|
||||
assertIsEditing();
|
||||
|
||||
if (getUrlEditText().isInputMethodTarget()) {
|
||||
// Drop the soft keyboard.
|
||||
// TODO: Solo.hideSoftKeyboard() does not clear focus, causing unexpected
|
||||
// behavior, but we may want to use it over goBack().
|
||||
mSolo.goBack();
|
||||
}
|
||||
// Cancel Button not implemeneted in tablet.
|
||||
if (DeviceHelper.isTablet()) {
|
||||
if (getUrlEditText().isInputMethodTarget()) {
|
||||
// Drop the soft keyboard.
|
||||
// TODO: Solo.hideSoftKeyboard() does not clear focus, causing unexpected
|
||||
// behavior, but we may want to use it over goBack().
|
||||
mSolo.goBack();
|
||||
}
|
||||
|
||||
mSolo.goBack();
|
||||
mSolo.goBack();
|
||||
} else {
|
||||
mSolo.clickOnView(getEditCancelButton());
|
||||
}
|
||||
|
||||
waitForNotEditing();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче