Commit 842da1ea authored by ankit2.kumar's avatar ankit2.kumar Committed by Commit bot

Added code to dismiss url suggestion popup on back key press.

URL suggestion popup was not dismissing when page was navigating
in back direction. Added code to handle this.

BUG=407070

Review URL: https://codereview.chromium.org/500043002

Cr-Commit-Position: refs/heads/master@{#291890}
parent ac419494
......@@ -140,6 +140,19 @@ public class ChromeShellToolbar extends LinearLayout {
}
}
});
mUrlTextView.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
mUrlTextView.clearFocus();
if (mTab != null) {
mTab.getView().requestFocus();
}
return true;
}
return false;
}
});
mSuggestionPopup = new SuggestionPopup(getContext(), mUrlTextView, this);
mUrlTextView.addTextChangedListener(mSuggestionPopup);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment