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

Unified Diff: chrome/browser/safe_browsing/services_delegate_impl.cc

Issue 2912383004: Fill is_chrome_signin_password field in the password entry pings. (Closed)
Patch Set: address nparker's comments Created 3 years, 6 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: chrome/browser/safe_browsing/services_delegate_impl.cc
diff --git a/chrome/browser/safe_browsing/services_delegate_impl.cc b/chrome/browser/safe_browsing/services_delegate_impl.cc
index 89997f8fab4010bbd74dfed957ca9e53a69ec9fd..e50cb929758bd3c8ceb69c720b8d0947dcbc8783 100644
--- a/chrome/browser/safe_browsing/services_delegate_impl.cc
+++ b/chrome/browser/safe_browsing/services_delegate_impl.cc
@@ -102,6 +102,9 @@ void ServicesDelegateImpl::ShutdownServices() {
resource_request_detector_.reset();
incident_service_.reset();
+ // Delete the ChromePasswordProtectionService instances.
+ password_protection_service_map_.clear();
+
// Must shut down last.
download_service_.reset();
}
@@ -179,4 +182,31 @@ void ServicesDelegateImpl::StopOnIOThread(bool shutdown) {
}
}
+void ServicesDelegateImpl::CreatePasswordProtectionService(Profile* profile) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ DCHECK(profile);
+ auto it = password_protection_service_map_.find(profile);
+ DCHECK(it == password_protection_service_map_.end());
+ std::unique_ptr<ChromePasswordProtectionService> service =
+ base::MakeUnique<ChromePasswordProtectionService>(safe_browsing_service_,
+ profile);
+ password_protection_service_map_[profile] = std::move(service);
+}
+
+void ServicesDelegateImpl::RemovePasswordProtectionService(Profile* profile) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ DCHECK(profile);
+ auto it = password_protection_service_map_.find(profile);
+ if (it != password_protection_service_map_.end())
+ password_protection_service_map_.erase(it);
+}
+
+PasswordProtectionService* ServicesDelegateImpl::GetPasswordProtectionService(
+ Profile* profile) const {
+ DCHECK(profile);
+ auto it = password_protection_service_map_.find(profile);
+ DCHECK(it != password_protection_service_map_.end());
+ return it->second.get();
+}
+
} // namespace safe_browsing
« no previous file with comments | « chrome/browser/safe_browsing/services_delegate_impl.h ('k') | chrome/browser/safe_browsing/services_delegate_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698