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

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

Issue 1653533002: bluetooth: Change the status of the chooser once discovery has ended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Improve test and add new test Created 4 years, 11 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/BluetoothChooserDialog.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java
index 0d551b645d004a505e1db173cb8436fdadaa5054..29d4d96ce2eb65e943c2998e3bce8a7127862c65 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/BluetoothChooserDialog.java
@@ -115,15 +115,20 @@ public class BluetoothChooserDialog
String searching = mContext.getString(R.string.bluetooth_searching);
String positiveButton = mContext.getString(R.string.bluetooth_confirm_button);
- SpannableString status = SpanApplier.applySpans(
+ SpannableString statusActive = SpanApplier.applySpans(
mContext.getString(R.string.bluetooth_not_seeing_it),
+ new SpanInfo("<link>", "</link>",
+ new NoUnderlineClickableSpan(LinkType.EXPLAIN_BLUETOOTH, mContext)));
+
+ SpannableString statusIdle = SpanApplier.applySpans(
+ mContext.getString(R.string.bluetooth_not_seeing_it_idle),
new SpanInfo("<link1>", "</link1>",
- new NoUnderlineClickableSpan(LinkType.RESTART_SEARCH, mContext)),
+ new NoUnderlineClickableSpan(LinkType.EXPLAIN_BLUETOOTH, mContext)),
new SpanInfo("<link2>", "</link2>",
- new NoUnderlineClickableSpan(LinkType.EXPLAIN_BLUETOOTH, mContext)));
+ new NoUnderlineClickableSpan(LinkType.RESTART_SEARCH, mContext)));
ItemChooserDialog.ItemChooserLabels labels = new ItemChooserDialog.ItemChooserLabels(
- title, searching, noneFound, status, positiveButton);
+ title, searching, noneFound, statusActive, statusIdle, positiveButton);
mItemChooserDialog = new ItemChooserDialog(mContext, this, labels);
}
@@ -281,7 +286,7 @@ public class BluetoothChooserDialog
List<ItemChooserDialog.ItemChooserRow> devices =
new ArrayList<ItemChooserDialog.ItemChooserRow>();
devices.add(new ItemChooserDialog.ItemChooserRow(deviceId, deviceName));
- mItemChooserDialog.showList(devices);
+ mItemChooserDialog.addItemsToList(devices);
}
@CalledByNative
@@ -319,13 +324,7 @@ public class BluetoothChooserDialog
break;
}
case DISCOVERY_IDLE: {
- // If devices have been discovered already, sending an update to the
- // chooser does nothing. Otherwise, if no devices have been discovered,
- // sending and update to the chooser results in the "noneFound" label
- // being shown.
- List<ItemChooserDialog.ItemChooserRow> devices =
- new ArrayList<ItemChooserDialog.ItemChooserRow>();
- mItemChooserDialog.showList(devices);
+ mItemChooserDialog.discoveryIdle();
break;
}
default: {

Powered by Google App Engine
This is Rietveld 408576698