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

Unified Diff: chrome/browser/chromeos/contacts/contact_map.cc

Issue 10933127: contacts: Don't save deleted contacts to disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 2 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
Index: chrome/browser/chromeos/contacts/contact_map.cc
diff --git a/chrome/browser/chromeos/contacts/contact_map.cc b/chrome/browser/chromeos/contacts/contact_map.cc
index b24fbc0aeec05525fd41877e36bc05da128d32c1..f02aef4244ce009523a0be32b1e1ae544a0986a0 100644
--- a/chrome/browser/chromeos/contacts/contact_map.cc
+++ b/chrome/browser/chromeos/contacts/contact_map.cc
@@ -17,6 +17,15 @@ const Contact* ContactMap::Find(const std::string& contact_id) const {
return (it != contacts_.end()) ? it->second : NULL;
}
+void ContactMap::Erase(const std::string& contact_id) {
+ Map::iterator it = contacts_.find(contact_id);
+ if (it == contacts_.end())
+ return;
+
+ delete it->second;
+ contacts_.erase(it);
+}
+
void ContactMap::Clear() {
STLDeleteValues(&contacts_);
}
@@ -50,18 +59,4 @@ void ContactMap::Merge(scoped_ptr<ScopedVector<Contact> > updated_contacts,
updated_contacts->weak_clear();
}
-base::Time ContactMap::GetMaxUpdateTime() const {
- base::Time max_update_time;
- for (const_iterator it = begin(); it != end(); ++it) {
- const Contact* contact = it->second;
- const base::Time update_time =
- base::Time::FromInternalValue(contact->update_time());
- if (!update_time.is_null() &&
- (max_update_time.is_null() || max_update_time < update_time)) {
- max_update_time = update_time;
- }
- }
- return max_update_time;
-}
-
} // namespace contacts

Powered by Google App Engine
This is Rietveld 408576698