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

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

Issue 10542076: ABANDONED: chromeos: Download contacts (work in progress). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_FAKE_CONTACT_DATABASE_H_
6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_DATABASE_H_
7
8 #include "chrome/browser/chromeos/contacts/contact_database.h"
9
10 namespace contacts {
11
12 // Fake implementation used for testing.
13 class FakeContactDatabase : public ContactDatabaseInterface {
14 public:
15 FakeContactDatabase();
16 virtual ~FakeContactDatabase();
17
18 const ScopedVector<Contact>& contacts() const { return contacts_; }
19
20 void set_init_success(bool success) { init_success_ = success; }
21 void set_save_success(bool success) { save_success_ = success; }
22 void set_load_success(bool success) { load_success_ = success; }
23
24 // Copies |contacts| into |contacts_|. These contacts will be returned by
25 // subsequent calls to LoadContacts().
26 void SetContacts(const ContactPointers& contacts);
27
28 // ContactDatabaseInterface implementation.
29 virtual void Init(const FilePath& database_path,
30 InitCallback callback) OVERRIDE;
31 virtual void SaveContacts(scoped_ptr<ContactPointers> contacts,
32 bool is_full_update,
33 SaveCallback callback) OVERRIDE;
34 virtual void LoadContacts(LoadCallback callback) OVERRIDE;
35
36 private:
37 // Should we report success in response to various requests?
38 bool init_success_;
39 bool save_success_;
40 bool load_success_;
41
42 // Currently-stored contacts.
43 ScopedVector<Contact> contacts_;
44
45 DISALLOW_COPY_AND_ASSIGN(FakeContactDatabase);
46 };
47
48 } // namespace contacts
49
50 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_DATABASE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/contacts/contact_test_lib.cc ('k') | chrome/browser/chromeos/contacts/fake_contact_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698