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

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: initialize pointer to be nullptr 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..35b450673e9fd6e56ef458953ebd002ed8ac7001 100644
--- a/chrome/browser/ui/views/chooser_content_view.cc
+++ b/chrome/browser/ui/views/chooser_content_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/chooser_content_view.h"
+#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"
#include "chrome/grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -86,6 +87,10 @@ ChooserContentView::ChooserContentView(
views::StyledLabel::RangeStyleInfo::CreateForLink());
turn_adapter_off_help_->SetVisible(false);
AddChildView(turn_adapter_off_help_);
+ footnote_link_ = base::MakeUnique<views::StyledLabel>(help_text_, this);
+ footnote_link_->set_owned_by_client();
+ footnote_link_->AddStyleRange(
+ help_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink());
}
ChooserContentView::~ChooserContentView() {
@@ -251,7 +256,7 @@ void ChooserContentView::StyledLabelLinkClicked(views::StyledLabel* label,
int event_flags) {
if (label == turn_adapter_off_help_) {
chooser_controller_->OpenAdapterOffHelpUrl();
- } else if (label == footnote_link_) {
+ } else if (label == footnote_link_.get()) {
if (range == help_text_range_)
chooser_controller_->OpenHelpCenterUrl();
else if (range == re_scan_text_range_)
@@ -279,13 +284,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());
}
« no previous file with comments | « chrome/browser/ui/views/chooser_content_view.h ('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