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

Side by Side Diff: components/password_manager/core/browser/affiliation_utils.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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/password_manager/core/browser/affiliation_utils.h" 5 #include "components/password_manager/core/browser/affiliation_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 bool IsAffiliationBasedMatchingEnabled(const base::CommandLine& command_line) { 295 bool IsAffiliationBasedMatchingEnabled(const base::CommandLine& command_line) {
296 // Note: It is important to always query the field trial state, to ensure that 296 // Note: It is important to always query the field trial state, to ensure that
297 // UMA reports the correct group. 297 // UMA reports the correct group.
298 const std::string group_name = 298 const std::string group_name =
299 base::FieldTrialList::FindFullName(kFieldTrialName); 299 base::FieldTrialList::FindFullName(kFieldTrialName);
300 300
301 if (command_line.HasSwitch(switches::kDisableAffiliationBasedMatching)) 301 if (command_line.HasSwitch(switches::kDisableAffiliationBasedMatching))
302 return false; 302 return false;
303 if (command_line.HasSwitch(switches::kEnableAffiliationBasedMatching)) 303 if (command_line.HasSwitch(switches::kEnableAffiliationBasedMatching))
304 return true; 304 return true;
305 return base::StartsWithASCII(group_name, "Enabled", /*case_sensitive=*/false); 305 return base::StartsWith(group_name, "Enabled",
306 base::CompareCase::INSENSITIVE_ASCII);
306 } 307 }
307 308
308 bool IsPropagatingPasswordChangesToWebCredentialsEnabled( 309 bool IsPropagatingPasswordChangesToWebCredentialsEnabled(
309 const base::CommandLine& command_line) { 310 const base::CommandLine& command_line) {
310 // Note: It is important to always query the variation param first, which, in 311 // Note: It is important to always query the variation param first, which, in
311 // turn, queries the field trial state, which ensures that UMA reports the 312 // turn, queries the field trial state, which ensures that UMA reports the
312 // correct group if it is forced by a command line flag. 313 // correct group if it is forced by a command line flag.
313 const std::string update_enabled = variations::GetVariationParamValue( 314 const std::string update_enabled = variations::GetVariationParamValue(
314 kFieldTrialName, "propagate_password_changes_to_web"); 315 kFieldTrialName, "propagate_password_changes_to_web");
315 316
(...skipping 23 matching lines...) Expand all
339 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form, 340 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form,
340 const std::string& languages) { 341 const std::string& languages) {
341 password_manager::FacetURI facet_uri = 342 password_manager::FacetURI facet_uri =
342 password_manager::FacetURI::FromPotentiallyInvalidSpec( 343 password_manager::FacetURI::FromPotentiallyInvalidSpec(
343 password_form.signon_realm); 344 password_form.signon_realm);
344 if (facet_uri.IsValidAndroidFacetURI()) 345 if (facet_uri.IsValidAndroidFacetURI())
345 return facet_uri.scheme() + "://" + facet_uri.android_package_name(); 346 return facet_uri.scheme() + "://" + facet_uri.android_package_name();
346 return base::UTF16ToUTF8(net::FormatUrl(password_form.origin, languages)); 347 return base::UTF16ToUTF8(net::FormatUrl(password_form.origin, languages));
347 } 348 }
348 } // namespace password_manager 349 } // namespace password_manager
OLDNEW
« no previous file with comments | « components/nacl/renderer/ppb_nacl_private_impl.cc ('k') | components/password_manager/core/browser/password_form_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698