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

Unified Diff: chrome/browser/chromeos/contacts/fake_contact_database.h

Issue 10850033: contacts: Add ContactStoreFactory and FakeContactStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix GoogleContactStore db-saving bug and FakeContactDatabase partial-update bug and apply review fe… 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/contacts/fake_contact_database.h
diff --git a/chrome/browser/chromeos/contacts/fake_contact_database.h b/chrome/browser/chromeos/contacts/fake_contact_database.h
index bc2256c6272199b3d9ce06d9553f5c54a3bfef8c..952a833bfe19cf8f430825960ff3eaf1ada2bd72 100644
--- a/chrome/browser/chromeos/contacts/fake_contact_database.h
+++ b/chrome/browser/chromeos/contacts/fake_contact_database.h
@@ -22,6 +22,9 @@ class FakeContactDatabase : public ContactDatabaseInterface {
void set_save_success(bool success) { save_success_ = success; }
void set_load_success(bool success) { load_success_ = success; }
+ int num_saved_contacts() const { return num_saved_contacts_; }
+ void reset_stats() { num_saved_contacts_ = 0; }
+
// Copies |contacts| into |contacts_| and |metadata| into |metadata_|. These
// values will be returned by subsequent calls to LoadContacts().
void SetContacts(const ContactPointers& contacts,
@@ -41,11 +44,18 @@ class FakeContactDatabase : public ContactDatabaseInterface {
virtual ~FakeContactDatabase();
private:
+ // Merges |updated_contacts| into |contacts_|.
+ void MergeContacts(const ContactPointers& updated_contacts);
+
// Should we report success in response to various requests?
bool init_success_;
bool save_success_;
bool load_success_;
+ // Total number of contacts that have been passed to SaveContacts() while
+ // |save_success_| is true.
+ int num_saved_contacts_;
+
// Currently-stored contacts and metadata.
ScopedVector<Contact> contacts_;
UpdateMetadata metadata_;

Powered by Google App Engine
This is Rietveld 408576698