OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "components/webdata/common/web_database_table.h" | 17 #include "components/webdata/common/web_database_table.h" |
18 | 18 |
19 class WebDatabase; | 19 class WebDatabase; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class Time; | 22 class Time; |
23 } | 23 } |
24 | 24 |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 virtual bool AddAutofillProfile(const AutofillProfile& profile); | 300 virtual bool AddAutofillProfile(const AutofillProfile& profile); |
301 | 301 |
302 // Updates the database values for the specified profile. Mulit-value aware. | 302 // Updates the database values for the specified profile. Mulit-value aware. |
303 virtual bool UpdateAutofillProfile(const AutofillProfile& profile); | 303 virtual bool UpdateAutofillProfile(const AutofillProfile& profile); |
304 | 304 |
305 // Removes a row from the autofill_profiles table. |guid| is the identifier | 305 // Removes a row from the autofill_profiles table. |guid| is the identifier |
306 // of the profile to remove. | 306 // of the profile to remove. |
307 virtual bool RemoveAutofillProfile(const std::string& guid); | 307 virtual bool RemoveAutofillProfile(const std::string& guid); |
308 | 308 |
309 // Retrieves a profile with guid |guid|. | 309 // Retrieves a profile with guid |guid|. |
310 scoped_ptr<AutofillProfile> GetAutofillProfile(const std::string& guid); | 310 std::unique_ptr<AutofillProfile> GetAutofillProfile(const std::string& guid); |
311 | 311 |
312 // Retrieves local/server profiles in the database. Caller owns the returned | 312 // Retrieves local/server profiles in the database. Caller owns the returned |
313 // profiles. | 313 // profiles. |
314 // TODO(thestig): Convert to scopers. | 314 // TODO(thestig): Convert to scopers. |
315 virtual bool GetAutofillProfiles(std::vector<AutofillProfile*>* profiles); | 315 virtual bool GetAutofillProfiles(std::vector<AutofillProfile*>* profiles); |
316 virtual bool GetServerProfiles(std::vector<AutofillProfile*>* profiles); | 316 virtual bool GetServerProfiles(std::vector<AutofillProfile*>* profiles); |
317 | 317 |
318 // Sets the server profiles. All old profiles are deleted and replaced with | 318 // Sets the server profiles. All old profiles are deleted and replaced with |
319 // the given ones. | 319 // the given ones. |
320 void SetServerProfiles(const std::vector<AutofillProfile>& profiles); | 320 void SetServerProfiles(const std::vector<AutofillProfile>& profiles); |
321 | 321 |
322 // Records a single credit card in the credit_cards table. | 322 // Records a single credit card in the credit_cards table. |
323 bool AddCreditCard(const CreditCard& credit_card); | 323 bool AddCreditCard(const CreditCard& credit_card); |
324 | 324 |
325 // Updates the database values for the specified credit card. | 325 // Updates the database values for the specified credit card. |
326 bool UpdateCreditCard(const CreditCard& credit_card); | 326 bool UpdateCreditCard(const CreditCard& credit_card); |
327 | 327 |
328 // Removes a row from the credit_cards table. |guid| is the identifer of the | 328 // Removes a row from the credit_cards table. |guid| is the identifer of the |
329 // credit card to remove. | 329 // credit card to remove. |
330 bool RemoveCreditCard(const std::string& guid); | 330 bool RemoveCreditCard(const std::string& guid); |
331 | 331 |
332 // Retrieves a credit card with guid |guid|. | 332 // Retrieves a credit card with guid |guid|. |
333 scoped_ptr<CreditCard> GetCreditCard(const std::string& guid); | 333 std::unique_ptr<CreditCard> GetCreditCard(const std::string& guid); |
334 | 334 |
335 // Retrieves the local/server credit cards in the database. Caller owns the | 335 // Retrieves the local/server credit cards in the database. Caller owns the |
336 // returned credit cards. | 336 // returned credit cards. |
337 // TODO(thestig): Convert to scopers. | 337 // TODO(thestig): Convert to scopers. |
338 virtual bool GetCreditCards(std::vector<CreditCard*>* credit_cards); | 338 virtual bool GetCreditCards(std::vector<CreditCard*>* credit_cards); |
339 virtual bool GetServerCreditCards(std::vector<CreditCard*>* credit_cards); | 339 virtual bool GetServerCreditCards(std::vector<CreditCard*>* credit_cards); |
340 | 340 |
341 // Replaces all server credit cards with the given vector. Unmasked cards | 341 // Replaces all server credit cards with the given vector. Unmasked cards |
342 // present in the new list will be preserved (even if the input is MASKED). | 342 // present in the new list will be preserved (even if the input is MASKED). |
343 void SetServerCreditCards(const std::vector<CreditCard>& credit_cards); | 343 void SetServerCreditCards(const std::vector<CreditCard>& credit_cards); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 bool InitServerCardMetadataTable(); | 485 bool InitServerCardMetadataTable(); |
486 bool InitServerAddressesTable(); | 486 bool InitServerAddressesTable(); |
487 bool InitServerAddressMetadataTable(); | 487 bool InitServerAddressMetadataTable(); |
488 | 488 |
489 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 489 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
490 }; | 490 }; |
491 | 491 |
492 } // namespace autofill | 492 } // namespace autofill |
493 | 493 |
494 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 494 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
OLD | NEW |