OLD | NEW |
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 Loading... |
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 |
OLD | NEW |