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

Unified Diff: base/values.cc

Issue 1578023: Add notifications to allow desktop notification permissions to be synced. (Closed)
Patch Set: pre-commit Created 10 years, 8 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
« no previous file with comments | « base/values.h ('k') | chrome/browser/notifications/desktop_notification_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/values.cc
diff --git a/base/values.cc b/base/values.cc
index f214ead4ee41a03bc4aff0ba6ad914bfb9085a89..feff299dbe2a57a8d8061fb77ec342e1c94745db 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -832,6 +832,16 @@ void ListValue::Append(Value* in_value) {
list_.push_back(in_value);
}
+bool ListValue::AppendIfNotPresent(Value* in_value) {
+ DCHECK(in_value);
+ for (ValueVector::iterator i(list_.begin()); i != list_.end(); ++i) {
+ if ((*i)->Equals(in_value))
+ return false;
+ }
+ list_.push_back(in_value);
+ return true;
+}
+
bool ListValue::Insert(size_t index, Value* in_value) {
DCHECK(in_value);
if (index > list_.size())
« no previous file with comments | « base/values.h ('k') | chrome/browser/notifications/desktop_notification_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698