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

Unified Diff: chrome/browser/ui/views/chooser_content_view.cc

Issue 2330593002: Show device connection and paired status in chooser on non-Mac (Closed)
Patch Set: address comments 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/app/generated_resources.grd ('k') | chrome/browser/ui/views/chooser_content_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/chooser_content_view.cc
diff --git a/chrome/browser/ui/views/chooser_content_view.cc b/chrome/browser/ui/views/chooser_content_view.cc
index dc712284f4c4b900d70a6a1f08dbfb969a873857..c4b1ab03922943b32c8225ff36334fe5e45e1a0e 100644
--- a/chrome/browser/ui/views/chooser_content_view.cc
+++ b/chrome/browser/ui/views/chooser_content_view.cc
@@ -8,7 +8,10 @@
#include "chrome/grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/color_palette.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/gfx/paint_vector_icon.h"
+#include "ui/gfx/vector_icons_public.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/views/controls/link.h"
#include "ui/views/controls/styled_label.h"
@@ -88,7 +91,12 @@ base::string16 ChooserContentView::GetText(int row, int column_id) {
DCHECK_GE(row, 0);
DCHECK_LT(row, num_options);
- return chooser_controller_->GetOption(static_cast<size_t>(row));
+ base::string16 text =
+ chooser_controller_->GetOption(static_cast<size_t>(row));
+ return chooser_controller_->IsPaired(row)
+ ? l10n_util::GetStringFUTF16(
+ IDS_DEVICE_CHOOSER_DEVICE_NAME_AND_PAIRED_STATUS_TEXT, text)
+ : text;
}
void ChooserContentView::SetObserver(ui::TableModelObserver* observer) {}
@@ -105,6 +113,11 @@ gfx::ImageSkia ChooserContentView::GetIcon(int row) {
DCHECK_GE(row, 0);
DCHECK_LT(row, base::checked_cast<int>(num_options));
+ if (chooser_controller_->IsConnected(row)) {
+ return gfx::CreateVectorIcon(gfx::VectorIconId::BLUETOOTH_CONNECTED,
+ gfx::kChromeIconGrey);
+ }
+
int level = chooser_controller_->GetSignalStrengthLevel(row);
if (level == -1)
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/views/chooser_content_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698