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

Issue 2148303005: [Password Generation] Sends the flag whether a field has nonempty user input (Closed)

Created:
4 years, 5 months ago by kolos1
Modified:
4 years, 4 months ago
CC:
browser-components-watch_chromium.org, chromium-reviews, darin-cc_chromium.org, estade+watch_chromium.org, gcasto+watchlist_chromium.org, jam, jdonnelly+autofillwatch_chromium.org, mlamouri+watch-content_chromium.org, rouslan+autofill_chromium.org, vabr+watchlistpasswordmanager_chromium.org, vabr+watchlistautofill_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Password Generation] Sends field properties mask in autofill upload 1. Extend |PasswordAutofillAgent.nonscript_modified_values_| to FieldValueAndPropertiesMaskMap that is a map from WebFormControlElement to the pair of: a) The most recent text that user typed or PasswordManager autofilled in input elements. Used for storing username/password before JavaScript changes them. a) Field properties mask, i.e. whether the field was autofilled, modified by user, etc. (see FieldPropertiesMask). THIS ONE was added. 2) Update field properties mask on (PasswordAutofillAgent) a) autofilling form field b) user input in a field c) user moves focus to a field 3) On FormData initialization, copy field properties masks from |field_value_and_properties_map_| to |FormFieldData.properties_mask|. Thus, the field properties masks will be sent to the browser on form submission, inpage nvaigation, force saving. 4) On the browser side, copy the field properties to |pending_credentials_|. See PasswordFormManager.CreatePendingCredentials() 5) Add the field properties mask to autofill upload request. BUG=552420 TEST=FormStructureTest.EncodeUploadRequestWithAdditionalPasswordFormSignature, PasswordAutofillAgentTest.RememberFieldPropertiesOnSubmit, PasswordAutofillAgentTest, RememberFieldPropertiesOnInPageNavigation, PasswordFormManagerTest.FieldPropertiesMasksUpload Committed: https://crrev.com/66b4c2950fda6e71c891ef57ac0354f16a0cf9d3 Cr-Commit-Position: refs/heads/master@{#408684}

Patch Set 1 #

Patch Set 2 : o #

Patch Set 3 : o #

Patch Set 4 : o #

Patch Set 5 : Removed the previous solution #

Patch Set 6 : After first tests #

Patch Set 7 : Preparing code #

Patch Set 8 : Rebase #

Patch Set 9 : Added password_autofill_agent_browsertest #

Patch Set 10 : Fixed form_structure test #

Patch Set 11 : Remove logging from EncodeFormForUpload #

Patch Set 12 : Minor fixes. Sent for review #

Patch Set 13 : Changed design (bool is replaced with mask of properties) #

Patch Set 14 : o #

Patch Set 15 : o #

Patch Set 16 : o #

Patch Set 17 : o #

Patch Set 18 : o #

Patch Set 19 : Handle duplicate ids #

Total comments: 8

Patch Set 20 : Changes addressed to reviewer comments #

Total comments: 10

Patch Set 21 : Wrap base::string in FieldValueAndPropertiesMaskMap with unique_ptr #

Patch Set 22 : Changes addressed to reviewer comments #

Total comments: 10

Patch Set 23 : Changes addressed to reviewer comments #

Total comments: 2

Patch Set 24 : Small fix (use implicit constructor for unique_ptr(nullptr)) #

Total comments: 1

Patch Set 25 : Fixes Mac failures (see password_autofill_agent_browsertest.cc) #

