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

Unified Diff: chrome/browser/content_settings/content_settings_notification_provider.cc

Issue 7618021: base: Fix the TODO in ListValue::Remove(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/content_settings/content_settings_notification_provider.cc
diff --git a/chrome/browser/content_settings/content_settings_notification_provider.cc b/chrome/browser/content_settings/content_settings_notification_provider.cc
index 17c1403487831625762eda184cc5f7bcd4894b41..98893be0aa19a7bfe73d61bf8a37e69dbc5b2d88 100644
--- a/chrome/browser/content_settings/content_settings_notification_provider.cc
+++ b/chrome/browser/content_settings/content_settings_notification_provider.cc
@@ -281,7 +281,7 @@ void NotificationProvider::PersistPermissionChange(
// Remove from one list and add to the other.
if (is_allowed) {
// Remove from the denied list.
- if (denied_sites->Remove(*value) != -1)
+ if (denied_sites->Remove(*value, NULL))
denied_changed = true;
// Add to the allowed list.
@@ -289,7 +289,7 @@ void NotificationProvider::PersistPermissionChange(
allowed_changed = true;
} else {
// Remove from the allowed list.
- if (allowed_sites->Remove(*value) != -1)
+ if (allowed_sites->Remove(*value, NULL))
allowed_changed = true;
// Add to the denied list.
@@ -336,8 +336,8 @@ void NotificationProvider::ResetAllowedOrigin(const GURL& origin) {
ListPrefUpdate update(prefs, prefs::kDesktopNotificationAllowedOrigins);
ListValue* allowed_sites = update.Get();
StringValue value(origin.spec());
- int removed_index = allowed_sites->Remove(value);
- DCHECK_NE(-1, removed_index) << origin << " was not allowed";
+ bool removed = allowed_sites->Remove(value, NULL);
+ DCHECK_NE(false, removed) << origin << " was not allowed";
}
prefs->ScheduleSavePersistentPrefs();
}
@@ -353,8 +353,8 @@ void NotificationProvider::ResetBlockedOrigin(const GURL& origin) {
ListPrefUpdate update(prefs, prefs::kDesktopNotificationDeniedOrigins);
ListValue* denied_sites = update.Get();
StringValue value(origin.spec());
- int removed_index = denied_sites->Remove(value);
- DCHECK_NE(-1, removed_index) << origin << " was not blocked";
+ bool removed = denied_sites->Remove(value, NULL);
+ DCHECK_NE(false, removed) << origin << " was not blocked";
}
prefs->ScheduleSavePersistentPrefs();
}
« no previous file with comments | « chrome/browser/chromeos/user_cros_settings_provider.cc ('k') | chrome/browser/extensions/extension_web_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698