OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_AUTOFILL_PERSONAL_DATA_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_PERSONAL_DATA_MANAGER_H_ |
6 #define CHROME_BROWSER_AUTOFILL_PERSONAL_DATA_MANAGER_H_ | 6 #define CHROME_BROWSER_AUTOFILL_PERSONAL_DATA_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 // Gets the possible field types for the given text, determined by matching | 126 // Gets the possible field types for the given text, determined by matching |
127 // the text with all known personal information and returning matching types. | 127 // the text with all known personal information and returning matching types. |
128 void GetPossibleFieldTypes(const string16& text, | 128 void GetPossibleFieldTypes(const string16& text, |
129 FieldTypeSet* possible_types); | 129 FieldTypeSet* possible_types); |
130 | 130 |
131 // Returns true if the credit card information is stored with a password. | 131 // Returns true if the credit card information is stored with a password. |
132 bool HasPassword(); | 132 bool HasPassword(); |
133 | 133 |
134 // Returns whether the personal data has been loaded from the web database. | 134 // Returns whether the personal data has been loaded from the web database. |
135 virtual bool IsDataLoaded() const { return is_data_loaded_; } | 135 virtual bool IsDataLoaded() const; |
136 | 136 |
137 // This PersonalDataManager owns these profiles and credit cards. Their | 137 // This PersonalDataManager owns these profiles and credit cards. Their |
138 // lifetime is until the web database is updated with new profile and credit | 138 // lifetime is until the web database is updated with new profile and credit |
139 // card information, respectively. |profiles()| returns both web and | 139 // card information, respectively. |profiles()| returns both web and |
140 // auxiliary profiles. |web_profiles()| returns only web profiles. | 140 // auxiliary profiles. |web_profiles()| returns only web profiles. |
141 const std::vector<AutoFillProfile*>& profiles(); | 141 const std::vector<AutoFillProfile*>& profiles(); |
142 virtual const std::vector<AutoFillProfile*>& web_profiles() { | 142 virtual const std::vector<AutoFillProfile*>& web_profiles(); |
143 return web_profiles_.get(); | 143 virtual const std::vector<CreditCard*>& credit_cards(); |
144 } | |
145 virtual const std::vector<CreditCard*>& credit_cards() { | |
146 return credit_cards_.get(); | |
147 } | |
148 | 144 |
149 // Creates a profile labeled |label|. | 145 // Creates a profile labeled |label|. |
150 // This must be called on the DB thread with the expectation that the | 146 // This must be called on the DB thread with the expectation that the |
151 // returned form will be synchronously persisted to the WebDatabase. See | 147 // returned form will be synchronously persisted to the WebDatabase. See |
152 // Refresh and SetProfiles for details. | 148 // Refresh and SetProfiles for details. |
153 AutoFillProfile* CreateNewEmptyAutoFillProfileForDBThread( | 149 AutoFillProfile* CreateNewEmptyAutoFillProfileForDBThread( |
154 const string16& label); | 150 const string16& label); |
155 | 151 |
156 // Re-loads profiles and credit cards from the WebDatabase asynchronously. | 152 // Re-loads profiles and credit cards from the WebDatabase asynchronously. |
157 // In the general case, this is a no-op and will re-create the same | 153 // In the general case, this is a no-op and will re-create the same |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 WebDataService::Handle pending_profiles_query_; | 244 WebDataService::Handle pending_profiles_query_; |
249 WebDataService::Handle pending_creditcards_query_; | 245 WebDataService::Handle pending_creditcards_query_; |
250 | 246 |
251 // The observers. | 247 // The observers. |
252 ObserverList<Observer> observers_; | 248 ObserverList<Observer> observers_; |
253 | 249 |
254 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); | 250 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); |
255 }; | 251 }; |
256 | 252 |
257 #endif // CHROME_BROWSER_AUTOFILL_PERSONAL_DATA_MANAGER_H_ | 253 #endif // CHROME_BROWSER_AUTOFILL_PERSONAL_DATA_MANAGER_H_ |
OLD | NEW |