| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/autofill/core/common/save_password_progress_logger.h" | 5 #include "components/autofill/core/common/save_password_progress_logger.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 case SavePasswordProgressLogger::STRING_PASSWORD_FORM_REAPPEARED: | 152 case SavePasswordProgressLogger::STRING_PASSWORD_FORM_REAPPEARED: |
| 153 return "Password form re-appeared"; | 153 return "Password form re-appeared"; |
| 154 case SavePasswordProgressLogger::STRING_SAVING_DISABLED: | 154 case SavePasswordProgressLogger::STRING_SAVING_DISABLED: |
| 155 return "Saving disabled"; | 155 return "Saving disabled"; |
| 156 case SavePasswordProgressLogger::STRING_NO_MATCHING_FORM: | 156 case SavePasswordProgressLogger::STRING_NO_MATCHING_FORM: |
| 157 return "No matching form"; | 157 return "No matching form"; |
| 158 case SavePasswordProgressLogger::STRING_SSL_ERRORS_PRESENT: | 158 case SavePasswordProgressLogger::STRING_SSL_ERRORS_PRESENT: |
| 159 return "SSL errors present"; | 159 return "SSL errors present"; |
| 160 case SavePasswordProgressLogger::STRING_ONLY_VISIBLE: | 160 case SavePasswordProgressLogger::STRING_ONLY_VISIBLE: |
| 161 return "only_visible"; | 161 return "only_visible"; |
| 162 case SavePasswordProgressLogger::STRING_SHOW_PASSWORD_PROMPT: |
| 163 return "Show password prompt"; |
| 162 case SavePasswordProgressLogger::STRING_INVALID: | 164 case SavePasswordProgressLogger::STRING_INVALID: |
| 163 return "INVALID"; | 165 return "INVALID"; |
| 164 // Intentionally no default: clause here -- all IDs need to get covered. | 166 // Intentionally no default: clause here -- all IDs need to get covered. |
| 165 } | 167 } |
| 166 NOTREACHED(); // Win compilers don't believe this is unreachable. | 168 NOTREACHED(); // Win compilers don't believe this is unreachable. |
| 167 return std::string(); | 169 return std::string(); |
| 168 }; | 170 }; |
| 169 | 171 |
| 170 // Removes privacy sensitive parts of |url| (currently all but host and scheme). | 172 // Removes privacy sensitive parts of |url| (currently all but host and scheme). |
| 171 std::string ScrubURL(const GURL& url) { | 173 std::string ScrubURL(const GURL& url) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 299 |
| 298 void SavePasswordProgressLogger::LogValue(StringID label, const Value& log) { | 300 void SavePasswordProgressLogger::LogValue(StringID label, const Value& log) { |
| 299 std::string log_string; | 301 std::string log_string; |
| 300 bool conversion_to_string_successful = base::JSONWriter::WriteWithOptions( | 302 bool conversion_to_string_successful = base::JSONWriter::WriteWithOptions( |
| 301 &log, base::JSONWriter::OPTIONS_PRETTY_PRINT, &log_string); | 303 &log, base::JSONWriter::OPTIONS_PRETTY_PRINT, &log_string); |
| 302 DCHECK(conversion_to_string_successful); | 304 DCHECK(conversion_to_string_successful); |
| 303 SendLog(GetStringFromID(label) + ": " + log_string); | 305 SendLog(GetStringFromID(label) + ": " + log_string); |
| 304 } | 306 } |
| 305 | 307 |
| 306 } // namespace autofill | 308 } // namespace autofill |
| OLD | NEW |