diff options
author | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 21:48:10 +0000 |
---|---|---|
committer | zork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 21:48:10 +0000 |
commit | 84064220a7e5a37715aeb428a80b6474f9799cc2 (patch) | |
tree | 42c39d3d503379a65e35a56da12a4fbb1604ac91 /base/values.cc | |
parent | 9a371cd2332d32818bdeb783d364c108faf1dd53 (diff) | |
download | chromium_src-84064220a7e5a37715aeb428a80b6474f9799cc2.zip chromium_src-84064220a7e5a37715aeb428a80b6474f9799cc2.tar.gz chromium_src-84064220a7e5a37715aeb428a80b6474f9799cc2.tar.bz2 |
Add notifications to allow desktop notification permissions to be synced.
Fix a bug where sites can be added to allow and deny lists multiple times.
BUG=none
TEST=Open two browsers with separate profiles. Request permission for notifications on a site on one. Check that the permissions are the same on the other browser.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=44234
Review URL: http://codereview.chromium.org/1578023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44283 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values.cc')
-rw-r--r-- | base/values.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/base/values.cc b/base/values.cc index f214ead..feff299 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()) |