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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 case SavePasswordProgressLogger::STRING_CLIENT_CHECK_PRESENT: | 204 case SavePasswordProgressLogger::STRING_CLIENT_CHECK_PRESENT: |
205 return "IsPasswordManagerEnabledForCurrentPage"; | 205 return "IsPasswordManagerEnabledForCurrentPage"; |
206 case SavePasswordProgressLogger::STRING_SHOW_LOGIN_PROMPT_METHOD: | 206 case SavePasswordProgressLogger::STRING_SHOW_LOGIN_PROMPT_METHOD: |
207 return "ShowLoginPrompt"; | 207 return "ShowLoginPrompt"; |
208 case SavePasswordProgressLogger::STRING_NEW_UI_STATE: | 208 case SavePasswordProgressLogger::STRING_NEW_UI_STATE: |
209 return "The new state of the UI"; | 209 return "The new state of the UI"; |
210 case SavePasswordProgressLogger::STRING_FORM_NOT_AUTOFILLED: | 210 case SavePasswordProgressLogger::STRING_FORM_NOT_AUTOFILLED: |
211 return "The observed form will not be autofilled"; | 211 return "The observed form will not be autofilled"; |
212 case SavePasswordProgressLogger::STRING_CHANGE_PASSWORD_FORM: | 212 case SavePasswordProgressLogger::STRING_CHANGE_PASSWORD_FORM: |
213 return "Not saving password for a change password form"; | 213 return "Not saving password for a change password form"; |
| 214 case SavePasswordProgressLogger::PROCESS_FRAME_METHOD: |
| 215 return "PasswordFormManager::ProcessFrame"; |
214 case SavePasswordProgressLogger::STRING_INVALID: | 216 case SavePasswordProgressLogger::STRING_INVALID: |
215 return "INVALID"; | 217 return "INVALID"; |
216 // Intentionally no default: clause here -- all IDs need to get covered. | 218 // Intentionally no default: clause here -- all IDs need to get covered. |
217 } | 219 } |
218 NOTREACHED(); // Win compilers don't believe this is unreachable. | 220 NOTREACHED(); // Win compilers don't believe this is unreachable. |
219 return std::string(); | 221 return std::string(); |
220 } | 222 } |
221 | 223 |
222 // Removes privacy sensitive parts of |url| (currently all but host and scheme). | 224 // Removes privacy sensitive parts of |url| (currently all but host and scheme). |
223 std::string ScrubURL(const GURL& url) { | 225 std::string ScrubURL(const GURL& url) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 349 |
348 void SavePasswordProgressLogger::LogValue(StringID label, const Value& log) { | 350 void SavePasswordProgressLogger::LogValue(StringID label, const Value& log) { |
349 std::string log_string; | 351 std::string log_string; |
350 bool conversion_to_string_successful = base::JSONWriter::WriteWithOptions( | 352 bool conversion_to_string_successful = base::JSONWriter::WriteWithOptions( |
351 &log, base::JSONWriter::OPTIONS_PRETTY_PRINT, &log_string); | 353 &log, base::JSONWriter::OPTIONS_PRETTY_PRINT, &log_string); |
352 DCHECK(conversion_to_string_successful); | 354 DCHECK(conversion_to_string_successful); |
353 SendLog(GetStringFromID(label) + ": " + log_string); | 355 SendLog(GetStringFromID(label) + ": " + log_string); |
354 } | 356 } |
355 | 357 |
356 } // namespace autofill | 358 } // namespace autofill |
OLD | NEW |