Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Side by Side Diff: chrome/browser/views/options/geolocation_exceptions_view.cc

Issue 2838037: Introduce RemoveRowTableModel interface, let GeolocationExceptionsTableModel derive from it. (Closed)
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/remove_rows_table_model.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/remove_rows_table_model.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698