Patch Set 26 : Fixed a typo #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+519 lines, -186 lines) Patch
M chrome/renderer/autofill/form_autofill_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 39 chunks +51 lines, -62 lines 0 comments Download
M chrome/renderer/autofill/password_autofill_agent_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 5 chunks +78 lines, -6 lines 1 comment Download
M chrome/renderer/autofill/password_generation_test_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M components/autofill/content/common/autofill_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M components/autofill/content/renderer/autofill_agent.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 chunks +10 lines, -6 lines 0 comments Download
M components/autofill/content/renderer/form_autofill_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +13 lines, -3 lines 0 comments Download
M components/autofill/content/renderer/form_autofill_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 16 chunks +42 lines, -28 lines 0 comments Download
M components/autofill/content/renderer/form_cache.cc View 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M components/autofill/content/renderer/password_autofill_agent.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +10 lines, -3 lines 0 comments Download
M components/autofill/content/renderer/password_autofill_agent.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 18 chunks +75 lines, -26 lines 0 comments Download
M components/autofill/content/renderer/password_form_conversion_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +7 lines, -4 lines 0 comments Download
M components/autofill/content/renderer/password_form_conversion_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 10 chunks +39 lines, -36 lines 0 comments Download
M components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 3 chunks +9 lines, -5 lines 0 comments Download
M components/autofill/core/browser/form_structure.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -0 lines 0 comments Download
M components/autofill/core/browser/form_structure_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +16 lines, -0 lines 0 comments Download
M components/autofill/core/browser/proto/server.proto View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +5 lines, -1 line 0 comments Download
M components/autofill/core/common/form_field_data.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +16 lines, -0 lines 0 comments Download
M components/autofill/core/common/form_field_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7 chunks +27 lines, -4 lines 0 comments Download
M components/autofill/core/common/form_field_data_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 5 chunks +41 lines, -0 lines 0 comments Download
M components/password_manager/core/browser/password_form_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +15 lines, -0 lines 0 comments Download
M components/password_manager/core/browser/password_form_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +59 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (20 generated)
kolos1
Hi Vadym, Please review these files: password_autofill_agent.* password_form.h content_password_manager_driver.* password_form_manager* password_manager* Thanks, Maxim
4 years, 5 months ago (2016-07-21 15:12:04 UTC) #4
kolos1
Hi Vadym, I changed the design as we discussed in person. Please review. Best regards, ...
4 years, 5 months ago (2016-07-25 14:46:42 UTC) #7
kolos1
Changed design one more time to handle duplicates IDs. Please review.
4 years, 4 months ago (2016-07-27 16:00:27 UTC) #8
dvadym
Thanks, it looks good. There are some comments, mostly nits. https://codereview.chromium.org/2148303005/diff/410001/components/autofill/content/renderer/password_autofill_agent.cc File components/autofill/content/renderer/password_autofill_agent.cc (right): https://codereview.chromium.org/2148303005/diff/410001/components/autofill/content/renderer/password_autofill_agent.cc#newcode355 ...
4 years, 4 months ago (2016-07-28 09:03:06 UTC) #11
kolos1
dvadym@: made changes addressed to your comments. vabr@: please review the rest of files except ...
4 years, 4 months ago (2016-07-28 11:04:36 UTC) #14
vabr (Chromium)
Hi Maxim, Looks good, but I have some comments. Thanks! Vaclav https://codereview.chromium.org/2148303005/diff/450001/chrome/renderer/autofill/password_autofill_agent_browsertest.cc File chrome/renderer/autofill/password_autofill_agent_browsertest.cc (right): ...
4 years, 4 months ago (2016-07-28 11:33:53 UTC) #15
kolos1
https://codereview.chromium.org/2148303005/diff/450001/chrome/renderer/autofill/password_autofill_agent_browsertest.cc File chrome/renderer/autofill/password_autofill_agent_browsertest.cc (right): https://codereview.chromium.org/2148303005/diff/450001/chrome/renderer/autofill/password_autofill_agent_browsertest.cc#newcode491 chrome/renderer/autofill/password_autofill_agent_browsertest.cc:491: void ExpectFieldPropertiesMasks(uint32_t expected_message_id) { On 2016/07/28 11:33:53, vabr (Chromium) ...
4 years, 4 months ago (2016-07-28 13:44:03 UTC) #16
dvadym
Thanks Maxim for implementing this. Password part and general logic LGTM
4 years, 4 months ago (2016-07-28 13:49:44 UTC) #17
vabr (Chromium)
LGTM with minor comments. Thanks! Vaclav https://codereview.chromium.org/2148303005/diff/490001/components/autofill/content/renderer/password_autofill_agent.cc File components/autofill/content/renderer/password_autofill_agent.cc (right): https://codereview.chromium.org/2148303005/diff/490001/components/autofill/content/renderer/password_autofill_agent.cc#newcode369 components/autofill/content/renderer/password_autofill_agent.cc:369: value ? std::unique_ptr<base::string16>(new ...
4 years, 4 months ago (2016-07-28 14:30:59 UTC) #18
kolos1
https://codereview.chromium.org/2148303005/diff/490001/components/autofill/content/renderer/password_autofill_agent.cc File components/autofill/content/renderer/password_autofill_agent.cc (right): https://codereview.chromium.org/2148303005/diff/490001/components/autofill/content/renderer/password_autofill_agent.cc#newcode369 components/autofill/content/renderer/password_autofill_agent.cc:369: value ? std::unique_ptr<base::string16>(new base::string16(*value)) On 2016/07/28 14:30:59, vabr (Chromium) ...
4 years, 4 months ago (2016-07-28 15:24:27 UTC) #19
kolos1
mkwst@: please review tiny change in autofill_messages.h
4 years, 4 months ago (2016-07-28 15:36:19 UTC) #21
vabr (Chromium)
One last comment, but still LGTM. Cheers, Vaclav https://codereview.chromium.org/2148303005/diff/510001/components/autofill/content/renderer/password_autofill_agent.cc File components/autofill/content/renderer/password_autofill_agent.cc (right): https://codereview.chromium.org/2148303005/diff/510001/components/autofill/content/renderer/password_autofill_agent.cc#newcode371 components/autofill/content/renderer/password_autofill_agent.cc:371: : ...
4 years, 4 months ago (2016-07-28 17:03:51 UTC) #22
Mike West
IPC LGTM (except insofar as it ought to be mojo :) )
4 years, 4 months ago (2016-07-28 18:49:14 UTC) #23
kolos1
On 2016/07/28 18:49:14, Mike West wrote: > IPC LGTM (except insofar as it ought to ...
4 years, 4 months ago (2016-07-29 06:15:57 UTC) #24
kolos1
https://codereview.chromium.org/2148303005/diff/510001/components/autofill/content/renderer/password_autofill_agent.cc File components/autofill/content/renderer/password_autofill_agent.cc (right): https://codereview.chromium.org/2148303005/diff/510001/components/autofill/content/renderer/password_autofill_agent.cc#newcode371 components/autofill/content/renderer/password_autofill_agent.cc:371: : std::unique_ptr<base::string16>(nullptr), On 2016/07/28 17:03:51, vabr (Chromium) wrote: > ...
4 years, 4 months ago (2016-07-29 06:16:19 UTC) #25
vabr (Chromium)
Speaking of Mojo... https://codereview.chromium.org/2148303005/diff/530001/components/autofill/content/common/autofill_messages.h File components/autofill/content/common/autofill_messages.h (right): https://codereview.chromium.org/2148303005/diff/530001/components/autofill/content/common/autofill_messages.h#newcode62 components/autofill/content/common/autofill_messages.h:62: IPC_STRUCT_TRAITS_MEMBER(properties_mask) I guess this change needs ...
4 years, 4 months ago (2016-07-29 07:26:53 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2148303005/570001
4 years, 4 months ago (2016-07-29 17:10:12 UTC) #35
commit-bot: I haz the power
Committed patchset #26 (id:570001)
4 years, 4 months ago (2016-07-29 17:55:11 UTC) #37
commit-bot: I haz the power
Patchset 26 (id:??) landed as https://crrev.com/66b4c2950fda6e71c891ef57ac0354f16a0cf9d3 Cr-Commit-Position: refs/heads/master@{#408684}
4 years, 4 months ago (2016-07-29 17:58:27 UTC) #39
vabr (Chromium)
Hi Maxim, Post-landing comment below. Also, what was the problem with the tests failing on ...
4 years, 4 months ago (2016-07-29 18:04:51 UTC) #40
kolos1
On 2016/07/29 18:04:51, vabr (holiday until 8 Aug) wrote: > Hi Maxim, > Post-landing comment ...
4 years, 4 months ago (2016-07-29 19:32:04 UTC) #41
kolos1
On 2016/07/29 18:04:51, vabr (holiday until 8 Aug) wrote: > Hi Maxim, > Post-landing comment ...
4 years, 4 months ago (2016-07-29 19:32:30 UTC) #42
vabr (Chromium)
On 2016/07/29 19:32:04, kolos1 wrote: > On 2016/07/29 18:04:51, vabr (holiday until 8 Aug) wrote: ...
4 years, 4 months ago (2016-07-29 19:59:20 UTC) #43
kolos1
4 years, 4 months ago (2016-07-29 20:05:07 UTC) #44
Message was sent while issue was closed.
On 2016/07/29 19:59:20, vabr (holiday until 8 Aug) wrote:
> On 2016/07/29 19:32:04, kolos1 wrote:
> > On 2016/07/29 18:04:51, vabr (holiday until 8 Aug) wrote:
> > > Hi Maxim,
> > > Post-landing comment below.
> > > 
> > > Also, what was the problem with the tests failing on Mac? (Cannot tell
from
> > the
> > > diff, as it includes a rebase.)
> > > 
> > > Cheers,
> > > Vaclav
> > > 
> > >
> >
>
https://codereview.chromium.org/2148303005/diff/570001/chrome/renderer/autofi...
> > > File chrome/renderer/autofill/password_autofill_agent_browsertest.cc
> (right):
> > > 
> > >
> >
>
https://codereview.chromium.org/2148303005/diff/570001/chrome/renderer/autofi...
> > > chrome/renderer/autofill/password_autofill_agent_browsertest.cc:22:
#include
> > > <components/autofill/core/common/password_form.h>
> > > Please change < and > to " and ".
> > 
> > Hi Vaclav,
> > 
> > It failed on tests on InPageNavigation where we hide the form with changing
> > elements' visibility (username_element_.setAttribute("style",
> > "display:none;");).
> > I added new field ('random_field') to kNoForm, but didn't change its
> visibility
> > in the test. So, for Mac such form remains visible even if username and
> password
> > was hidden.
> > 
> > Regards,
> > Maxim
> 
> Thanks, Maxim, for the explanation (and fixing the test)!
> I'm still wondering why this was Mac specific.
> Cheers,
> Vaclav

Probably because of this macros
https://cs.chromium.org/chromium/src/components/autofill/content/renderer/pas...

Powered by Google App Engine
This is Rietveld 408576698