| OLD | NEW |
| 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 // This file contains utilities related to working with "facets". | 5 // This file contains utilities related to working with "facets". |
| 6 // | 6 // |
| 7 // A "facet" is defined as the manifestation of a logical application on a given | 7 // A "facet" is defined as the manifestation of a logical application on a given |
| 8 // platform. For example, "My Bank" may have released an Android application | 8 // platform. For example, "My Bank" may have released an Android application |
| 9 // and a Web application accessible from a browser. These are all facets of the | 9 // and a Web application accessible from a browser. These are all facets of the |
| 10 // "My Bank" logical application. | 10 // "My Bank" logical application. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ | 44 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ |
| 45 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ | 45 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ |
| 46 | 46 |
| 47 #include <string> | 47 #include <string> |
| 48 #include <vector> | 48 #include <vector> |
| 49 | 49 |
| 50 #include "base/logging.h" | 50 #include "base/logging.h" |
| 51 #include "base/time/time.h" | 51 #include "base/time/time.h" |
| 52 #include "url/url_parse.h" | 52 #include "url/url_parse.h" |
| 53 | 53 |
| 54 namespace base { |
| 55 class CommandLine; |
| 56 } // namespace base |
| 57 |
| 54 namespace password_manager { | 58 namespace password_manager { |
| 55 | 59 |
| 56 // Encapsulates a facet URI in canonical form. | 60 // Encapsulates a facet URI in canonical form. |
| 57 // | 61 // |
| 58 // This is a very light-weight wrapper around an std::string containing the text | 62 // This is a very light-weight wrapper around an std::string containing the text |
| 59 // of the URI, and can be passed around as a value. The main rationale for the | 63 // of the URI, and can be passed around as a value. The main rationale for the |
| 60 // existance of this class is to make it clearer in the code when a certain URI | 64 // existance of this class is to make it clearer in the code when a certain URI |
| 61 // is known to be a valid facet URI in canonical form, and to allow verifying | 65 // is known to be a valid facet URI in canonical form, and to allow verifying |
| 62 // and converting URIs to such canonical form. | 66 // and converting URIs to such canonical form. |
| 63 // | 67 // |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 base::Time last_update_time; | 151 base::Time last_update_time; |
| 148 }; | 152 }; |
| 149 | 153 |
| 150 // Returns whether or not equivalence classes |a| and |b| are equal, that is, | 154 // Returns whether or not equivalence classes |a| and |b| are equal, that is, |
| 151 // whether or not they consist of the same set of facets. | 155 // whether or not they consist of the same set of facets. |
| 152 // | 156 // |
| 153 // Note that this will do some sorting, so it can be expensive for large inputs. | 157 // Note that this will do some sorting, so it can be expensive for large inputs. |
| 154 bool AreEquivalenceClassesEqual(const AffiliatedFacets& a, | 158 bool AreEquivalenceClassesEqual(const AffiliatedFacets& a, |
| 155 const AffiliatedFacets& b); | 159 const AffiliatedFacets& b); |
| 156 | 160 |
| 161 // Returns whether or not affiliation based matching is enabled, either via |
| 162 // command line flags or field trials. The command line flag, if present, always |
| 163 // takes precedence. |
| 164 bool IsAffiliationBasedMatchingEnabled(const base::CommandLine& command_line); |
| 165 |
| 157 } // namespace password_manager | 166 } // namespace password_manager |
| 158 | 167 |
| 159 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ | 168 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ |
| OLD | NEW |