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

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

Issue 2175613004: Add code back to change the status of WebBluetooth chooser once discovery is complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added code back to change the status of WebBluetooth chooser once discovery is complete Created 4 years, 5 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 7665630755ad453ecb116c84a02ba4e1fd2031e8..d8e5c8f87c560fe5bbe1a63960b6cba7b8d025e3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ItemChooserDialog.java
@@ -95,6 +95,9 @@ public class ItemChooserDialog {
public final CharSequence searching;
// The message to show when no results were produced.
public final CharSequence noneFound;
+ // A status message to show above the button row after an item has
+ // been added and discovery is still ongoing.
+ public final CharSequence statusActive;
// A status message to show above the button row after discovery has
// stopped and no devices have been found.
public final CharSequence statusIdleNoneFound;
@@ -105,11 +108,12 @@ public class ItemChooserDialog {
public final CharSequence positiveButton;
public ItemChooserLabels(CharSequence title, CharSequence searching, CharSequence noneFound,
- CharSequence statusIdleNoneFound, CharSequence statusIdleSomeFound,
- CharSequence positiveButton) {
+ CharSequence statusActive, CharSequence statusIdleNoneFound,
+ CharSequence statusIdleSomeFound, CharSequence positiveButton) {
this.title = title;
this.searching = searching;
this.noneFound = noneFound;
+ this.statusActive = statusActive;
this.statusIdleNoneFound = statusIdleNoneFound;
this.statusIdleSomeFound = statusIdleSomeFound;
this.positiveButton = positiveButton;
@@ -119,7 +123,7 @@ public class ItemChooserDialog {
/**
* The various states the dialog can represent.
*/
- private enum State { STARTING, DISCOVERY_IDLE }
+ private enum State { STARTING, PROGRESS_UPDATE_AVAILABLE, DISCOVERY_IDLE }
/**
* An adapter for keeping track of which items to show in the dialog.
@@ -415,7 +419,7 @@ public class ItemChooserDialog {
public void addItemToList(ItemChooserRow item) {
mProgressBar.setVisibility(View.GONE);
mItemAdapter.add(item);
- setState(State.DISCOVERY_IDLE);
+ setState(State.PROGRESS_UPDATE_AVAILABLE);
}
/**
@@ -472,6 +476,11 @@ public class ItemChooserDialog {
mProgressBar.setVisibility(View.VISIBLE);
mEmptyMessage.setVisibility(View.GONE);
break;
+ case PROGRESS_UPDATE_AVAILABLE:
+ mStatus.setText(mLabels.statusActive);
+ mProgressBar.setVisibility(View.GONE);
+ mListView.setVisibility(View.VISIBLE);
+ break;
case DISCOVERY_IDLE:
boolean showEmptyMessage = mItemAdapter.isEmpty();
mStatus.setText(showEmptyMessage

Powered by Google App Engine
This is Rietveld 408576698