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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/contacts/fake_contact_database.h
diff --git a/chrome/browser/chromeos/contacts/fake_contact_database.h b/chrome/browser/chromeos/contacts/fake_contact_database.h
new file mode 100644
index 0000000000000000000000000000000000000000..f90859fcfeb1b8bd344a0e89a66e5af2eb012549
--- /dev/null
+++ b/chrome/browser/chromeos/contacts/fake_contact_database.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_DATABASE_H_
+#define CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_DATABASE_H_
+
+#include "chrome/browser/chromeos/contacts/contact_database.h"
+
+namespace contacts {
+
+// Fake implementation used for testing.
+class FakeContactDatabase : public ContactDatabaseInterface {
+ public:
+ FakeContactDatabase();
+ virtual ~FakeContactDatabase();
+
+ const ScopedVector<Contact>& contacts() const { return contacts_; }
+
+ void set_init_success(bool success) { init_success_ = success; }
+ void set_save_success(bool success) { save_success_ = success; }
+ void set_load_success(bool success) { load_success_ = success; }
+
+ // Copies |contacts| into |contacts_|. These contacts will be returned by
+ // subsequent calls to LoadContacts().
+ void SetContacts(const ContactPointers& contacts);
+
+ // ContactDatabaseInterface implementation.
+ virtual void Init(const FilePath& database_path,
+ InitCallback callback) OVERRIDE;
+ virtual void SaveContacts(scoped_ptr<ContactPointers> contacts,
+ bool is_full_update,
+ SaveCallback callback) OVERRIDE;
+ virtual void LoadContacts(LoadCallback callback) OVERRIDE;
+
+ private:
+ // Should we report success in response to various requests?
+ bool init_success_;
+ bool save_success_;
+ bool load_success_;
+
+ // Currently-stored contacts.
+ ScopedVector<Contact> contacts_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeContactDatabase);
+};
+
+} // namespace contacts
+
+#endif // CHROME_BROWSER_CHROMEOS_CONTACTS_FAKE_CONTACT_DATABASE_H_
« 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