|
|
Created:
4 years, 1 month ago by gogerald1 Modified:
4 years, 1 month ago CC:
chromium-reviews, rouslan+autofill_chromium.org, browser-components-watch_chromium.org, jdonnelly+autofillwatch_chromium.org, rouslan+payments_chromium.org, agrieve+watch_chromium.org, vabr+watchlistautofill_chromium.org, estade+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionShow the icon for the typed in credit card in editor
BUG=657178
Committed: https://crrev.com/7f1a60f6847ee8063df797738a37b9ab299026d5
Committed: https://crrev.com/fdf42fb9c2987cd86ac15e5963af0ad0f0153456
Cr-Original-Commit-Position: refs/heads/master@{#428359}
Cr-Commit-Position: refs/heads/master@{#428797}
Patch Set 1 #
Total comments: 14
Patch Set 2 : address comments and enable value icon before layout #
Total comments: 12
Patch Set 3 : address Dfalcantara@'s comments #Patch Set 4 : auto scale icon width to keep aspect ratio #
Total comments: 2
Patch Set 5 : fix assertion error and reland #Messages
Total messages: 74 (50 generated)
Description was changed from ========== draft BUG= ========== to ========== Show the icon for the typed in credit card in editor BUG=657178 ==========
Patchset #1 (id:1) has been deleted
Patchset #1 (id:20001) has been deleted
Patchset #1 (id:40001) has been deleted
Patchset #1 (id:60001) has been deleted
Patchset #2 (id:100001) has been deleted
The CQ bit was checked by gogerald@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #1 (id:80001) has been deleted
The CQ bit was checked by gogerald@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Patchset #1 (id:120001) has been deleted
Patchset #1 (id:140001) has been deleted
The CQ bit was checked by gogerald@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
gogerald@chromium.org changed reviewers: + rouslan@chromium.org
gogerald@chromium.org changed reviewers: + rouslan@chromium.org
Hi, PTAL,
Hi, PTAL,
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java (right): https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:41: */ Comment indentation https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:47: */ Ditto https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:122: @Nullable private Runnable mActionIconAction; Why this rename? https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:299: * @return The icon resource Id for the value in this field. This whole comment can fit on the same line: /** @return The icon resource identifier for the value in this field. */ https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:306: return 0; Yo can reduce the number of lines here: return mValueIconGenerator == null ? 0 : mValueIconGenerator.getIconResourceId(mValue); https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java (right): https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java:40: private int mValueIconId = 0; 0 is the default value for Java ints, so there's no need to explicitly assign 0 to this variable. https://codereview.chromium.org/2442933003/diff/160001/chrome/browser/autofil... File chrome/browser/autofill/android/personal_data_manager_android.cc (right): https://codereview.chromium.org/2442933003/diff/160001/chrome/browser/autofil... chrome/browser/autofill/android/personal_data_manager_android.cc:509: .basic_card_payment_type); You can reduce the number of lines by 1 here. Up to you which style you prefer. return ConvertUTF8ToJavaString( env, static_cast<bool>(jempty_if_invalid) && !IsValidCreditCardNumber(card_number) ? "" : data_util::GetPaymentRequestData( CreditCard::GetCreditCardType(card_number)) .basic_card_payment_type);
gogerald@chromium.org changed reviewers: + dfalcantara@chromium.org, mathp@chromium.org
mathp@chromium.org: Please review changes in chrome/browser/autofill/* dfalcantara@chromium.org: Please review changes in chrome/android/* Note that I've updated the interface to enable value icon in construction align with action icon. In addition, if both icons are gone in the linearlayout before layout, then I can not easily enable it later. https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java (right): https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:41: */ On 2016/10/25 17:48:18, rouslan wrote: > Comment indentation Done. https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:47: */ On 2016/10/25 17:48:18, rouslan wrote: > Ditto Done. https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:122: @Nullable private Runnable mActionIconAction; On 2016/10/25 17:48:18, rouslan wrote: > Why this rename? Now there are two icons may display at the same time, so I want distinguish it by 'ActionIcon' and 'ValueIcon'. https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:299: * @return The icon resource Id for the value in this field. On 2016/10/25 17:48:18, rouslan wrote: > This whole comment can fit on the same line: > > /** @return The icon resource identifier for the value in this field. */ Done. https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:306: return 0; On 2016/10/25 17:48:18, rouslan wrote: > Yo can reduce the number of lines here: > > return mValueIconGenerator == null ? 0 : > mValueIconGenerator.getIconResourceId(mValue); Done. The implementation changed. https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java (right): https://codereview.chromium.org/2442933003/diff/160001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java:40: private int mValueIconId = 0; On 2016/10/25 17:48:18, rouslan wrote: > 0 is the default value for Java ints, so there's no need to explicitly assign 0 > to this variable. Done. https://codereview.chromium.org/2442933003/diff/160001/chrome/browser/autofil... File chrome/browser/autofill/android/personal_data_manager_android.cc (right): https://codereview.chromium.org/2442933003/diff/160001/chrome/browser/autofil... chrome/browser/autofill/android/personal_data_manager_android.cc:509: .basic_card_payment_type); On 2016/10/25 17:48:18, rouslan wrote: > You can reduce the number of lines by 1 here. Up to you which style you prefer. > > return ConvertUTF8ToJavaString( > env, static_cast<bool>(jempty_if_invalid) && > !IsValidCreditCardNumber(card_number) > ? "" > : data_util::GetPaymentRequestData( > CreditCard::GetCreditCardType(card_number)) > .basic_card_payment_type); Acknowledged. Looks more readable by separating them.
The CQ bit was checked by gogerald@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... File chrome/android/java/res/layout/payments_request_editor_textview.xml (right): https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... chrome/android/java/res/layout/payments_request_editor_textview.xml:33: android:layout_width="37.3dp" We don't use a fractional DP anywhere in Clank because it'd make things blurry. I've poked the bug about it. https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... chrome/android/java/res/layout/payments_request_editor_textview.xml:36: android:layout_marginBottom="12dp" Instead of setting this margin top and bottom, can't you just set the gravity so that it's vertically centered? https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... chrome/android/java/res/layout/payments_request_editor_textview.xml:37: android:layout_marginStart="8dp" This margin start should be on the parent layout instead because it really applies to the whole layout and not just this control. https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java (right): https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java:73: mIconsLayer.getWidth(), mInput.getPaddingBottom()); getMeasuredWidth()? I don't know if this call happens before or after the View has properly been laid out, so getWidth() could return the wrong number. https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java:253: int iconId = mEditorFieldModel.getValueIconGenerator().getIconResourceId(mInput.getText()); Can't getValueIconGenerator return null, in general? I know that getValueIconGenerator shouldn't be null if the mValueIcon isn't null in the callers, but you should move that check into this function in case a new call location is added.
autofill bits lgtm
Patchset #3 (id:200001) has been deleted
https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... File chrome/android/java/res/layout/payments_request_editor_textview.xml (right): https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... chrome/android/java/res/layout/payments_request_editor_textview.xml:33: android:layout_width="37.3dp" On 2016/10/26 17:22:51, dfalcantara (slow 10.24) wrote: > We don't use a fractional DP anywhere in Clank because it'd make things blurry. > I've poked the bug about it. Keep it according to Hwi@'s feedback https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... chrome/android/java/res/layout/payments_request_editor_textview.xml:36: android:layout_marginBottom="12dp" On 2016/10/26 17:22:51, dfalcantara (slow 10.24) wrote: > Instead of setting this margin top and bottom, can't you just set the gravity so > that it's vertically centered? Done. https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... chrome/android/java/res/layout/payments_request_editor_textview.xml:37: android:layout_marginStart="8dp" On 2016/10/26 17:22:51, dfalcantara (slow 10.24) wrote: > This margin start should be on the parent layout instead because it really > applies to the whole layout and not just this control. There might be a future situation that below action icon exist but this icon do not exist. Then there is already 12dp padding in below icon (for layout and touch space), we might do not want 8dp additional margin. https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java (right): https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java:73: mIconsLayer.getWidth(), mInput.getPaddingBottom()); On 2016/10/26 17:22:52, dfalcantara (slow 10.24) wrote: > getMeasuredWidth()? I don't know if this call happens before or after the View > has properly been laid out, so getWidth() could return the wrong number. It happens after layout from the source code, 'public void layout(int l, int t, int r, int b)' -> https://github.com/android/platform_frameworks_base/blob/master/core/java/and... I've also verified it through log. https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java:253: int iconId = mEditorFieldModel.getValueIconGenerator().getIconResourceId(mInput.getText()); On 2016/10/26 17:22:52, dfalcantara (slow 10.24) wrote: > Can't getValueIconGenerator return null, in general? I know that > getValueIconGenerator shouldn't be null if the mValueIcon isn't null in the > callers, but you should move that check into this function in case a new call > location is added. Done. moved if(mValueIcon == null) in this function.
https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... File chrome/android/java/res/layout/payments_request_editor_textview.xml (right): https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... chrome/android/java/res/layout/payments_request_editor_textview.xml:33: android:layout_width="37.3dp" On 2016/10/27 19:01:35, gogerald1 wrote: > On 2016/10/26 17:22:51, dfalcantara (slow 10.24) wrote: > > We don't use a fractional DP anywhere in Clank because it'd make things > blurry. > > I've poked the bug about it. > > Keep it according to Hwi@'s feedback Her feedback said she was crazy when she set it :P Set it to 37.
https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... File chrome/android/java/res/layout/payments_request_editor_textview.xml (right): https://codereview.chromium.org/2442933003/diff/180001/chrome/android/java/re... chrome/android/java/res/layout/payments_request_editor_textview.xml:33: android:layout_width="37.3dp" On 2016/10/27 20:14:41, dfalcantara (slow 10.24) wrote: > On 2016/10/27 19:01:35, gogerald1 wrote: > > On 2016/10/26 17:22:51, dfalcantara (slow 10.24) wrote: > > > We don't use a fractional DP anywhere in Clank because it'd make things > > blurry. > > > I've poked the bug about it. > > > > Keep it according to Hwi@'s feedback > > Her feedback said she was crazy when she set it :P Set it to 37. After talking to Hwi@, the same icon will be used in two places for different size and it is better to keep it's aspect ratio, so I set the height to 24dp and auto scales it's width to keep aspect ratio.
lgtm
The CQ bit was checked by gogerald@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by gogerald@chromium.org
The CQ bit was checked by gogerald@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from mathp@chromium.org, rouslan@chromium.org Link to the patchset: https://codereview.chromium.org/2442933003/#ps240001 (title: "auto scale icon width to keep aspect ratio")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by gogerald@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by gogerald@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Show the icon for the typed in credit card in editor BUG=657178 ========== to ========== Show the icon for the typed in credit card in editor BUG=657178 ==========
Message was sent while issue was closed.
Committed patchset #4 (id:240001)
Message was sent while issue was closed.
Description was changed from ========== Show the icon for the typed in credit card in editor BUG=657178 ========== to ========== Show the icon for the typed in credit card in editor BUG=657178 Committed: https://crrev.com/7f1a60f6847ee8063df797738a37b9ab299026d5 Cr-Commit-Position: refs/heads/master@{#428359} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/7f1a60f6847ee8063df797738a37b9ab299026d5 Cr-Commit-Position: refs/heads/master@{#428359}
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:240001) has been created in https://codereview.chromium.org/2456053007/ by xidachen@chromium.org. The reason for reverting is: Cause test failure: https://uberchromegw.corp.google.com/i/chromium.linux/builders/Android%20Test....
Message was sent while issue was closed.
The reason for the assert failure. https://codereview.chromium.org/2442933003/diff/240001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java (right): https://codereview.chromium.org/2442933003/diff/240001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:300: assert mInputTypeHint == INPUT_TYPE_HINT_CREDIT_CARD; This line really should be "assert isTextField();" because EditorTextField.java checks every model for "getValueIconGenerator() != null".
Message was sent while issue was closed.
gogerald@google.com changed reviewers: + gogerald@google.com
Message was sent while issue was closed.
https://codereview.chromium.org/2442933003/diff/240001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java (right): https://codereview.chromium.org/2442933003/diff/240001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorFieldModel.java:300: assert mInputTypeHint == INPUT_TYPE_HINT_CREDIT_CARD; On 2016/10/31 18:25:35, rouslan wrote: > This line really should be "assert isTextField();" because EditorTextField.java > checks every model for "getValueIconGenerator() != null". Highly possible, relanding in this CL https://codereview.chromium.org/2468603002/. Thanks for looking it :).
Message was sent while issue was closed.
Description was changed from ========== Show the icon for the typed in credit card in editor BUG=657178 Committed: https://crrev.com/7f1a60f6847ee8063df797738a37b9ab299026d5 Cr-Commit-Position: refs/heads/master@{#428359} ========== to ========== Show the icon for the typed in credit card in editor BUG=657178 Committed: https://crrev.com/7f1a60f6847ee8063df797738a37b9ab299026d5 Cr-Commit-Position: refs/heads/master@{#428359} ==========
The CQ bit was checked by gogerald@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by gogerald@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from mathp@chromium.org, rouslan@chromium.org, dfalcantara@chromium.org Link to the patchset: https://codereview.chromium.org/2442933003/#ps260001 (title: "fix assertion error and reland")
The CQ bit was unchecked by gogerald@chromium.org
The CQ bit was checked by gogerald@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Show the icon for the typed in credit card in editor BUG=657178 Committed: https://crrev.com/7f1a60f6847ee8063df797738a37b9ab299026d5 Cr-Commit-Position: refs/heads/master@{#428359} ========== to ========== Show the icon for the typed in credit card in editor BUG=657178 Committed: https://crrev.com/7f1a60f6847ee8063df797738a37b9ab299026d5 Cr-Commit-Position: refs/heads/master@{#428359} ==========
Message was sent while issue was closed.
Committed patchset #5 (id:260001)
Message was sent while issue was closed.
Description was changed from ========== Show the icon for the typed in credit card in editor BUG=657178 Committed: https://crrev.com/7f1a60f6847ee8063df797738a37b9ab299026d5 Cr-Commit-Position: refs/heads/master@{#428359} ========== to ========== Show the icon for the typed in credit card in editor BUG=657178 Committed: https://crrev.com/7f1a60f6847ee8063df797738a37b9ab299026d5 Committed: https://crrev.com/fdf42fb9c2987cd86ac15e5963af0ad0f0153456 Cr-Original-Commit-Position: refs/heads/master@{#428359} Cr-Commit-Position: refs/heads/master@{#428797} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/fdf42fb9c2987cd86ac15e5963af0ad0f0153456 Cr-Commit-Position: refs/heads/master@{#428797} |