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

Side by Side Diff: components/autofill/core/common/save_password_progress_logger.cc

Issue 604293002: Improve logging in password manager internals page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698