Skip to content

Commit d83435a

Browse files
Mugdha LakhaniCommit Bot
Mugdha Lakhani
authored and
Commit Bot
committed
[WebLayer Shell] Clicking on UrlBarView shows EditText.
With this change: https://chromium-review.googlesource.com/c/chromium/src/+/2274888 WebLayerShellActivity exercised the newly added setTextClickListener() method on UrlBarOptions. This set the clicklistener passed in to the UrlBarView's TextView only, which is working as intended. However, the test team would like to retain the ability to click anywhere on the UrlBarView other than the security button and be able to show the editable text view. This change adds that back. I have removed the setTextClickListener() call since two click listeners doing the same thing on the non editable text view is rendundant. Before this change: https://drive.google.com/file/d/16ttRlvh-AqObs4_pA9TiDSRUKVf6bcO-/view?usp=sharing After this change: https://drive.google.com/file/d/1y1vFCd4eObMs8C84862V7zQ53siMMKqJ/view?usp=sharing Bug: 1114238 Change-Id: I98eb4314436dbf7d6509a77e4890d0f348b2eebb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362817 Reviewed-by: Bo <boliu@chromium.org> Commit-Queue: Mugdha Lakhani <nator@chromium.org> Cr-Commit-Position: refs/heads/master@{#799583}
1 parent 2b08317 commit d83435a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

weblayer/shell/android/shell_apk/src/org/chromium/weblayer/shell/WebLayerShellActivity.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,6 @@ public void onTabRemoved(Tab tab) {
382382
.setTextSizeSP(DEFAULT_TEXT_SIZE)
383383
.setTextColor(android.R.color.black)
384384
.setIconColor(android.R.color.black)
385-
.setTextClickListener(v -> {
386-
mEditUrlView.setText("");
387-
mUrlViewContainer.setDisplayedChild(EDITABLE_URL_TEXT_VIEW);
388-
mEditUrlView.requestFocus();
389-
})
390385
.setTextLongClickListener(v -> {
391386
ClipboardManager clipboard =
392387
(ClipboardManager) v.getContext().getSystemService(
@@ -396,6 +391,11 @@ public void onTabRemoved(Tab tab) {
396391
return true;
397392
})
398393
.build());
394+
nonEditUrlView.setOnClickListener(v -> {
395+
mEditUrlView.setText("");
396+
mUrlViewContainer.setDisplayedChild(EDITABLE_URL_TEXT_VIEW);
397+
mEditUrlView.requestFocus();
398+
});
399399
RelativeLayout nonEditUrlViewContainer =
400400
mTopContentsContainer.findViewById(R.id.noneditable_url_view_container);
401401
nonEditUrlViewContainer.addView(nonEditUrlView,

0 commit comments

Comments
 (0)