| Commit-Queue | +1 |
Hi Qihui, could you please review this CL? Thank you!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
options.source_feature = SourceFeature::kScanCardSaveAndFill;Here and below, use the helper method [here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/payments/payments_autofill_client.h;drc=56c66e417c83e2096a4e4e8a5c4ab7bbd525c9f3;l=206).
options.show_prompt = true;Here and below, I don't think we need to set bool, `ShouldShowSaveCardBottomSheet` in autofill_save_card_ui_info will return true on `kScanCardSaveAndFill`.
AutofillSaveCardUiInfo::CreateForLocalSave(options, card),Here and below, when creating the AutofillSaveCardUiInfo, there are a lot of settings that needs card fields [here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/payments/autofill_save_card_ui_info.cc;drc=56c66e417c83e2096a4e4e8a5c4ab7bbd525c9f3;l=107), will it crash on empty field?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
options.source_feature = SourceFeature::kScanCardSaveAndFill;Here and below, use the helper method [here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/payments/payments_autofill_client.h;drc=56c66e417c83e2096a4e4e8a5c4ab7bbd525c9f3;l=206).
Done
Here and below, I don't think we need to set bool, `ShouldShowSaveCardBottomSheet` in autofill_save_card_ui_info will return true on `kScanCardSaveAndFill`.
Done
AutofillSaveCardUiInfo::CreateForLocalSave(options, card),Here and below, when creating the AutofillSaveCardUiInfo, there are a lot of settings that needs card fields [here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/payments/autofill_save_card_ui_info.cc;drc=56c66e417c83e2096a4e4e8a5c4ab7bbd525c9f3;l=107), will it crash on empty field?
Passing a default-constructed CreditCard object will not cause a crash.
1. Methods like NetworkForDisplay() or NetworkAndLastFourDigits() all return a std::u16string by value, not by pointer, so there is no risk of a null-pointer dereference.
2. AutofillSaveCardUiInfo simply copies this empty std::u16string into its card_network property.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
AutofillSaveCardUiInfo::CreateForLocalSave(options, card),yiwen qianHere and below, when creating the AutofillSaveCardUiInfo, there are a lot of settings that needs card fields [here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/payments/autofill_save_card_ui_info.cc;drc=56c66e417c83e2096a4e4e8a5c4ab7bbd525c9f3;l=107), will it crash on empty field?
Passing a default-constructed CreditCard object will not cause a crash.
1. Methods like NetworkForDisplay() or NetworkAndLastFourDigits() all return a std::u16string by value, not by pointer, so there is no risk of a null-pointer dereference.
2. AutofillSaveCardUiInfo simply copies this empty std::u16string into its card_network property.
Here and below the default `card` sounds not necessary confused. How about overload a method `CreateForLocalSave` autofill_save_card_ui_info without `card` as a parameter, so that most of the logic can be reused (set strings/button_text, etc), and only call [here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/payments/autofill_save_card_ui_info.cc;drc=64820206068b8feaf4b9d4de22362cfcf047b8b6;l=219) for the method with `card` parameter.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
AutofillSaveCardUiInfo::CreateForLocalSave(options, card),yiwen qianHere and below, when creating the AutofillSaveCardUiInfo, there are a lot of settings that needs card fields [here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/payments/autofill_save_card_ui_info.cc;drc=56c66e417c83e2096a4e4e8a5c4ab7bbd525c9f3;l=107), will it crash on empty field?
Qihui ZhaoPassing a default-constructed CreditCard object will not cause a crash.
1. Methods like NetworkForDisplay() or NetworkAndLastFourDigits() all return a std::u16string by value, not by pointer, so there is no risk of a null-pointer dereference.
2. AutofillSaveCardUiInfo simply copies this empty std::u16string into its card_network property.
Here and below the default `card` sounds not necessary confused. How about overload a method `CreateForLocalSave` autofill_save_card_ui_info without `card` as a parameter, so that most of the logic can be reused (set strings/button_text, etc), and only call [here](https://source.chromium.org/chromium/chromium/src/+/main:components/autofill/core/browser/payments/autofill_save_card_ui_info.cc;drc=64820206068b8feaf4b9d4de22362cfcf047b8b6;l=219) for the method with `card` parameter.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
ASSERT_TRUE(model);Can we tell the legal message is set somewhere or this flow is for upload save, otherwise, the test seems to be duplicated.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi Tommy, could you please review this CL? Thank you!
Can we tell the legal message is set somewhere or this flow is for upload save, otherwise, the test seems to be duplicated.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |