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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java

Issue 1739523002: WebUsb Android chooser UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 9 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
Index: chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
index 89c697f81a768824426ea363e0cfd0b9fdfdf8f6..69fbbcae936982685a6e1f839a515bd2c5f81119 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
@@ -368,6 +368,28 @@ public class ItemChooserDialog {
}
Finnur 2016/03/14 11:36:50 Hmm... I just discovered that the only (previous)
juncai 2016/03/16 00:40:35 Done.
/**
+ * Add an item to the end of the list to show in the dialog.
+ *
+ * @param item The item to be added to the end of the chooser.
+ */
+ public void addItemToList(ItemChooserRow item) {
+ mProgressBar.setVisibility(View.GONE);
+ mItemAdapter.add(item);
+ setState(State.DISCOVERY_IDLE);
+ }
+
+ /**
+ * Remove an item that is shown in the dialog.
+ *
+ * @param item The item to be removed in the chooser.
+ */
+ public void removeItemFromList(ItemChooserRow item) {
+ mProgressBar.setVisibility(View.GONE);
Finnur 2016/03/14 11:36:50 Why is this necessary?
juncai 2016/03/16 00:40:35 Removed. Done.
+ mItemAdapter.remove(item);
+ setState(State.DISCOVERY_IDLE);
Finnur 2016/03/14 11:36:50 What does the dialog look like if you add one item
juncai 2016/03/16 00:40:35 It shows "No devices found.".
+ }
Finnur 2016/03/14 11:36:49 These new API functions need to be tested in ItemC
juncai 2016/03/16 00:40:35 Done.
+
+ /**
* Indicates the chooser that no more items will be added.
*/
public void setIdleState() {

Powered by Google App Engine
This is Rietveld 408576698