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

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

Issue 10850033: contacts: Add ContactStoreFactory and FakeContactStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing clear() call in FakeContactStore 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/contact_store.h
diff --git a/chrome/browser/chromeos/contacts/contact_store.h b/chrome/browser/chromeos/contacts/contact_store.h
index 4ac89092a0bbbb9eefdf1df6e275e7de635ad695..f7bb94aff45cbf6eaf2468016dfe164e5e07a980 100644
--- a/chrome/browser/chromeos/contacts/contact_store.h
+++ b/chrome/browser/chromeos/contacts/contact_store.h
@@ -10,6 +10,8 @@
#include "base/basictypes.h"
+class Profile;
+
namespace contacts {
class Contact;
@@ -22,6 +24,9 @@ class ContactStore {
ContactStore() {}
virtual ~ContactStore() {}
+ // Initializes the object.
+ virtual void Init() = 0;
+
// Appends all (non-deleted) contacts to |contacts_out|.
virtual void AppendContacts(ContactPointers* contacts_out) = 0;
@@ -38,6 +43,22 @@ class ContactStore {
DISALLOW_COPY_AND_ASSIGN(ContactStore);
};
+// Interface for factories that return ContactStore objects of a given type.
+class ContactStoreFactory {
+ public:
+ ContactStoreFactory() {}
+ virtual ~ContactStoreFactory() {}
+
+ // Creates and returns a new, uninitialized ContactStore for |profile|.
+ // TODO(derat): Figure out how this should work if/when there are other
+ // ContactStore implementations that need additional information beyond the
+ // stuff contained in a Profile.
+ virtual ContactStore* CreateContactStore(Profile* profile) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ContactStoreFactory);
+};
+
} // namespace contacts
#endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_STORE_H_

Powered by Google App Engine
This is Rietveld 408576698