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

Side by Side Diff: chrome/browser/ui/views/chooser_content_view.cc

Issue 2200193004: Support multiple lines for status text on Chooser UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/window/dialog_client_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/chooser_content_view.h" 5 #include "chrome/browser/ui/views/chooser_content_view.h"
6 6
7 #include "chrome/grit/generated_resources.h" 7 #include "chrome/grit/generated_resources.h"
8 #include "ui/base/l10n/l10n_util.h" 8 #include "ui/base/l10n/l10n_util.h"
9 #include "ui/views/controls/link.h" 9 #include "ui/views/controls/link.h"
10 #include "ui/views/controls/styled_label.h" 10 #include "ui/views/controls/styled_label.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const { 163 bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const {
164 return button != ui::DIALOG_BUTTON_OK || 164 return button != ui::DIALOG_BUTTON_OK ||
165 !table_view_->selection_model().empty(); 165 !table_view_->selection_model().empty();
166 } 166 }
167 167
168 views::Link* ChooserContentView::CreateExtraView() { 168 views::Link* ChooserContentView::CreateExtraView() {
169 discovery_state_ = new views::Link(chooser_controller_->GetStatus()); 169 discovery_state_ = new views::Link(chooser_controller_->GetStatus());
170 discovery_state_->SetHandlesTooltips(false); 170 discovery_state_->SetHandlesTooltips(false);
171 discovery_state_->SetUnderline(false); 171 discovery_state_->SetUnderline(false);
172 discovery_state_->SetMultiLine(true);
173 discovery_state_->SizeToFit(kChooserWidth / 2);
174 discovery_state_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
172 discovery_state_->set_listener(this); 175 discovery_state_->set_listener(this);
173 return discovery_state_; 176 return discovery_state_;
174 } 177 }
175 178
176 views::StyledLabel* ChooserContentView::CreateFootnoteView() { 179 views::StyledLabel* ChooserContentView::CreateFootnoteView() {
177 base::string16 link = 180 base::string16 link =
178 l10n_util::GetStringUTF16(IDS_DEVICE_CHOOSER_GET_HELP_LINK_TEXT); 181 l10n_util::GetStringUTF16(IDS_DEVICE_CHOOSER_GET_HELP_LINK_TEXT);
179 size_t offset = 0; 182 size_t offset = 0;
180 base::string16 text = l10n_util::GetStringFUTF16( 183 base::string16 text = l10n_util::GetStringFUTF16(
181 IDS_DEVICE_CHOOSER_FOOTNOTE_TEXT, link, &offset); 184 IDS_DEVICE_CHOOSER_FOOTNOTE_TEXT, link, &offset);
(...skipping 17 matching lines...) Expand all
199 } 202 }
200 203
201 void ChooserContentView::UpdateTableView() { 204 void ChooserContentView::UpdateTableView() {
202 if (chooser_controller_->NumOptions() == 0) { 205 if (chooser_controller_->NumOptions() == 0) {
203 table_view_->OnModelChanged(); 206 table_view_->OnModelChanged();
204 table_view_->SetEnabled(false); 207 table_view_->SetEnabled(false);
205 } else { 208 } else {
206 table_view_->SetEnabled(true); 209 table_view_->SetEnabled(true);
207 } 210 }
208 } 211 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/window/dialog_client_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698