Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java |
| index 2eb056a180a8b87f7545016f5e3968e9b01bb12b..66d801f41a64ad3f21c6fafb9d8702012fa12bcd 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryItemView.java |
| @@ -122,6 +122,19 @@ public class HistoryItemView extends SelectableItemView<HistoryItem> implements |
| updateRemoveButtonVisibility(); |
| } |
| + /** |
| + * @param enabled Whether the remove button should be enabled. |
| + */ |
| + public void setRemoveButtonEnabled(boolean enabled) { |
| + // If the remove button is not enabled, its draw color will be the same as the background |
| + // making it invisible, and it will not respond to touch events. |
| + // Calling #setClickable(false) ensures that the parent view will receive the touch event |
| + // instead. This is preferred to removing the item so that the rest of text in the |
| + // HistoryItemView doesn't expand to fill the space the remove icon occupies. |
| + mRemoveButton.setEnabled(enabled); |
| + mRemoveButton.setClickable(enabled); |
|
gone
2017/01/13 18:27:47
Would setting the button's visibility to INVISIBLE
Theresa
2017/01/13 19:40:28
Yes, done.
|
| + } |
| + |
| @Override |
| protected void onClick() { |
| if (getItem() != null) getItem().open(); |