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

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

Issue 2390823005: Update device permissions dialog ui for Chrome apps and extensions (Closed)
Patch Set: address more comments 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 6f2b87b15e59c71315ffe62087ab934075204525..1c05f1b809469d98719363810dfa41c94ac69a85 100644
--- a/chrome/browser/ui/views/chooser_content_view.cc
+++ b/chrome/browser/ui/views/chooser_content_view.cc
@@ -87,10 +87,6 @@ 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() {
@@ -210,6 +206,7 @@ void ChooserContentView::OnAdapterEnabledChanged(bool enabled) {
if (enabled) {
SetGetHelpAndReScanLink();
} else {
+ DCHECK(footnote_link_);
footnote_link_->SetText(help_text_);
footnote_link_->AddStyleRange(
help_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink());
@@ -240,6 +237,7 @@ void ChooserContentView::OnRefreshStateChanged(bool refreshing) {
throbber_->Stop();
if (refreshing) {
+ DCHECK(footnote_link_);
footnote_link_->SetText(help_and_scanning_text_);
footnote_link_->AddStyleRange(
help_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink());
@@ -284,6 +282,17 @@ bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const {
!table_view_->selection_model().empty();
}
+views::StyledLabel* ChooserContentView::footnote_link() {
+ if (chooser_controller_->ShouldShowFootnoteView()) {
+ 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());
+ }
+
+ return footnote_link_.get();
+}
+
void ChooserContentView::Accept() {
std::vector<size_t> indices(
table_view_->selection_model().selected_indices().begin(),
@@ -309,6 +318,7 @@ void ChooserContentView::UpdateTableView() {
}
void ChooserContentView::SetGetHelpAndReScanLink() {
+ DCHECK(footnote_link_);
footnote_link_->SetText(help_and_re_scan_text_);
footnote_link_->AddStyleRange(
help_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink());
« no previous file with comments | « chrome/browser/ui/views/chooser_content_view.h ('k') | chrome/browser/ui/views/extensions/chooser_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698