Chromium Code Reviews| 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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
| 9 #include "chrome/grit/generated_resources.h" | 9 #include "chrome/grit/generated_resources.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 return button == ui::DIALOG_BUTTON_OK | 277 return button == ui::DIALOG_BUTTON_OK |
| 278 ? chooser_controller_->GetOkButtonLabel() | 278 ? chooser_controller_->GetOkButtonLabel() |
| 279 : l10n_util::GetStringUTF16(IDS_DEVICE_CHOOSER_CANCEL_BUTTON_TEXT); | 279 : l10n_util::GetStringUTF16(IDS_DEVICE_CHOOSER_CANCEL_BUTTON_TEXT); |
| 280 } | 280 } |
| 281 | 281 |
| 282 bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const { | 282 bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const { |
| 283 return button != ui::DIALOG_BUTTON_OK || | 283 return button != ui::DIALOG_BUTTON_OK || |
| 284 !table_view_->selection_model().empty(); | 284 !table_view_->selection_model().empty(); |
| 285 } | 285 } |
| 286 | 286 |
| 287 views::StyledLabel* ChooserContentView::footnote_link() { | |
| 288 if (chooser_controller_->ShouldShowFootnoteView()) | |
|
sky
2016/11/28 23:13:21
Can ShouldShowFootnoteView change value? Assuming
juncai
2016/11/29 18:10:08
Done.
| |
| 289 return footnote_link_.get(); | |
| 290 return nullptr; | |
| 291 } | |
| 292 | |
| 287 void ChooserContentView::Accept() { | 293 void ChooserContentView::Accept() { |
| 288 std::vector<size_t> indices( | 294 std::vector<size_t> indices( |
| 289 table_view_->selection_model().selected_indices().begin(), | 295 table_view_->selection_model().selected_indices().begin(), |
| 290 table_view_->selection_model().selected_indices().end()); | 296 table_view_->selection_model().selected_indices().end()); |
| 291 chooser_controller_->Select(indices); | 297 chooser_controller_->Select(indices); |
| 292 } | 298 } |
| 293 | 299 |
| 294 void ChooserContentView::Cancel() { | 300 void ChooserContentView::Cancel() { |
| 295 chooser_controller_->Cancel(); | 301 chooser_controller_->Cancel(); |
| 296 } | 302 } |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 308 } | 314 } |
| 309 } | 315 } |
| 310 | 316 |
| 311 void ChooserContentView::SetGetHelpAndReScanLink() { | 317 void ChooserContentView::SetGetHelpAndReScanLink() { |
| 312 footnote_link_->SetText(help_and_re_scan_text_); | 318 footnote_link_->SetText(help_and_re_scan_text_); |
| 313 footnote_link_->AddStyleRange( | 319 footnote_link_->AddStyleRange( |
| 314 help_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink()); | 320 help_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink()); |
| 315 footnote_link_->AddStyleRange( | 321 footnote_link_->AddStyleRange( |
| 316 re_scan_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink()); | 322 re_scan_text_range_, views::StyledLabel::RangeStyleInfo::CreateForLink()); |
| 317 } | 323 } |
| OLD | NEW |