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

Side by Side Diff: components/password_manager/core/browser/credential_manager_logger.cc

Issue 2864493003: Deprecate CredentialRequestOptions.unmediated in favor mediation enum (Closed)
Patch Set: Fix Windows Compilation Error 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/password_manager/core/browser/credential_manager_logger.h" 5 #include "components/password_manager/core/browser/credential_manager_logger.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "components/autofill/core/common/save_password_progress_logger.h" 10 #include "components/autofill/core/common/save_password_progress_logger.h"
11 #include "components/password_manager/core/browser/log_manager.h" 11 #include "components/password_manager/core/browser/log_manager.h"
12 12
13 using autofill::SavePasswordProgressLogger; 13 using autofill::SavePasswordProgressLogger;
14 14
15 namespace password_manager { 15 namespace password_manager {
16 16
17 CredentialManagerLogger::CredentialManagerLogger(const LogManager* log_manager) 17 CredentialManagerLogger::CredentialManagerLogger(const LogManager* log_manager)
18 : log_manager_(log_manager) {} 18 : log_manager_(log_manager) {}
19 19
20 CredentialManagerLogger::~CredentialManagerLogger() = default; 20 CredentialManagerLogger::~CredentialManagerLogger() = default;
21 21
22 void CredentialManagerLogger::LogRequestCredential( 22 void CredentialManagerLogger::LogRequestCredential(
23 const GURL& url, 23 const GURL& url,
24 bool zero_click_only, 24 CredentialMediationRequirement mediation,
25 const std::vector<GURL>& federations) { 25 const std::vector<GURL>& federations) {
26 std::string s("CM API get credentials: origin=" + 26 std::string s("CM API get credentials: origin=" +
27 SavePasswordProgressLogger::ScrubURL(url)); 27 SavePasswordProgressLogger::ScrubURL(url));
28 s += ", zero_click_only=" + base::IntToString(zero_click_only); 28 s += ", mediation=";
29 switch (mediation) {
30 case CredentialMediationRequirement::SILENT:
31 s += "silent";
vasilii 2017/05/18 12:34:03 What about breaks?
jdoerrie 2017/05/18 14:57:24 Done.
32 case CredentialMediationRequirement::OPTIONAL:
33 s += "optional";
34 case CredentialMediationRequirement::REQUIRED:
35 s += "required";
36 }
29 s += ", federations="; 37 s += ", federations=";
30 for (const GURL& federation_provider : federations) 38 for (const GURL& federation_provider : federations)
31 s += SavePasswordProgressLogger::ScrubURL(federation_provider) + ", "; 39 s += SavePasswordProgressLogger::ScrubURL(federation_provider) + ", ";
32 40
33 log_manager_->LogSavePasswordProgress(s); 41 log_manager_->LogSavePasswordProgress(s);
34 } 42 }
35 43
36 void CredentialManagerLogger::LogSendCredential(const GURL& url, 44 void CredentialManagerLogger::LogSendCredential(const GURL& url,
37 CredentialType type) { 45 CredentialType type) {
38 std::string s("CM API send a credential: origin=" + 46 std::string s("CM API send a credential: origin=" +
(...skipping 10 matching lines...) Expand all
49 log_manager_->LogSavePasswordProgress(s); 57 log_manager_->LogSavePasswordProgress(s);
50 } 58 }
51 59
52 void CredentialManagerLogger::LogRequireUserMediation(const GURL& url) { 60 void CredentialManagerLogger::LogRequireUserMediation(const GURL& url) {
53 std::string s("CM API sign out: origin=" + 61 std::string s("CM API sign out: origin=" +
54 SavePasswordProgressLogger::ScrubURL(url)); 62 SavePasswordProgressLogger::ScrubURL(url));
55 log_manager_->LogSavePasswordProgress(s); 63 log_manager_->LogSavePasswordProgress(s);
56 } 64 }
57 65
58 } // namespace password_manager 66 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698