OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // Adds or removes an observer for changes to |profile|'s contacts. | 46 // Adds or removes an observer for changes to |profile|'s contacts. |
47 void AddObserver(ContactManagerObserver* observer, Profile* profile); | 47 void AddObserver(ContactManagerObserver* observer, Profile* profile); |
48 void RemoveObserver(ContactManagerObserver* observer, Profile* profile); | 48 void RemoveObserver(ContactManagerObserver* observer, Profile* profile); |
49 | 49 |
50 // Returns pointers to all currently-loaded contacts for |profile|. The | 50 // Returns pointers to all currently-loaded contacts for |profile|. The |
51 // returned Contact objects may not persist indefinitely; the caller must not | 51 // returned Contact objects may not persist indefinitely; the caller must not |
52 // refer to them again after unblocking the UI thread. | 52 // refer to them again after unblocking the UI thread. |
53 scoped_ptr<ContactPointers> GetAllContacts(Profile* profile); | 53 scoped_ptr<ContactPointers> GetAllContacts(Profile* profile); |
54 | 54 |
55 // Returns the contact identified by |provider_id|. | 55 // Returns the contact identified by |contact_id|. |
56 // NULL is returned if the contact doesn't exist. | 56 // NULL is returned if the contact doesn't exist. |
57 const Contact* GetContactByProviderId(Profile* profile, | 57 const Contact* GetContactById(Profile* profile, |
58 const std::string& provider_id); | 58 const std::string& contact_id); |
59 | 59 |
60 // ContactStoreObserver overrides: | 60 // ContactStoreObserver overrides: |
61 virtual void OnContactsUpdated(ContactStore* store) OVERRIDE; | 61 virtual void OnContactsUpdated(ContactStore* store) OVERRIDE; |
62 | 62 |
63 // content::NotificationObserver overrides: | 63 // content::NotificationObserver overrides: |
64 virtual void Observe(int type, | 64 virtual void Observe(int type, |
65 const content::NotificationSource& source, | 65 const content::NotificationSource& source, |
66 const content::NotificationDetails& details) OVERRIDE; | 66 const content::NotificationDetails& details) OVERRIDE; |
67 | 67 |
68 private: | 68 private: |
(...skipping 26 matching lines...) Expand all Loading... |
95 | 95 |
96 // Deletes values in |contact_stores_|. | 96 // Deletes values in |contact_stores_|. |
97 STLValueDeleter<ContactStoreMap> contact_stores_deleter_; | 97 STLValueDeleter<ContactStoreMap> contact_stores_deleter_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(ContactManager); | 99 DISALLOW_COPY_AND_ASSIGN(ContactManager); |
100 }; | 100 }; |
101 | 101 |
102 } // namespace contacts | 102 } // namespace contacts |
103 | 103 |
104 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MANAGER_H_ | 104 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_MANAGER_H_ |
OLD | NEW |