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

Unified Diff: components/password_manager/content/browser/credential_manager_impl.cc

Issue 2293443002: Implement logging of the Credential Manager API calls to chrome://password-manager-internals. (Closed)
Patch Set: nits Created 4 years, 4 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/password_manager/content/browser/credential_manager_impl.cc
diff --git a/components/password_manager/content/browser/credential_manager_impl.cc b/components/password_manager/content/browser/credential_manager_impl.cc
index 9a0a1b43c757a16a6eb96d63b8a7b4a415d304f2..66a457b8e0ddefb3a324bca2c0aabd07835b0895 100644
--- a/components/password_manager/content/browser/credential_manager_impl.cc
+++ b/components/password_manager/content/browser/credential_manager_impl.cc
@@ -14,7 +14,9 @@
#include "components/password_manager/content/browser/content_password_manager_driver.h"
#include "components/password_manager/content/browser/content_password_manager_driver_factory.h"
#include "components/password_manager/core/browser/affiliated_match_helper.h"
+#include "components/password_manager/core/browser/credential_manager_logger.h"
#include "components/password_manager/core/browser/password_manager_client.h"
+#include "components/password_manager/core/browser/password_manager_util.h"
#include "components/password_manager/core/browser/password_store.h"
#include "components/password_manager/core/common/credential_manager_types.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
@@ -52,6 +54,12 @@ void CredentialManagerImpl::Store(const CredentialInfo& credential,
const StoreCallback& callback) {
DCHECK_NE(CredentialType::CREDENTIAL_TYPE_EMPTY, credential.type);
+ if (password_manager_util::IsLoggingActive(client_)) {
+ CredentialManagerLogger(client_->GetLogManager())
+ .LogStoreCredential(web_contents()->GetLastCommittedURL(),
+ credential.type);
+ }
+
// Send acknowledge response back.
callback.Run();
@@ -104,6 +112,10 @@ void CredentialManagerImpl::OnProvisionalSaveComplete() {
void CredentialManagerImpl::RequireUserMediation(
const RequireUserMediationCallback& callback) {
+ if (password_manager_util::IsLoggingActive(client_)) {
+ CredentialManagerLogger(client_->GetLogManager())
+ .LogRequireUserMediation(web_contents()->GetLastCommittedURL());
+ }
PasswordStore* store = GetPasswordStore();
if (!store || !IsUpdatingCredentialAllowed()) {
callback.Run();
@@ -150,6 +162,11 @@ void CredentialManagerImpl::Get(bool zero_click_only,
const std::vector<GURL>& federations,
const GetCallback& callback) {
PasswordStore* store = GetPasswordStore();
+ if (password_manager_util::IsLoggingActive(client_)) {
+ CredentialManagerLogger(client_->GetLogManager())
+ .LogRequestCredential(web_contents()->GetLastCommittedURL(),
+ zero_click_only, federations);
+ }
if (pending_request_ || !store) {
// Callback error.
callback.Run(pending_request_
@@ -225,6 +242,10 @@ void CredentialManagerImpl::SendCredential(
DCHECK(pending_request_);
DCHECK(send_callback.Equals(pending_request_->send_callback()));
+ if (password_manager_util::IsLoggingActive(client_)) {
+ CredentialManagerLogger(client_->GetLogManager())
+ .LogSendCredential(web_contents()->GetLastCommittedURL(), info.type);
+ }
send_callback.Run(info);
pending_request_.reset();
}
« no previous file with comments | « components/autofill/core/common/save_password_progress_logger.cc ('k') | components/password_manager/core/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698