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

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

Issue 1668523002: [Password Manager] Switch password manager code to use the Feature framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/psl_matching_helper.h" 5 #include "components/password_manager/core/browser/psl_matching_helper.h"
6 6
7 #include "base/command_line.h"
8 #include "base/logging.h" 7 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
11 #include "components/autofill/core/common/password_form.h" 10 #include "components/autofill/core/common/password_form.h"
12 #include "components/password_manager/core/common/password_manager_switches.h"
13 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 11 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
14 #include "url/gurl.h" 12 #include "url/gurl.h"
15 13
16 using autofill::PasswordForm; 14 using autofill::PasswordForm;
17 15
18 namespace password_manager { 16 namespace password_manager {
19 17
20 bool ShouldPSLDomainMatchingApply( 18 bool ShouldPSLDomainMatchingApply(
21 const std::string& registry_controlled_domain) { 19 const std::string& registry_controlled_domain) {
22 return !registry_controlled_domain.empty() && 20 return !registry_controlled_domain.empty() &&
(...skipping 29 matching lines...) Expand all
52 50
53 bool IsFederatedMatch(const std::string& signon_realm, const GURL& origin) { 51 bool IsFederatedMatch(const std::string& signon_realm, const GURL& origin) {
54 // The format should be "federation://origin.host/federation.host; 52 // The format should be "federation://origin.host/federation.host;
55 std::string federated_realm = "federation://" + origin.host() + "/"; 53 std::string federated_realm = "federation://" + origin.host() + "/";
56 return signon_realm.size() > federated_realm.size() && 54 return signon_realm.size() > federated_realm.size() &&
57 base::StartsWith(signon_realm, federated_realm, 55 base::StartsWith(signon_realm, federated_realm,
58 base::CompareCase::INSENSITIVE_ASCII); 56 base::CompareCase::INSENSITIVE_ASCII);
59 } 57 }
60 58
61 } // namespace password_manager 59 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698