| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 ChooserContentView::~ChooserContentView() { | 137 ChooserContentView::~ChooserContentView() { |
| 138 table_view_->SetModel(nullptr); | 138 table_view_->SetModel(nullptr); |
| 139 chooser_table_model_->SetObserver(nullptr); | 139 chooser_table_model_->SetObserver(nullptr); |
| 140 } | 140 } |
| 141 | 141 |
| 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 { |
| 147 return chooser_controller_->GetTitle(); |
| 148 } |
| 149 |
| 146 base::string16 ChooserContentView::GetDialogButtonLabel( | 150 base::string16 ChooserContentView::GetDialogButtonLabel( |
| 147 ui::DialogButton button) const { | 151 ui::DialogButton button) const { |
| 148 return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK | 152 return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK |
| 149 ? IDS_DEVICE_CHOOSER_CONNECT_BUTTON_TEXT | 153 ? IDS_DEVICE_CHOOSER_CONNECT_BUTTON_TEXT |
| 150 : IDS_DEVICE_CHOOSER_CANCEL_BUTTON_TEXT); | 154 : IDS_DEVICE_CHOOSER_CANCEL_BUTTON_TEXT); |
| 151 } | 155 } |
| 152 | 156 |
| 153 bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const { | 157 bool ChooserContentView::IsDialogButtonEnabled(ui::DialogButton button) const { |
| 154 return button != ui::DIALOG_BUTTON_OK || | 158 return button != ui::DIALOG_BUTTON_OK || |
| 155 !table_view_->selection_model().empty(); | 159 !table_view_->selection_model().empty(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 181 chooser_controller_->Close(); | 185 chooser_controller_->Close(); |
| 182 } | 186 } |
| 183 | 187 |
| 184 void ChooserContentView::StyledLabelLinkClicked() { | 188 void ChooserContentView::StyledLabelLinkClicked() { |
| 185 chooser_controller_->OpenHelpCenterUrl(); | 189 chooser_controller_->OpenHelpCenterUrl(); |
| 186 } | 190 } |
| 187 | 191 |
| 188 void ChooserContentView::UpdateTableModel() { | 192 void ChooserContentView::UpdateTableModel() { |
| 189 chooser_table_model_->Update(); | 193 chooser_table_model_->Update(); |
| 190 } | 194 } |
| OLD | NEW |