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

Side by Side Diff: chrome/browser/chromeos/contacts/fake_contact_database.cc

Issue 10827406: contacts: Rename provider_id to contact_id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/chromeos/contacts/fake_contact_database.h" 5 #include "chrome/browser/chromeos/contacts/fake_contact_database.h"
6 6
7 #include "chrome/browser/chromeos/contacts/contact.pb.h" 7 #include "chrome/browser/chromeos/contacts/contact.pb.h"
8 #include "chrome/browser/chromeos/contacts/contact_test_util.h" 8 #include "chrome/browser/chromeos/contacts/contact_test_util.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 void FakeContactDatabase::MergeContacts( 70 void FakeContactDatabase::MergeContacts(
71 const ContactPointers& updated_contacts) { 71 const ContactPointers& updated_contacts) {
72 for (ContactPointers::const_iterator updated_it = updated_contacts.begin(); 72 for (ContactPointers::const_iterator updated_it = updated_contacts.begin();
73 updated_it != updated_contacts.end(); ++updated_it) { 73 updated_it != updated_contacts.end(); ++updated_it) {
74 const Contact& updated_contact = **updated_it; 74 const Contact& updated_contact = **updated_it;
75 bool found = false; 75 bool found = false;
76 for (ScopedVector<Contact>::const_iterator existing_it = contacts_.begin(); 76 for (ScopedVector<Contact>::const_iterator existing_it = contacts_.begin();
77 existing_it != contacts_.end(); ++existing_it) { 77 existing_it != contacts_.end(); ++existing_it) {
78 Contact* existing_contact = *existing_it; 78 Contact* existing_contact = *existing_it;
79 if (existing_contact->provider_id() == updated_contact.provider_id()) { 79 if (existing_contact->contact_id() == updated_contact.contact_id()) {
80 *existing_contact = updated_contact; 80 *existing_contact = updated_contact;
81 found = true; 81 found = true;
82 break; 82 break;
83 } 83 }
84 } 84 }
85 if (!found) 85 if (!found)
86 contacts_.push_back(new Contact(updated_contact)); 86 contacts_.push_back(new Contact(updated_contact));
87 } 87 }
88 } 88 }
89 89
90 } // namespace contacts 90 } // namespace contacts
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/contacts/contact_test_util.cc ('k') | chrome/browser/chromeos/contacts/fake_contact_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698