Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_STORE_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_STORE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 | |
| 13 namespace contacts { | |
| 14 | |
| 15 class Contact; | |
| 16 typedef std::vector<const Contact*> ContactPointers; | |
| 17 class ContactStoreObserver; | |
|
satorux1
2012/08/02 22:21:25
I thought we usually defined Observer as a nested
Daniel Erat
2012/08/02 23:23:18
I've seen people go both ways on this. This way u
| |
| 18 | |
| 19 // Interface for classes that store contacts from a particular source. | |
| 20 class ContactStore { | |
| 21 public: | |
| 22 ContactStore() {} | |
| 23 virtual ~ContactStore() {} | |
| 24 | |
| 25 // Appends all (non-deleted) contacts to |contacts_out|. | |
| 26 virtual void AppendContacts(ContactPointers* contacts_out) = 0; | |
| 27 | |
| 28 // Returns the contact identified by |provider_id|. | |
| 29 // NULL is returned if the contact doesn't exist. | |
| 30 virtual const Contact* GetContactByProviderId( | |
| 31 const std::string& provider_id) = 0; | |
| 32 | |
| 33 // Adds or removes an observer. | |
| 34 virtual void AddObserver(ContactStoreObserver* observer) = 0; | |
| 35 virtual void RemoveObserver(ContactStoreObserver* observer) = 0; | |
| 36 | |
| 37 private: | |
| 38 DISALLOW_COPY_AND_ASSIGN(ContactStore); | |
| 39 }; | |
| 40 | |
| 41 } // namespace contacts | |
| 42 | |
| 43 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_STORE_H_ | |
| OLD | NEW |