| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/geolocation_exceptions_view.h" | 5 #include "chrome/browser/views/options/geolocation_exceptions_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 GeolocationExceptionsTableModel::Rows | 158 GeolocationExceptionsTableModel::Rows |
| 159 GeolocationExceptionsView::GetSelectedRows() const { | 159 GeolocationExceptionsView::GetSelectedRows() const { |
| 160 GeolocationExceptionsTableModel::Rows rows; | 160 GeolocationExceptionsTableModel::Rows rows; |
| 161 for (views::TableView::iterator i(table_->SelectionBegin()); | 161 for (views::TableView::iterator i(table_->SelectionBegin()); |
| 162 i != table_->SelectionEnd(); ++i) | 162 i != table_->SelectionEnd(); ++i) |
| 163 rows.insert(*i); | 163 rows.insert(*i); |
| 164 return rows; | 164 return rows; |
| 165 } | 165 } |
| 166 | 166 |
| 167 void GeolocationExceptionsView::UpdateButtonState() { | 167 void GeolocationExceptionsView::UpdateButtonState() { |
| 168 remove_button_->SetEnabled(model_.CanRemoveExceptions(GetSelectedRows())); | 168 remove_button_->SetEnabled(model_.CanRemoveRows(GetSelectedRows())); |
| 169 remove_all_button_->SetEnabled(model_.RowCount() > 0); | 169 remove_all_button_->SetEnabled(model_.RowCount() > 0); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void GeolocationExceptionsView::Remove() { | 172 void GeolocationExceptionsView::Remove() { |
| 173 model_.RemoveExceptions(GetSelectedRows()); | 173 model_.RemoveRows(GetSelectedRows()); |
| 174 UpdateButtonState(); | 174 UpdateButtonState(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void GeolocationExceptionsView::RemoveAll() { | 177 void GeolocationExceptionsView::RemoveAll() { |
| 178 model_.RemoveAll(); | 178 model_.RemoveAll(); |
| 179 UpdateButtonState(); | 179 UpdateButtonState(); |
| 180 } | 180 } |
| OLD | NEW |