summaryrefslogtreecommitdiffstats
path: root/chrome/browser/geolocation/geolocation_exceptions_table_model.cc
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 16:17:37 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-01 16:17:37 +0000
commit508d27e151318b0a2ffdc6a4089ea3613462c26d (patch)
tree0aadf1f0948c5086a624e37f95bc966fa4bb8633 /chrome/browser/geolocation/geolocation_exceptions_table_model.cc
parentbf784d4ca187ca12d455e91ae7c0d2e0380a3154 (diff)
downloadchromium_src-508d27e151318b0a2ffdc6a4089ea3613462c26d.zip
chromium_src-508d27e151318b0a2ffdc6a4089ea3613462c26d.tar.gz
chromium_src-508d27e151318b0a2ffdc6a4089ea3613462c26d.tar.bz2
Introduce RemoveRowTableModel interface, let GeolocationExceptionsTableModel derive from it.
No functionality change. This will be used to share the content settings exceptions dialog code between geolocation and notifications. BUG=45547 Review URL: http://codereview.chromium.org/2838037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/geolocation/geolocation_exceptions_table_model.cc')
-rw-r--r--chrome/browser/geolocation/geolocation_exceptions_table_model.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/geolocation/geolocation_exceptions_table_model.cc b/chrome/browser/geolocation/geolocation_exceptions_table_model.cc
index 95d2e79..c8a6202 100644
--- a/chrome/browser/geolocation/geolocation_exceptions_table_model.cc
+++ b/chrome/browser/geolocation/geolocation_exceptions_table_model.cc
@@ -57,7 +57,7 @@ GeolocationExceptionsTableModel::GeolocationExceptionsTableModel(
AddEntriesForOrigin(i->first, i->second);
}
-bool GeolocationExceptionsTableModel::CanRemoveExceptions(
+bool GeolocationExceptionsTableModel::CanRemoveRows(
const Rows& rows) const {
for (Rows::const_iterator i(rows.begin()); i != rows.end(); ++i) {
const Entry& entry = entries_[*i];
@@ -73,7 +73,7 @@ bool GeolocationExceptionsTableModel::CanRemoveExceptions(
return !rows.empty();
}
-void GeolocationExceptionsTableModel::RemoveExceptions(const Rows& rows) {
+void GeolocationExceptionsTableModel::RemoveRows(const Rows& rows) {
for (Rows::const_reverse_iterator i(rows.rbegin()); i != rows.rend(); ++i) {
size_t row = *i;
Entry* entry = &entries_[row];
@@ -95,11 +95,11 @@ void GeolocationExceptionsTableModel::RemoveExceptions(const Rows& rows) {
entries_.erase(entries_.begin() + row); // Note: |entry| is now garbage.
if (observer_)
observer_->OnItemsRemoved(row, 1);
- // If we remove the last non-default child of a default parent, we
- // should remove the parent too. We do these removals one-at-a-time
- // because the table view will end up being called back as each row is
- // removed, in turn calling back to CanRemoveExceptions(), and if we've
- // already removed more entries than the view has, we'll have problems.
+ // If we remove the last non-default child of a default parent, we should
+ // remove the parent too. We do these removals one-at-a-time because the
+ // table view will end up being called back as each row is removed, in
+ // turn calling back to CanRemoveRows(), and if we've already removed
+ // more entries than the view has, we'll have problems.
if ((row == 0) || rows.count(row - 1))
break;
entry = &entries_[--row];