OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/options/exceptions_page_view.h" | 5 #include "chrome/browser/views/options/exceptions_page_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 if (observer_) | 70 if (observer_) |
71 observer_->OnModelChanged(); | 71 observer_->OnModelChanged(); |
72 if (row_count_observer_) | 72 if (row_count_observer_) |
73 row_count_observer_->OnRowCountChanged(RowCount()); | 73 row_count_observer_->OnRowCountChanged(RowCount()); |
74 } | 74 } |
75 | 75 |
76 /////////////////////////////////////////////////////////////////////////////// | 76 /////////////////////////////////////////////////////////////////////////////// |
77 // ExceptionsPageView, public | 77 // ExceptionsPageView, public |
78 ExceptionsPageView::ExceptionsPageView(Profile* profile) | 78 ExceptionsPageView::ExceptionsPageView(Profile* profile) |
79 : OptionsPageView(profile), | 79 : OptionsPageView(profile), |
80 remove_button_(this, l10n_util::GetString( | 80 ALLOW_THIS_IN_INITIALIZER_LIST(remove_button_( |
81 IDS_EXCEPTIONS_PAGE_VIEW_REMOVE_BUTTON)), | 81 this, |
82 remove_all_button_(this, l10n_util::GetString( | 82 l10n_util::GetString(IDS_EXCEPTIONS_PAGE_VIEW_REMOVE_BUTTON))), |
83 IDS_EXCEPTIONS_PAGE_VIEW_REMOVE_ALL_BUTTON)), | 83 ALLOW_THIS_IN_INITIALIZER_LIST(remove_all_button_( |
| 84 this, |
| 85 l10n_util::GetString(IDS_EXCEPTIONS_PAGE_VIEW_REMOVE_ALL_BUTTON))), |
84 table_model_(profile), | 86 table_model_(profile), |
85 table_view_(NULL) { | 87 table_view_(NULL) { |
86 } | 88 } |
87 | 89 |
88 void ExceptionsPageView::OnSelectionChanged() { | 90 void ExceptionsPageView::OnSelectionChanged() { |
89 bool has_selection = table_view_->SelectedRowCount() > 0; | 91 bool has_selection = table_view_->SelectedRowCount() > 0; |
90 remove_button_.SetEnabled(has_selection); | 92 remove_button_.SetEnabled(has_selection); |
91 } | 93 } |
92 | 94 |
93 void ExceptionsPageView::ButtonPressed(views::Button* sender) { | 95 void ExceptionsPageView::ButtonPressed(views::Button* sender) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 columns.back().sortable = true; | 172 columns.back().sortable = true; |
171 table_view_ = new views::TableView(&table_model_, columns, views::TEXT_ONLY, | 173 table_view_ = new views::TableView(&table_model_, columns, views::TEXT_ONLY, |
172 true, true, true); | 174 true, true, true); |
173 // Make the table initially sorted by host. | 175 // Make the table initially sorted by host. |
174 views::TableView::SortDescriptors sort; | 176 views::TableView::SortDescriptors sort; |
175 sort.push_back(views::TableView::SortDescriptor( | 177 sort.push_back(views::TableView::SortDescriptor( |
176 IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN, true)); | 178 IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN, true)); |
177 table_view_->SetSortDescriptors(sort); | 179 table_view_->SetSortDescriptors(sort); |
178 table_view_->SetObserver(this); | 180 table_view_->SetObserver(this); |
179 } | 181 } |
OLD | NEW |