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

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

Issue 2478863003: Fix the Web Bluetooth chooser when it is used on Chrome apps on non-Mac (Closed)
Patch Set: updated ChooserDialogViewTest Created 4 years, 1 month 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/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 4994e715fd19312182eab62b0a1f09e60bfb414b..2bc73420a5a41e340fb1de3651698aa1d8b55139 100644
--- a/chrome/browser/ui/views/chooser_content_view.cc
+++ b/chrome/browser/ui/views/chooser_content_view.cc
@@ -39,8 +39,10 @@ const int kSignalStrengthLevelImageIds[5] = {IDR_SIGNAL_0_BAR, IDR_SIGNAL_1_BAR,
ChooserContentView::ChooserContentView(
views::TableViewObserver* table_view_observer,
- std::unique_ptr<ChooserController> chooser_controller)
+ std::unique_ptr<ChooserController> chooser_controller,
+ views::StyledLabel* footnote_link)
: chooser_controller_(std::move(chooser_controller)),
+ footnote_link_(footnote_link),
help_text_(l10n_util::GetStringFUTF16(
IDS_DEVICE_CHOOSER_GET_HELP_LINK_WITH_SCANNING_STATUS,
base::string16())),
@@ -86,6 +88,11 @@ ChooserContentView::ChooserContentView(
views::StyledLabel::RangeStyleInfo::CreateForLink());
turn_adapter_off_help_->SetVisible(false);
AddChildView(turn_adapter_off_help_);
+ DCHECK(footnote_link_);
+ footnote_link_->SetText(help_text_);
+ footnote_link_->set_listener(this);
+ footnote_link_->AddStyleRange(
+ help_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink());
}
ChooserContentView::~ChooserContentView() {
@@ -279,13 +286,6 @@ bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const {
!table_view_->selection_model().empty();
}
-views::StyledLabel* ChooserContentView::CreateFootnoteView() {
- footnote_link_ = new views::StyledLabel(help_text_, this);
- footnote_link_->AddStyleRange(
- help_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink());
- return footnote_link_;
-}
-
void ChooserContentView::Accept() {
chooser_controller_->Select(table_view_->selection_model().active());
}

Powered by Google App Engine
This is Rietveld 408576698