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

Unified Diff: components/safe_browsing/password_protection/password_protection_request.cc

Issue 2833193002: Trigger Password Protection ping on username/password field on focus (Closed)
Patch Set: nit Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/safe_browsing/password_protection/password_protection_request.cc
diff --git a/components/safe_browsing/password_protection/password_protection_request.cc b/components/safe_browsing/password_protection/password_protection_request.cc
index eb0ed1b98a0e2885204304daa379255ea11d4f5f..e7376a47a96c9c770104c2626a7478c24738347b 100644
--- a/components/safe_browsing/password_protection/password_protection_request.cc
+++ b/components/safe_browsing/password_protection/password_protection_request.cc
@@ -19,13 +19,13 @@ namespace safe_browsing {
PasswordProtectionRequest::PasswordProtectionRequest(
const GURL& main_frame_url,
+ const GURL& password_form_action,
LoginReputationClientRequest::TriggerType type,
- std::unique_ptr<PasswordProtectionFrameList> password_frames,
PasswordProtectionService* pps,
int request_timeout_in_ms)
: main_frame_url_(main_frame_url),
+ password_form_action_(password_form_action),
request_type_(type),
- password_frames_(std::move(password_frames)),
password_protection_service_(pps),
database_manager_(password_protection_service_->database_manager()),
request_timeout_in_ms_(request_timeout_in_ms),
@@ -104,10 +104,14 @@ void PasswordProtectionRequest::FillRequestProto() {
main_frame->set_has_password_field(true);
password_protection_service_->FillReferrerChain(
main_frame_url_, -1 /* tab id not available */, main_frame);
-
- // TODO(jialiul): Fill more password form related info based on
- // |password_frame_map_| when Safe Browsing backend is ready to handle these
- // pieces of information.
+ // TODO(jialiul): Put the password form in the main frame for now, even if it
+ // is actually in a subframe.
+ LoginReputationClientRequest::Frame::Form* password_form =
+ main_frame->add_forms();
+ password_form->set_action_url(password_form_action_.spec());
+ password_form->set_has_password_field(true);
+ // TODO(jialiul): Fill more frame specific info when Safe Browsing backend
+ // is ready to handle these pieces of information.
}
void PasswordProtectionRequest::SendRequest() {

Powered by Google App Engine
This is Rietveld 408576698