| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MAP_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MAP_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MAP_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MAP_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 bool empty() const { return contacts_.empty(); } | 41 bool empty() const { return contacts_.empty(); } |
| 42 size_t size() const { return contacts_.size(); } | 42 size_t size() const { return contacts_.size(); } |
| 43 const_iterator begin() const { return contacts_.begin(); } | 43 const_iterator begin() const { return contacts_.begin(); } |
| 44 const_iterator end() const { return contacts_.end(); } | 44 const_iterator end() const { return contacts_.end(); } |
| 45 | 45 |
| 46 // Returns the contact with ID |contact_id|. NULL is returned if the contact | 46 // Returns the contact with ID |contact_id|. NULL is returned if the contact |
| 47 // isn't present. | 47 // isn't present. |
| 48 const Contact* Find(const std::string& contact_id) const; | 48 const Contact* Find(const std::string& contact_id) const; |
| 49 | 49 |
| 50 // Deletes the contact with ID |contact_id|. |
| 51 void Erase(const std::string& contact_id); |
| 52 |
| 50 // Deletes all contacts. | 53 // Deletes all contacts. |
| 51 void Clear(); | 54 void Clear(); |
| 52 | 55 |
| 53 // Merges |updated_contacts| into |contacts_|. | 56 // Merges |updated_contacts| into |contacts_|. |
| 54 void Merge(scoped_ptr<ScopedVector<Contact> > updated_contacts, | 57 void Merge(scoped_ptr<ScopedVector<Contact> > updated_contacts, |
| 55 DeletedContactPolicy policy); | 58 DeletedContactPolicy policy); |
| 56 | 59 |
| 57 // Returns the maximum |update_time| value stored within a contact in | |
| 58 // |contacts_|. | |
| 59 base::Time GetMaxUpdateTime() const; | |
| 60 | |
| 61 private: | 60 private: |
| 62 Map contacts_; | 61 Map contacts_; |
| 63 | 62 |
| 64 // Deletes values in |contacts_|. | 63 // Deletes values in |contacts_|. |
| 65 STLValueDeleter<Map> contacts_deleter_; | 64 STLValueDeleter<Map> contacts_deleter_; |
| 66 | 65 |
| 67 DISALLOW_COPY_AND_ASSIGN(ContactMap); | 66 DISALLOW_COPY_AND_ASSIGN(ContactMap); |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 } // namespace contacts | 69 } // namespace contacts |
| 71 | 70 |
| 72 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MAP_H_ | 71 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MAP_H_ |
| OLD | NEW |