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

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

Issue 10829144: contacts: Add GoogleContactStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: apply review feedback Created 8 years, 5 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
new file mode 100644
index 0000000000000000000000000000000000000000..4ac89092a0bbbb9eefdf1df6e275e7de635ad695
--- /dev/null
+++ b/chrome/browser/chromeos/contacts/contact_store.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_STORE_H_
+#define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_STORE_H_
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+
+namespace contacts {
+
+class Contact;
+typedef std::vector<const Contact*> ContactPointers;
+class ContactStoreObserver;
+
+// Interface for classes that store contacts from a particular source.
+class ContactStore {
+ public:
+ ContactStore() {}
+ virtual ~ContactStore() {}
+
+ // Appends all (non-deleted) 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(ContactStoreObserver* observer) = 0;
+ virtual void RemoveObserver(ContactStoreObserver* observer) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ContactStore);
+};
+
+} // namespace contacts
+
+#endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_STORE_H_

Powered by Google App Engine
This is Rietveld 408576698