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..d0277ecd4a79ccaa5e0f28c75cb0c2aa17893761 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,26 @@ class ContactStore { |
DISALLOW_COPY_AND_ASSIGN(ContactStore); |
}; |
+// Interface for factories that return ContactStore objects of a given type. |
+class ContactStoreFactory { |
+ public: |
+ ContactStoreFactory() {} |
+ virtual ~ContactStoreFactory() {} |
+ |
+ // Does |profile| support this type of ContactStore? |
+ virtual bool CanCreateContactStoreForProfile(Profile* profile) = 0; |
Daniel Erat
2012/08/03 20:00:23
I snuck this in so ContactManager can use it.
|
+ |
+ // Creates and returns a new, uninitialized ContactStore for |profile|. |
+ // CanCreateContactStoreForProfile() should be called first. |
+ // 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_ |