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

Side by Side Diff: components/autofill/core/browser/webdata/autofill_table.h

Issue 772253003: Create an autofill Suggestion class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 6 years 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
OLDNEW
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 <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // of a short description and an ID, but not full payment 131 // of a short description and an ID, but not full payment
132 // information. Writing to this table is only done by sync. 132 // information. Writing to this table is only done by sync.
133 // When a server card is unmasked, it will stay here and 133 // When a server card is unmasked, it will stay here and
134 // will additionally be added in unmasked_credit_cards. 134 // will additionally be added in unmasked_credit_cards.
135 // 135 //
136 // id String assigned by the server to identify this card. 136 // id String assigned by the server to identify this card.
137 // This is opaque to the client. 137 // This is opaque to the client.
138 // status Server's status of this card. 138 // status Server's status of this card.
139 // TODO(brettw) define constants for this. 139 // TODO(brettw) define constants for this.
140 // name_on_card 140 // name_on_card
141 // type Type of the credit card. 141 // type Type of the credit card. This is one of the
142 // TODO(brettw) define constants for this. 142 // kSyncCardType* strings.
143 // last_four Last four digits of the card number. For de-duping 143 // last_four Last four digits of the card number. For de-duping
144 // with locally stored cards and generating descriptions. 144 // with locally stored cards and generating descriptions.
145 // exp_month Expiration month: 1-12 145 // exp_month Expiration month: 1-12
146 // exp_year Four-digit year: 2017 146 // exp_year Four-digit year: 2017
147 // 147 //
148 // unmasked_credit_cards 148 // unmasked_credit_cards
149 // When a masked credit credit card is unmasked and the 149 // When a masked credit credit card is unmasked and the
150 // full number is downloaded, it will be stored here. 150 // full number is downloaded, it will be stored here.
151 // 151 //
152 // id Server ID. This can be joined with the id in the 152 // id Server ID. This can be joined with the id in the
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 bool UpdateCreditCard(const CreditCard& credit_card); 273 bool UpdateCreditCard(const CreditCard& credit_card);
274 274
275 // Removes a row from the credit_cards table. |guid| is the identifer of the 275 // Removes a row from the credit_cards table. |guid| is the identifer of the
276 // credit card to remove. 276 // credit card to remove.
277 bool RemoveCreditCard(const std::string& guid); 277 bool RemoveCreditCard(const std::string& guid);
278 278
279 // Retrieves a credit card with guid |guid|. The caller owns 279 // Retrieves a credit card with guid |guid|. The caller owns
280 // |credit_card_id|. 280 // |credit_card_id|.
281 bool GetCreditCard(const std::string& guid, CreditCard** credit_card); 281 bool GetCreditCard(const std::string& guid, CreditCard** credit_card);
282 282
283 // Retrieves all credit cards in the database. Caller owns the returned 283 // Retrieves all local credit cards in the database. Caller owns the returned
284 // credit cards. 284 // credit cards.
285 virtual bool GetCreditCards(std::vector<CreditCard*>* credit_cards); 285 virtual bool GetCreditCards(std::vector<CreditCard*>* credit_cards);
286 286
287 // Returns the wallet cards synced from the server. These might be of type
288 // MASKED_WALLET_CARD and will need an extra round-trip to unmask, or they
289 // might be FULL_WALLET_CARD.
290 bool GetWalletCreditCards(std::vector<CreditCard*>* credit_cards);
291
292 // Cards synced from Wallet may be "masked" (only last 4 digits available)
293 // or "unmasked" (everything is available). These functions set that
294 // state.
295 void UnmaskWalletCreditCard(const std::string& id,
296 const base::string16& full_number);
297 void MaskWalletCreditCard(const std::string& id);
298
287 // Removes rows from autofill_profiles and credit_cards if they were created 299 // Removes rows from autofill_profiles and credit_cards if they were created
288 // on or after |delete_begin| and strictly before |delete_end|. Returns the 300 // on or after |delete_begin| and strictly before |delete_end|. Returns the
289 // list of deleted profile guids in |profile_guids|. Return value is true if 301 // list of deleted profile guids in |profile_guids|. Return value is true if
290 // all rows were successfully removed. Returns false on database error. In 302 // all rows were successfully removed. Returns false on database error. In
291 // that case, the output vector state is undefined, and may be partially 303 // that case, the output vector state is undefined, and may be partially
292 // filled. 304 // filled.
293 bool RemoveAutofillDataModifiedBetween( 305 bool RemoveAutofillDataModifiedBetween(
294 const base::Time& delete_begin, 306 const base::Time& delete_begin,
295 const base::Time& delete_end, 307 const base::Time& delete_end,
296 std::vector<std::string>* profile_guids, 308 std::vector<std::string>* profile_guids,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 // created (on the UI thread), and cached here so that it can be used for 429 // created (on the UI thread), and cached here so that it can be used for
418 // migrations (on the DB thread). 430 // migrations (on the DB thread).
419 std::string app_locale_; 431 std::string app_locale_;
420 432
421 DISALLOW_COPY_AND_ASSIGN(AutofillTable); 433 DISALLOW_COPY_AND_ASSIGN(AutofillTable);
422 }; 434 };
423 435
424 } // namespace autofill 436 } // namespace autofill
425 437
426 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ 438 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698