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

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

Issue 190063004: chromeos: Delete old, unused contacts code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge again Created 6 years, 9 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
deleted file mode 100644
index f02aef4244ce009523a0be32b1e1ae544a0986a0..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/contacts/contact_map.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/contacts/contact_map.h"
-
-#include "chrome/browser/chromeos/contacts/contact.pb.h"
-
-namespace contacts {
-
-ContactMap::ContactMap() : contacts_deleter_(&contacts_) {}
-
-ContactMap::~ContactMap() {}
-
-const Contact* ContactMap::Find(const std::string& contact_id) const {
- Map::const_iterator it = contacts_.find(contact_id);
- 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_);
-}
-
-void ContactMap::Merge(scoped_ptr<ScopedVector<Contact> > updated_contacts,
- DeletedContactPolicy policy) {
- for (ScopedVector<Contact>::iterator it = updated_contacts->begin();
- it != updated_contacts->end(); ++it) {
- Contact* contact = *it;
- Map::iterator map_it = contacts_.find(contact->contact_id());
-
- if (contact->deleted() && policy == DROP_DELETED_CONTACTS) {
- // Also delete the previous version of the contact, if any.
- if (map_it != contacts_.end()) {
- delete map_it->second;
- contacts_.erase(map_it);
- }
- delete contact;
- } else {
- if (map_it != contacts_.end()) {
- delete map_it->second;
- map_it->second = contact;
- } else {
- contacts_[contact->contact_id()] = contact;
- }
- }
- }
-
- // Make sure that the Contact objects that we just saved to the map won't be
- // destroyed when |updated_contacts| is destroyed.
- updated_contacts->weak_clear();
-}
-
-} // namespace contacts
« no previous file with comments | « chrome/browser/chromeos/contacts/contact_map.h ('k') | chrome/browser/chromeos/contacts/contact_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698