Index: components/password_manager/core/common/credential_manager_types.h |
diff --git a/components/password_manager/core/common/credential_manager_types.h b/components/password_manager/core/common/credential_manager_types.h |
index f798acff8af7dfb837f7f2ff40760cf55135ed7e..8f2a37eb2d97ed04042be6ed53278447f8c3eb31 100644 |
--- a/components/password_manager/core/common/credential_manager_types.h |
+++ b/components/password_manager/core/common/credential_manager_types.h |
@@ -7,6 +7,7 @@ |
#include <stddef.h> |
+#include <ostream> |
#include <string> |
#include "base/compiler_specific.h" |
@@ -31,6 +32,20 @@ enum class CredentialType { |
CREDENTIAL_TYPE_LAST = CREDENTIAL_TYPE_FEDERATED |
}; |
+inline std::ostream& operator<<(std::ostream& os, CredentialType value) { |
vabr (Chromium)
2016/03/14 15:40:26
Please do not inline this, create a .cc file and p
leonhsl(Using Gerrit)
2016/03/16 07:07:28
Done. Moved the definition to credential_manager_t
|
+ switch (value) { |
+ case CredentialType::CREDENTIAL_TYPE_EMPTY: |
+ return os << "CredentialType::CREDENTIAL_TYPE_EMPTY"; |
+ case CredentialType::CREDENTIAL_TYPE_PASSWORD: |
+ return os << "CredentialType::CREDENTIAL_TYPE_PASSWORD"; |
+ case CredentialType::CREDENTIAL_TYPE_FEDERATED: |
+ return os << "CredentialType::CREDENTIAL_TYPE_FEDERATED"; |
+ default: |
vabr (Chromium)
2016/03/14 15:40:26
nit: Move this from the default clause to below li
leonhsl(Using Gerrit)
2016/03/16 07:07:28
Done.
|
+ return os << "Unknown CredentialType value: " |
+ << static_cast<int32_t>(value); |
+ } |
+} |
+ |
struct CredentialInfo { |
CredentialInfo(); |
CredentialInfo(const autofill::PasswordForm& form, CredentialType form_type); |