Index: chrome/browser/chromeos/contacts/contact_source.h |
diff --git a/chrome/browser/chromeos/contacts/contact_source.h b/chrome/browser/chromeos/contacts/contact_source.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..63c0a5d7b4da8c23d659c13b0f30e415f4f749d8 |
--- /dev/null |
+++ b/chrome/browser/chromeos/contacts/contact_source.h |
@@ -0,0 +1,43 @@ |
+// 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. |
+ |
+#ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_SOURCE_H_ |
+#define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_SOURCE_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "base/basictypes.h" |
+ |
+namespace contacts { |
+ |
+struct Contact; |
+typedef std::vector<const Contact*> ContactPointers; |
+class ContactSourceObserver; |
+ |
+// Interface for classes that provide contacts. |
+class ContactSource { |
+ public: |
+ ContactSource() {} |
+ virtual ~ContactSource() {} |
+ |
+ // Appends the source's contacts to |contacts_out|. |
+ virtual void AppendContacts(ContactPointers* contacts_out) = 0; |
+ |
+ // Returns the contact identified by |provider_id|. |
+ // NULL is returned if the contact doesn't exist. |
+ virtual const Contact* GetContactByProviderId( |
+ const std::string& provider_id) = 0; |
+ |
+ // Adds or removes an observer. |
+ virtual void AddObserver(ContactSourceObserver* observer) = 0; |
+ virtual void RemoveObserver(ContactSourceObserver* observer) = 0; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(ContactSource); |
+}; |
+ |
+} // namespace contacts |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_SOURCE_H_ |