Implement the popup blocking whitelist pref.  This makes the whitelist actually function.BUG=11440
Review URL: http://codereview.chromium.org/115149

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15702 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: e7f5c6f8aede399fe896e8218d89087408011d18
diff --git a/base/values.cc b/base/values.cc
index f8e3729..3b5bd38 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -497,11 +497,8 @@
 }
 
 void ListValue::Clear() {
-  ValueVector::iterator list_iterator = list_.begin();
-  while (list_iterator != list_.end()) {
-    delete *list_iterator;
-    ++list_iterator;
-  }
+  for (ValueVector::iterator i(list_.begin()); i != list_.end(); ++i)
+    delete *i;
   list_.clear();
 }
 
@@ -609,13 +606,19 @@
   else
     delete list_[index];
 
-  ValueVector::iterator entry = list_.begin();
-  entry += index;
-
-  list_.erase(entry);
+  list_.erase(list_.begin() + index);
   return true;
 }
 
+void ListValue::Remove(const Value& value) {
+  for (ValueVector::iterator i(list_.begin()); i != list_.end(); ++i) {
+    if ((*i)->Equals(&value)) {
+      list_.erase(i);
+      break;
+    }
+  }
+}
+
 void ListValue::Append(Value* in_value) {
   DCHECK(in_value);
   list_.push_back(in_value);
@@ -624,11 +627,8 @@
 Value* ListValue::DeepCopy() const {
   ListValue* result = new ListValue;
 
-  ValueVector::const_iterator current_entry = list_.begin();
-  while (current_entry != list_.end()) {
-    result->Append((*current_entry)->DeepCopy());
-    ++current_entry;
-  }
+  for (ValueVector::const_iterator i(list_.begin()); i != list_.end(); ++i)
+    result->Append((*i)->DeepCopy());
 
   return result;
 }