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

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

Issue 11620007: Switch from OnIPAddressChanged and OnConnectionTypeChange to OnNetworkChanged Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
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 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_GOOGLE_CONTACT_STORE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_CONTACTS_GOOGLE_CONTACT_STORE_H_
6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_GOOGLE_CONTACT_STORE_H_ 6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_GOOGLE_CONTACT_STORE_H_
7 7
8 #include "chrome/browser/chromeos/contacts/contact_store.h" 8 #include "chrome/browser/chromeos/contacts/contact_store.h"
9 9
10 #include <map> 10 #include <map>
(...skipping 20 matching lines...) Expand all
31 namespace contacts { 31 namespace contacts {
32 32
33 class Contact; 33 class Contact;
34 class ContactDatabaseInterface; 34 class ContactDatabaseInterface;
35 class GDataContactsServiceInterface; 35 class GDataContactsServiceInterface;
36 class UpdateMetadata; 36 class UpdateMetadata;
37 37
38 // A collection of contacts from a Google account. 38 // A collection of contacts from a Google account.
39 class GoogleContactStore 39 class GoogleContactStore
40 : public ContactStore, 40 : public ContactStore,
41 public net::NetworkChangeNotifier::ConnectionTypeObserver { 41 public net::NetworkChangeNotifier::NetworkChangeObserver {
42 public: 42 public:
43 class TestAPI { 43 class TestAPI {
44 public: 44 public:
45 explicit TestAPI(GoogleContactStore* store); 45 explicit TestAPI(GoogleContactStore* store);
46 ~TestAPI(); 46 ~TestAPI();
47 47
48 bool update_scheduled() { return store_->update_timer_.IsRunning(); } 48 bool update_scheduled() { return store_->update_timer_.IsRunning(); }
49 base::Time last_contact_update_time() const { 49 base::Time last_contact_update_time() const {
50 return store_->last_contact_update_time_; 50 return store_->last_contact_update_time_;
51 } 51 }
(...skipping 29 matching lines...) Expand all
81 Profile* profile); 81 Profile* profile);
82 virtual ~GoogleContactStore(); 82 virtual ~GoogleContactStore();
83 83
84 // ContactStore implementation: 84 // ContactStore implementation:
85 virtual void Init() OVERRIDE; 85 virtual void Init() OVERRIDE;
86 virtual void AppendContacts(ContactPointers* contacts_out) OVERRIDE; 86 virtual void AppendContacts(ContactPointers* contacts_out) OVERRIDE;
87 virtual const Contact* GetContactById(const std::string& contact_id) OVERRIDE; 87 virtual const Contact* GetContactById(const std::string& contact_id) OVERRIDE;
88 virtual void AddObserver(ContactStoreObserver* observer) OVERRIDE; 88 virtual void AddObserver(ContactStoreObserver* observer) OVERRIDE;
89 virtual void RemoveObserver(ContactStoreObserver* observer) OVERRIDE; 89 virtual void RemoveObserver(ContactStoreObserver* observer) OVERRIDE;
90 90
91 // net::NetworkChangeNotifier::ConnectionTypeObserver implementation: 91 // net::NetworkChangeNotifier::NetworkChangeObserver implementation:
92 virtual void OnConnectionTypeChanged( 92 virtual void OnNetworkChanged(
93 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; 93 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
94 94
95 private: 95 private:
96 // Returns the current time. Uses |current_time_for_testing_| instead if it's 96 // Returns the current time. Uses |current_time_for_testing_| instead if it's
97 // set. 97 // set.
98 base::Time GetCurrentTime() const; 98 base::Time GetCurrentTime() const;
99 99
100 // Destroys |db_| if non-NULL and resets the pointer. 100 // Destroys |db_| if non-NULL and resets the pointer.
101 // The underlying data is preserved on-disk. 101 // The underlying data is preserved on-disk.
102 void DestroyDatabase(); 102 void DestroyDatabase();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 virtual bool CanCreateContactStoreForProfile(Profile* profile) OVERRIDE; 194 virtual bool CanCreateContactStoreForProfile(Profile* profile) OVERRIDE;
195 virtual ContactStore* CreateContactStore(Profile* profile) OVERRIDE; 195 virtual ContactStore* CreateContactStore(Profile* profile) OVERRIDE;
196 196
197 private: 197 private:
198 DISALLOW_COPY_AND_ASSIGN(GoogleContactStoreFactory); 198 DISALLOW_COPY_AND_ASSIGN(GoogleContactStoreFactory);
199 }; 199 };
200 200
201 } // namespace contacts 201 } // namespace contacts
202 202
203 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_GOOGLE_CONTACT_STORE_H_ 203 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_GOOGLE_CONTACT_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698