OLD | NEW |
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 #include "chrome/browser/chromeos/contacts/gdata_contacts_service_stub.h" | 5 #include "chrome/browser/chromeos/contacts/gdata_contacts_service_stub.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "chrome/browser/chromeos/contacts/contact.pb.h" | 9 #include "chrome/browser/chromeos/contacts/contact.pb.h" |
10 #include "chrome/browser/chromeos/contacts/contact_test_util.h" | 10 #include "chrome/browser/chromeos/contacts/contact_test_util.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 GDataContactsServiceStub::~GDataContactsServiceStub() { | 24 GDataContactsServiceStub::~GDataContactsServiceStub() { |
25 } | 25 } |
26 | 26 |
27 void GDataContactsServiceStub::SetContacts( | 27 void GDataContactsServiceStub::SetContacts( |
28 const contacts::ContactPointers& contacts, | 28 const contacts::ContactPointers& contacts, |
29 const base::Time& expected_min_update_time) { | 29 const base::Time& expected_min_update_time) { |
30 contacts::test::CopyContacts(contacts, &contacts_); | 30 contacts::test::CopyContacts(contacts, &contacts_); |
31 expected_min_update_time_ = expected_min_update_time; | 31 expected_min_update_time_ = expected_min_update_time; |
32 } | 32 } |
33 | 33 |
34 void GDataContactsServiceStub::Initialize() { | |
35 } | |
36 | |
37 void GDataContactsServiceStub::DownloadContacts( | 34 void GDataContactsServiceStub::DownloadContacts( |
38 SuccessCallback success_callback, | 35 SuccessCallback success_callback, |
39 FailureCallback failure_callback, | 36 FailureCallback failure_callback, |
40 const base::Time& min_update_time) { | 37 const base::Time& min_update_time) { |
41 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 38 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
42 num_download_requests_++; | 39 num_download_requests_++; |
43 | 40 |
44 if (!download_should_succeed_) { | 41 if (!download_should_succeed_) { |
45 failure_callback.Run(); | 42 failure_callback.Run(); |
46 return; | 43 return; |
(...skipping 11 matching lines...) Expand all Loading... |
58 return; | 55 return; |
59 } | 56 } |
60 | 57 |
61 scoped_ptr<ScopedVector<contacts::Contact> > contacts( | 58 scoped_ptr<ScopedVector<contacts::Contact> > contacts( |
62 new ScopedVector<contacts::Contact>()); | 59 new ScopedVector<contacts::Contact>()); |
63 contacts::test::CopyContacts(contacts_, contacts.get()); | 60 contacts::test::CopyContacts(contacts_, contacts.get()); |
64 success_callback.Run(contacts.Pass()); | 61 success_callback.Run(contacts.Pass()); |
65 } | 62 } |
66 | 63 |
67 } // namespace contacts | 64 } // namespace contacts |
OLD | NEW |