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

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

Issue 1279123004: Replace ToLower calls to the new format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 25 matching lines...) Expand all
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698