| 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/browser/chooser_controller/chooser_controller.h" | 7 #include "chrome/browser/chooser_controller/chooser_controller.h" |
| 8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/base/models/table_model.h" | 10 #include "ui/base/models/table_model.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 gfx::Size ChooserContentView::GetPreferredSize() const { | 142 gfx::Size ChooserContentView::GetPreferredSize() const { |
| 143 return gfx::Size(kChooserWidth, kChooserHeight); | 143 return gfx::Size(kChooserWidth, kChooserHeight); |
| 144 } | 144 } |
| 145 | 145 |
| 146 base::string16 ChooserContentView::GetWindowTitle() const { | 146 base::string16 ChooserContentView::GetWindowTitle() const { |
| 147 return chooser_controller_->GetTitle(); | 147 return chooser_controller_->GetTitle(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 base::string16 ChooserContentView::GetDialogButtonLabel( | 150 base::string16 ChooserContentView::GetDialogButtonLabel( |
| 151 ui::DialogButton button) const { | 151 ui::DialogButton button) const { |
| 152 return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK | 152 return button == ui::DIALOG_BUTTON_OK |
| 153 ? IDS_DEVICE_CHOOSER_CONNECT_BUTTON_TEXT | 153 ? chooser_controller_->GetOkButtonLabel() |
| 154 : IDS_DEVICE_CHOOSER_CANCEL_BUTTON_TEXT); | 154 : l10n_util::GetStringUTF16(IDS_DEVICE_CHOOSER_CANCEL_BUTTON_TEXT); |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const { | 157 bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const { |
| 158 return button != ui::DIALOG_BUTTON_OK || | 158 return button != ui::DIALOG_BUTTON_OK || |
| 159 !table_view_->selection_model().empty(); | 159 !table_view_->selection_model().empty(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 views::StyledLabel* ChooserContentView::CreateFootnoteView( | 162 views::StyledLabel* ChooserContentView::CreateFootnoteView( |
| 163 views::StyledLabelListener* listener) const { | 163 views::StyledLabelListener* listener) const { |
| 164 base::string16 link = | 164 base::string16 link = |
| (...skipping 20 matching lines...) Expand all Loading... |
| 185 chooser_controller_->Close(); | 185 chooser_controller_->Close(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void ChooserContentView::StyledLabelLinkClicked() { | 188 void ChooserContentView::StyledLabelLinkClicked() { |
| 189 chooser_controller_->OpenHelpCenterUrl(); | 189 chooser_controller_->OpenHelpCenterUrl(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void ChooserContentView::UpdateTableModel() { | 192 void ChooserContentView::UpdateTableModel() { |
| 193 chooser_table_model_->Update(); | 193 chooser_table_model_->Update(); |
| 194 } | 194 } |
| OLD | NEW |