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

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

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 #include "chrome/browser/chromeos/contacts/fake_contact_database.h"
6
7 #include "chrome/browser/chromeos/contacts/contact.h"
8 #include "chrome/browser/chromeos/contacts/contact_test_lib.h"
9
10 namespace contacts {
11
12 FakeContactDatabase::FakeContactDatabase()
13 : init_success_(true),
14 save_success_(true),
15 load_success_(true) {
16 }
17
18 FakeContactDatabase::~FakeContactDatabase() {
19 }
20
21 void FakeContactDatabase::Init(const FilePath& database_path,
22 InitCallback callback) {
23 callback.Run(init_success_);
24 }
25
26 void FakeContactDatabase::SetContacts(const ContactPointers& contacts) {
27 test::CopyContacts(contacts, &contacts_);
28 }
29
30 void FakeContactDatabase::SaveContacts(scoped_ptr<ContactPointers> contacts,
31 bool is_full_update,
32 SaveCallback callback) {
33 if (save_success_)
34 test::CopyContacts(*contacts, &contacts_);
35 callback.Run(save_success_);
36 }
37
38 void FakeContactDatabase::LoadContacts(LoadCallback callback) {
39 scoped_ptr<ScopedVector<Contact> > contacts(new ScopedVector<Contact>());
40 if (load_success_)
41 test::CopyContacts(contacts_, contacts.get());
42 callback.Run(load_success_, contacts.Pass());
43 }
44
45 } // namespace contacts
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/contacts/fake_contact_database.h ('k') | chrome/browser/chromeos/contacts/google_contact_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698