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

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

Issue 2878813002: Trigger protected password entry request on password reuse event. (Closed)
Patch Set: nit Created 3 years, 7 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_service.cc
diff --git a/components/safe_browsing/password_protection/password_protection_service.cc b/components/safe_browsing/password_protection/password_protection_service.cc
index 8433e273b9c7ac65cae9bae2943b5d36535ab6f5..b6bfd2da80a7fd87ac2484ff0a9f06f812cbf9da 100644
--- a/components/safe_browsing/password_protection/password_protection_service.cc
+++ b/components/safe_browsing/password_protection/password_protection_service.cc
@@ -261,12 +261,13 @@ void PasswordProtectionService::StartRequest(
const GURL& main_frame_url,
const GURL& password_form_action,
const GURL& password_form_frame_url,
+ const std::string& legitimate_domain,
LoginReputationClientRequest::TriggerType type) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
scoped_refptr<PasswordProtectionRequest> request(
new PasswordProtectionRequest(main_frame_url, password_form_action,
- password_form_frame_url, type, this,
- GetRequestTimeoutInMS()));
+ password_form_frame_url, legitimate_domain,
+ type, this, GetRequestTimeoutInMS()));
DCHECK(request);
request->Start();
requests_.insert(std::move(request));
@@ -286,9 +287,26 @@ void PasswordProtectionService::MaybeStartLowReputationRequest(
}
StartRequest(main_frame_url, password_form_action, password_form_frame_url,
+ std::string(),
Nathan Parker 2017/05/12 22:28:00 /* legitimate_domain: not used for this type */
Jialiu Lin 2017/05/13 00:24:12 Done.
LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE);
}
+void PasswordProtectionService::MaybeStartProtectedPasswordEntryRequest(
+ const GURL& main_frame_url,
+ const std::string& legitimate_domain) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (!IsPingingEnabled(kProtectedPasswordEntryPinging))
+ return;
+
+ // Skip URLs that we can't get a reliable reputation for.
+ if (!main_frame_url.is_valid() || !main_frame_url.SchemeIsHTTPOrHTTPS()) {
+ return;
+ }
+
+ StartRequest(main_frame_url, GURL(), GURL(), legitimate_domain,
+ LoginReputationClientRequest::PASSWORD_REUSE_EVENT);
+}
+
void PasswordProtectionService::RequestFinished(
PasswordProtectionRequest* request,
std::unique_ptr<LoginReputationClientResponse> response) {

Powered by Google App Engine
This is Rietveld 408576698