Commit b5ce5e54 authored by Christoph Schwering's avatar Christoph Schwering Committed by Commit Bot

[Autofill] Added renderer IDs to autofill-information attribute.

This CL appends form and field renderer IDs to the autofill-information
attribute. For one thing, this helps interpret
chrome://autofill-internals output. For another, it will help matching
elements across rendered and browser process boundaries in unit tests.

Change-Id: I0bc5d50b7aa9922362e3d34a0d786bc741bfa9c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219487Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Commit-Queue: Christoph Schwering <schwering@google.com>
Cr-Commit-Position: refs/heads/master@{#772621}
parent 3fd7ba7f
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "components/autofill/content/renderer/form_autofill_util.h" #include "components/autofill/content/renderer/form_autofill_util.h"
#include "components/autofill/content/renderer/page_form_analyser_logger.h" #include "components/autofill/content/renderer/page_form_analyser_logger.h"
#include "components/autofill/core/common/autofill_constants.h" #include "components/autofill/core/common/autofill_constants.h"
...@@ -492,6 +493,11 @@ bool FormCache::ShowPredictions(const FormDataPredictions& form, ...@@ -492,6 +493,11 @@ bool FormCache::ShowPredictions(const FormDataPredictions& form,
const base::string16 truncated_label = field_data.label.substr( const base::string16 truncated_label = field_data.label.substr(
0, std::min(field_data.label.length(), kMaxLabelSize)); 0, std::min(field_data.label.length(), kMaxLabelSize));
std::string form_id =
base::NumberToString(form.data.unique_renderer_id.value());
std::string field_id =
base::NumberToString(field.field.unique_renderer_id.value());
std::string title = std::string title =
base::StrCat({"overall type: ", field.overall_type, // base::StrCat({"overall type: ", field.overall_type, //
"\nserver type: ", field.server_type, // "\nserver type: ", field.server_type, //
...@@ -500,7 +506,9 @@ bool FormCache::ShowPredictions(const FormDataPredictions& form, ...@@ -500,7 +506,9 @@ bool FormCache::ShowPredictions(const FormDataPredictions& form,
"\nparseable name: ", field.parseable_name, // "\nparseable name: ", field.parseable_name, //
"\nsection: ", field.section, // "\nsection: ", field.section, //
"\nfield signature: ", field.signature, // "\nfield signature: ", field.signature, //
"\nform signature: ", form.signature}); "\nform signature: ", form.signature, //
"\nform renderer id: ", form_id, //
"\nfield renderer id: ", field_id});
// Set this debug string to the title so that a developer can easily debug // Set this debug string to the title so that a developer can easily debug
// by hovering the mouse over the input field. // by hovering the mouse over the input field.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment