| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |