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

Side by Side Diff: chrome/browser/chromeos/contacts/fake_contact_store.h

Issue 10827406: contacts: Rename provider_id to contact_id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_FAKE_CONTACT_STORE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_STORE_H_
6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_STORE_H_ 6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_STORE_H_
7 7
8 #include "chrome/browser/chromeos/contacts/contact_store.h" 8 #include "chrome/browser/chromeos/contacts/contact_store.h"
9 9
10 #include <map> 10 #include <map>
(...skipping 13 matching lines...) Expand all
24 class FakeContactStoreFactory; 24 class FakeContactStoreFactory;
25 typedef std::vector<const Contact*> ContactPointers; 25 typedef std::vector<const Contact*> ContactPointers;
26 26
27 // A "fake" in-memory implementation of ContactStore used for testing. 27 // A "fake" in-memory implementation of ContactStore used for testing.
28 class FakeContactStore : public ContactStore { 28 class FakeContactStore : public ContactStore {
29 public: 29 public:
30 explicit FakeContactStore(FakeContactStoreFactory* factory); 30 explicit FakeContactStore(FakeContactStoreFactory* factory);
31 virtual ~FakeContactStore(); 31 virtual ~FakeContactStore();
32 32
33 // Makes an internal copy of |contacts| so they can be returned by 33 // Makes an internal copy of |contacts| so they can be returned by
34 // AppendContacts() and GetContactByProviderId(). 34 // AppendContacts() and GetContactById().
35 void SetContacts(const ContactPointers& contacts); 35 void SetContacts(const ContactPointers& contacts);
36 36
37 // Invokes observers' OnContactsUpdated() methods. 37 // Invokes observers' OnContactsUpdated() methods.
38 void NotifyObserversAboutContactsUpdate(); 38 void NotifyObserversAboutContactsUpdate();
39 39
40 // ContactStore implementation: 40 // ContactStore implementation:
41 virtual void Init() OVERRIDE; 41 virtual void Init() OVERRIDE;
42 virtual void AppendContacts(ContactPointers* contacts_out) OVERRIDE; 42 virtual void AppendContacts(ContactPointers* contacts_out) OVERRIDE;
43 virtual const Contact* GetContactByProviderId( 43 virtual const Contact* GetContactById(const std::string& contact_id) OVERRIDE;
44 const std::string& provider_id) OVERRIDE;
45 virtual void AddObserver(ContactStoreObserver* observer) OVERRIDE; 44 virtual void AddObserver(ContactStoreObserver* observer) OVERRIDE;
46 virtual void RemoveObserver(ContactStoreObserver* observer) OVERRIDE; 45 virtual void RemoveObserver(ContactStoreObserver* observer) OVERRIDE;
47 46
48 private: 47 private:
49 // Map from a contact's provider ID to the contact itself. 48 // Map from a contact's ID to the contact itself.
50 typedef std::map<std::string, Contact*> ContactMap; 49 typedef std::map<std::string, Contact*> ContactMap;
51 50
52 // Factory that created this store. Not owned. 51 // Factory that created this store. Not owned.
53 FakeContactStoreFactory* factory_; 52 FakeContactStoreFactory* factory_;
54 53
55 ObserverList<ContactStoreObserver> observers_; 54 ObserverList<ContactStoreObserver> observers_;
56 55
57 // Owns the pointed-to Contact values. 56 // Owns the pointed-to Contact values.
58 ContactMap contacts_; 57 ContactMap contacts_;
59 58
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 94
96 // Should CanCreateContactStoreForProfile() return true? 95 // Should CanCreateContactStoreForProfile() return true?
97 bool permit_store_creation_; 96 bool permit_store_creation_;
98 97
99 DISALLOW_COPY_AND_ASSIGN(FakeContactStoreFactory); 98 DISALLOW_COPY_AND_ASSIGN(FakeContactStoreFactory);
100 }; 99 };
101 100
102 } // namespace contacts 101 } // namespace contacts
103 102
104 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_STORE_H_ 103 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_STORE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/contacts/fake_contact_database.cc ('k') | chrome/browser/chromeos/contacts/fake_contact_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698