| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 namespace autofill { | 59 namespace autofill { |
| 60 struct PasswordForm; | 60 struct PasswordForm; |
| 61 } // namespace autofill | 61 } // namespace autofill |
| 62 | 62 |
| 63 namespace password_manager { | 63 namespace password_manager { |
| 64 | 64 |
| 65 // Encapsulates a facet URI in canonical form. | 65 // Encapsulates a facet URI in canonical form. |
| 66 // | 66 // |
| 67 // This is a very light-weight wrapper around an std::string containing the text | 67 // This is a very light-weight wrapper around an std::string containing the text |
| 68 // of the URI, and can be passed around as a value. The main rationale for the | 68 // of the URI, and can be passed around as a value. The main rationale for the |
| 69 // existance of this class is to make it clearer in the code when a certain URI | 69 // existence of this class is to make it clearer in the code when a certain URI |
| 70 // is known to be a valid facet URI in canonical form, and to allow verifying | 70 // is known to be a valid facet URI in canonical form, and to allow verifying |
| 71 // and converting URIs to such canonical form. | 71 // and converting URIs to such canonical form. |
| 72 // | 72 // |
| 73 // Note that it would be impractical to use GURL to represent facet URIs, as | 73 // Note that it would be impractical to use GURL to represent facet URIs, as |
| 74 // GURL has built-in logic to parse the rest of the URI according to its scheme, | 74 // GURL has built-in logic to parse the rest of the URI according to its scheme, |
| 75 // and obviously, it does not recognize the "android" scheme. Therefore, after | 75 // and obviously, it does not recognize the "android" scheme. Therefore, after |
| 76 // parsing, everything ends up in the path component, which is not too helpful. | 76 // parsing, everything ends up in the path component, which is not too helpful. |
| 77 class FacetURI { | 77 class FacetURI { |
| 78 public: | 78 public: |
| 79 FacetURI(); | 79 FacetURI(); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 struct FacetURIHash { | 189 struct FacetURIHash { |
| 190 size_t operator()(const FacetURI& facet_uri) const { | 190 size_t operator()(const FacetURI& facet_uri) const { |
| 191 return std::hash<std::string>()(facet_uri.potentially_invalid_spec()); | 191 return std::hash<std::string>()(facet_uri.potentially_invalid_spec()); |
| 192 } | 192 } |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 } // namespace password_manager | 195 } // namespace password_manager |
| 196 | 196 |
| 197 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ | 197 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ |
| OLD | NEW |