| 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 25 matching lines...) Expand all Loading... |
| 36 // or names of HTML elements. | 36 // or names of HTML elements. |
| 37 bool IsUnwantedInElementID(char c) { | 37 bool IsUnwantedInElementID(char c) { |
| 38 return !(c == '_' || c == '-' || | 38 return !(c == '_' || c == '-' || |
| 39 base::IsAsciiAlpha(c) || base::IsAsciiDigit(c)); | 39 base::IsAsciiAlpha(c) || base::IsAsciiDigit(c)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 // The UTF-8 version of SavePasswordProgressLogger::ScrubElementID. | 42 // The UTF-8 version of SavePasswordProgressLogger::ScrubElementID. |
| 43 std::string ScrubElementID8Bit(std::string element_id) { | 43 std::string ScrubElementID8Bit(std::string element_id) { |
| 44 std::replace_if( | 44 std::replace_if( |
| 45 element_id.begin(), element_id.end(), IsUnwantedInElementID, ' '); | 45 element_id.begin(), element_id.end(), IsUnwantedInElementID, ' '); |
| 46 return base::StringToLowerASCII(element_id); | 46 return base::ToLowerASCII(element_id); |
| 47 } | 47 } |
| 48 | 48 |
| 49 SavePasswordProgressLogger::StringID FormSchemeToStringID( | 49 SavePasswordProgressLogger::StringID FormSchemeToStringID( |
| 50 PasswordForm::Scheme scheme) { | 50 PasswordForm::Scheme scheme) { |
| 51 switch (scheme) { | 51 switch (scheme) { |
| 52 case PasswordForm::SCHEME_HTML: | 52 case PasswordForm::SCHEME_HTML: |
| 53 return SavePasswordProgressLogger::STRING_SCHEME_HTML; | 53 return SavePasswordProgressLogger::STRING_SCHEME_HTML; |
| 54 case PasswordForm::SCHEME_BASIC: | 54 case PasswordForm::SCHEME_BASIC: |
| 55 return SavePasswordProgressLogger::STRING_SCHEME_BASIC; | 55 return SavePasswordProgressLogger::STRING_SCHEME_BASIC; |
| 56 case PasswordForm::SCHEME_DIGEST: | 56 case PasswordForm::SCHEME_DIGEST: |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 return "Adding manager for form with this signature"; | 351 return "Adding manager for form with this signature"; |
| 352 case SavePasswordProgressLogger::STRING_INVALID: | 352 case SavePasswordProgressLogger::STRING_INVALID: |
| 353 return "INVALID"; | 353 return "INVALID"; |
| 354 // Intentionally no default: clause here -- all IDs need to get covered. | 354 // Intentionally no default: clause here -- all IDs need to get covered. |
| 355 } | 355 } |
| 356 NOTREACHED(); // Win compilers don't believe this is unreachable. | 356 NOTREACHED(); // Win compilers don't believe this is unreachable. |
| 357 return std::string(); | 357 return std::string(); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace autofill | 360 } // namespace autofill |
| OLD | NEW |