Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1020)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectionDelegate.java

Issue 2361163004: [Downloads UI] Fix selection toggle for updated items (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectionDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectionDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectionDelegate.java
index a0b8b66248afe0c78ad0d1d201554331e9859618..d718fc7c2822c9714275a5fb6025701ed60e5838 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectionDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectionDelegate.java
@@ -34,25 +34,25 @@ public class SelectionDelegate<E> {
/**
* Toggles the selected state for the given item.
- * @param itemId The id of the item to toggle.
+ * @param item The item to toggle.
* @return Whether the item is selected.
*/
- public boolean toggleSelectionForItem(E itemId) {
- if (mSelectedItems.contains(itemId)) mSelectedItems.remove(itemId);
- else mSelectedItems.add(itemId);
+ public boolean toggleSelectionForItem(E item) {
+ if (mSelectedItems.contains(item)) mSelectedItems.remove(item);
+ else mSelectedItems.add(item);
notifyObservers();
- return isItemSelected(itemId);
+ return isItemSelected(item);
}
/**
- * True if the bookmark is selected. False otherwise.
- * @param itemId The id of the item.
+ * True if the item is selected. False otherwise.
+ * @param item The item.
* @return Whether the item is selected.
*/
- public boolean isItemSelected(E itemId) {
- return mSelectedItems.contains(itemId);
+ public boolean isItemSelected(E item) {
+ return mSelectedItems.contains(item);
}
/**
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698