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 "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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 table_view_->SetVisible(true); | 91 table_view_->SetVisible(true); |
| 92 throbber_->SetVisible(false); | 92 throbber_->SetVisible(false); |
| 93 throbber_->Stop(); | 93 throbber_->Stop(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void ChooserContentView::OnOptionRemoved(size_t index) { | 96 void ChooserContentView::OnOptionRemoved(size_t index) { |
| 97 table_view_->OnItemsRemoved(static_cast<int>(index), 1); | 97 table_view_->OnItemsRemoved(static_cast<int>(index), 1); |
| 98 UpdateTableView(); | 98 UpdateTableView(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void ChooserContentView::OnOptionUpdated(size_t index) { | |
| 102 table_view_->OnItemsChanged(static_cast<int>(index), 1); | |
|
msw
2016/08/12 22:19:34
nit q: can you use or [D]CHECK something from base
juncai
2016/08/15 18:11:19
Done.
| |
| 103 UpdateTableView(); | |
| 104 } | |
| 105 | |
| 101 void ChooserContentView::OnAdapterEnabledChanged(bool enabled) { | 106 void ChooserContentView::OnAdapterEnabledChanged(bool enabled) { |
| 102 // No row is selected since the adapter status has changed. | 107 // No row is selected since the adapter status has changed. |
| 103 // This will also disable the OK button if it was enabled because | 108 // This will also disable the OK button if it was enabled because |
| 104 // of a previously selected row. | 109 // of a previously selected row. |
| 105 table_view_->Select(-1); | 110 table_view_->Select(-1); |
| 106 UpdateTableView(); | 111 UpdateTableView(); |
| 107 table_view_->SetVisible(true); | 112 table_view_->SetVisible(true); |
| 108 | 113 |
| 109 throbber_->Stop(); | 114 throbber_->Stop(); |
| 110 throbber_->SetVisible(false); | 115 throbber_->SetVisible(false); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 } | 207 } |
| 203 | 208 |
| 204 void ChooserContentView::UpdateTableView() { | 209 void ChooserContentView::UpdateTableView() { |
| 205 if (chooser_controller_->NumOptions() == 0) { | 210 if (chooser_controller_->NumOptions() == 0) { |
| 206 table_view_->OnModelChanged(); | 211 table_view_->OnModelChanged(); |
| 207 table_view_->SetEnabled(false); | 212 table_view_->SetEnabled(false); |
| 208 } else { | 213 } else { |
| 209 table_view_->SetEnabled(true); | 214 table_view_->SetEnabled(true); |
| 210 } | 215 } |
| 211 } | 216 } |
| OLD | NEW |