| 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_CONTACT_PROVIDER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_CONTACT_PROVIDER_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_CONTACT_PROVIDER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_CONTACT_PROVIDER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 static bool CompareAffinity(const ContactData& a, const ContactData& b); | 52 static bool CompareAffinity(const ContactData& a, const ContactData& b); |
| 53 | 53 |
| 54 // Updates |contacts_| to match the contacts currently reported by | 54 // Updates |contacts_| to match the contacts currently reported by |
| 55 // ContactManager. | 55 // ContactManager. |
| 56 void RefreshContacts(); | 56 void RefreshContacts(); |
| 57 | 57 |
| 58 // Adds an AutocompleteMatch object for |contact| to |matches_| if |contact| | 58 // Adds an AutocompleteMatch object for |contact| to |matches_| if |contact| |
| 59 // is matched by |input|. |input_words| is |input.text()| split on word | 59 // is matched by |input|. |input_words| is |input.text()| split on word |
| 60 // boundaries. | 60 // boundaries. |
| 61 void AddContactIfMatched(const AutocompleteInput& input, | 61 void AddContactIfMatched(const AutocompleteInput& input, |
| 62 const std::vector<string16>& input_words, | 62 const std::vector<base::string16>& input_words, |
| 63 const ContactData& contact); | 63 const ContactData& contact); |
| 64 | 64 |
| 65 // Returns an AutocompleteMatch object corresponding to the passed-in data. | 65 // Returns an AutocompleteMatch object corresponding to the passed-in data. |
| 66 AutocompleteMatch CreateAutocompleteMatch(const AutocompleteInput& input, | 66 AutocompleteMatch CreateAutocompleteMatch(const AutocompleteInput& input, |
| 67 const ContactData& contact); | 67 const ContactData& contact); |
| 68 | 68 |
| 69 base::WeakPtr<contacts::ContactManagerInterface> contact_manager_; | 69 base::WeakPtr<contacts::ContactManagerInterface> contact_manager_; |
| 70 | 70 |
| 71 // Contacts through which we search, ordered by descending affinity. | 71 // Contacts through which we search, ordered by descending affinity. |
| 72 ContactDataVector contacts_; | 72 ContactDataVector contacts_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(ContactProvider); | 74 DISALLOW_COPY_AND_ASSIGN(ContactProvider); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 #endif // CHROME_BROWSER_AUTOCOMPLETE_CONTACT_PROVIDER_CHROMEOS_H_ | 77 #endif // CHROME_BROWSER_AUTOCOMPLETE_CONTACT_PROVIDER_CHROMEOS_H_ |
| OLD | NEW |