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

Side by Side Diff: chrome/browser/chromeos/gdata/fake_gdata_contacts_service.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_GDATA_FAKE_GDATA_CONTACTS_SERVICE_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_FAKE_GDATA_CONTACTS_SERVICE_H_
7
8 #include "chrome/browser/chromeos/gdata/gdata_contacts_service.h"
9
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "base/compiler_specific.h"
13 #include "base/time.h"
14
15 namespace contacts {
16 typedef std::vector<const contacts::Contact*> ContactPointers;
17 }
18
19 namespace gdata {
20
21 class FakeGDataContactsService : public GDataContactsServiceInterface {
22 public:
23 FakeGDataContactsService();
24 virtual ~FakeGDataContactsService();
25
26 void set_download_should_succeed(bool succeed) {
27 download_should_succeed_ = succeed;
28 }
29
30 void SetContacts(const contacts::ContactPointers& contacts,
31 const base::Time& expected_min_update_time);
32
33 // Overridden from GDataContactsServiceInterface:
34 virtual void Initialize() OVERRIDE;
35 virtual void DownloadContacts(SuccessCallback success_callback,
36 FailureCallback failure_callback,
37 const base::Time& min_update_time) OVERRIDE;
38
39 private:
40 // Should calls to DownloadContacts() succeed?
41 bool download_should_succeed_;
42
43 // Contacts to be returned by calls to DownloadContacts().
44 ScopedVector<contacts::Contact> contacts_;
45
46 // |min_update_time| value that we expect to be passed to DownloadContacts().
47 // If a different value is passed, we'll log an error and return an empty set
48 // of contacts.
49 base::Time expected_min_update_time_;
50
51 DISALLOW_COPY_AND_ASSIGN(FakeGDataContactsService);
52 };
53
54 } // namespace gdata
55
56 #endif // CHROME_BROWSER_CHROMEOS_GDATA_FAKE_GDATA_CONTACTS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698