OLD | NEW |
(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_AUTOCOMPLETE_CONTACT_PROVIDER_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_CONTACT_PROVIDER_CHROMEOS_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
| 13 #include "chrome/browser/chromeos/contacts/contact_manager_observer.h" |
| 14 |
| 15 class AutocompleteInput; |
| 16 |
| 17 namespace contacts { |
| 18 class ContactManager; |
| 19 } |
| 20 |
| 21 class ContactProvider : public AutocompleteProvider, |
| 22 public contacts::ContactManagerObserver { |
| 23 public: |
| 24 ContactProvider(AutocompleteProviderListener* listener, Profile* profile); |
| 25 |
| 26 // AutocompleteProvider overrides: |
| 27 virtual void Start(const AutocompleteInput& input, |
| 28 bool minimal_changes) OVERRIDE; |
| 29 |
| 30 // contacts::ContactManagerObserver overrides: |
| 31 virtual void OnContactsUpdated(contacts::ContactManager* manager) OVERRIDE; |
| 32 |
| 33 private: |
| 34 struct ContactData { |
| 35 ContactData(const std::string& name, const std::string& provider_id); |
| 36 |
| 37 // Name used for matching. |
| 38 std::string name; |
| 39 |
| 40 // Unique ID ("provider" here refers to the original provider of the contact |
| 41 // data, not this ContactProvider class). |
| 42 std::string provider_id; |
| 43 }; |
| 44 typedef std::vector<ContactData> ContactDataVector; |
| 45 |
| 46 virtual ~ContactProvider(); |
| 47 |
| 48 void RefreshContacts(contacts::ContactManager* manager); |
| 49 |
| 50 // Contacts that we'll search through. |
| 51 ContactDataVector contacts_; |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(ContactProvider); |
| 54 }; |
| 55 |
| 56 #endif // CHROME_BROWSER_AUTOCOMPLETE_CONTACT_PROVIDER_CHROMEOS_H_ |
OLD | NEW |