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

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

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 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 StartsWithASCII(group_name, "Enabled", /*case_sensitive=*/false); 305 return base::StartsWithASCII(group_name, "Enabled", /*case_sensitive=*/false);
306 } 306 }
307 307
308 bool IsPropagatingPasswordChangesToWebCredentialsEnabled( 308 bool IsPropagatingPasswordChangesToWebCredentialsEnabled(
309 const base::CommandLine& command_line) { 309 const base::CommandLine& command_line) {
310 // Note: It is important to always query the variation param first, which, in 310 // 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 311 // turn, queries the field trial state, which ensures that UMA reports the
312 // correct group if it is forced by a command line flag. 312 // correct group if it is forced by a command line flag.
313 const std::string update_enabled = variations::GetVariationParamValue( 313 const std::string update_enabled = variations::GetVariationParamValue(
314 kFieldTrialName, "propagate_password_changes_to_web"); 314 kFieldTrialName, "propagate_password_changes_to_web");
315 315
(...skipping 23 matching lines...) Expand all
339 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form, 339 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form,
340 const std::string& languages) { 340 const std::string& languages) {
341 password_manager::FacetURI facet_uri = 341 password_manager::FacetURI facet_uri =
342 password_manager::FacetURI::FromPotentiallyInvalidSpec( 342 password_manager::FacetURI::FromPotentiallyInvalidSpec(
343 password_form.signon_realm); 343 password_form.signon_realm);
344 if (facet_uri.IsValidAndroidFacetURI()) 344 if (facet_uri.IsValidAndroidFacetURI())
345 return facet_uri.scheme() + "://" + facet_uri.android_package_name(); 345 return facet_uri.scheme() + "://" + facet_uri.android_package_name();
346 return base::UTF16ToUTF8(net::FormatUrl(password_form.origin, languages)); 346 return base::UTF16ToUTF8(net::FormatUrl(password_form.origin, languages));
347 } 347 }
348 } // namespace password_manager 348 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698