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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « base/values.h ('k') | chrome/browser/notifications/desktop_notification_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/values.h" 5 #include "base/values.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 10
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 } 825 }
826 } 826 }
827 return -1; 827 return -1;
828 } 828 }
829 829
830 void ListValue::Append(Value* in_value) { 830 void ListValue::Append(Value* in_value) {
831 DCHECK(in_value); 831 DCHECK(in_value);
832 list_.push_back(in_value); 832 list_.push_back(in_value);
833 } 833 }
834 834
835 bool ListValue::AppendIfNotPresent(Value* in_value) {
836 DCHECK(in_value);
837 for (ValueVector::iterator i(list_.begin()); i != list_.end(); ++i) {
838 if ((*i)->Equals(in_value))
839 return false;
840 }
841 list_.push_back(in_value);
842 return true;
843 }
844
835 bool ListValue::Insert(size_t index, Value* in_value) { 845 bool ListValue::Insert(size_t index, Value* in_value) {
836 DCHECK(in_value); 846 DCHECK(in_value);
837 if (index > list_.size()) 847 if (index > list_.size())
838 return false; 848 return false;
839 849
840 list_.insert(list_.begin() + index, in_value); 850 list_.insert(list_.begin() + index, in_value);
841 return true; 851 return true;
842 } 852 }
843 853
844 Value* ListValue::DeepCopy() const { 854 Value* ListValue::DeepCopy() const {
(...skipping 16 matching lines...) Expand all
861 lhs_it != end() && rhs_it != other_list->end(); 871 lhs_it != end() && rhs_it != other_list->end();
862 ++lhs_it, ++rhs_it) { 872 ++lhs_it, ++rhs_it) {
863 if (!(*lhs_it)->Equals(*rhs_it)) 873 if (!(*lhs_it)->Equals(*rhs_it))
864 return false; 874 return false;
865 } 875 }
866 if (lhs_it != end() || rhs_it != other_list->end()) 876 if (lhs_it != end() || rhs_it != other_list->end())
867 return false; 877 return false;
868 878
869 return true; 879 return true;
870 } 880 }
OLDNEW
« 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