// Copyright 2013 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_CREDIT_CARD_H_ #define COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_CREDIT_CARD_H_ #include <iosfwd> #include <string> #include <string_view> #include <utility> #include "base/gtest_prod_util.h" #include "base/time/time.h" #include "build/build_config.h" #include "components/autofill/core/browser/data_model/autofill_data_model.h" #include "components/autofill/core/browser/ui/suggestion.h" #include "url/gurl.h" namespace autofill { // Unicode characters used in card number obfuscation: // - \u2022 - Bullet. // - \u2006 - SIX-PER-EM SPACE (small space between bullets). // - \u2060 - WORD-JOINER (makes obfuscated string indivisible). inline constexpr char16_t kMidlineEllipsisDot[] = …; inline constexpr char16_t kMidlineEllipsisPlainDot = …; struct PaymentsMetadata; namespace internal { // Returns an obfuscated representation of a credit card number given its last // digits. To ensure that the obfuscation is placed at the left of the last four // digits, even for RTL languages, inserts a Left-To-Right Embedding mark at the // beginning and a Pop Directional Formatting mark at the end. // `obfuscation_length` determines the number of dots to placed before the // digits. Exposed for testing. std::u16string GetObfuscatedStringForCardDigits(const std::u16string& digits, int obfuscation_length); } // namespace internal // A form group that stores card information. class CreditCard : public AutofillDataModel { … }; // So we can compare CreditCards with EXPECT_EQ(). std::ostream& operator<<(std::ostream& os, const CreditCard& credit_card); } // namespace autofill #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_DATA_MODEL_CREDIT_CARD_H_