Chromium Code Reviews| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 bool IsAffiliationRequestsForDummyFacetsEnabled( | 199 bool IsAffiliationRequestsForDummyFacetsEnabled( |
| 200 const base::CommandLine& command_line); | 200 const base::CommandLine& command_line); |
| 201 | 201 |
| 202 // Returns the origin URI in a format which can be presented to a user based of | 202 // Returns the origin URI in a format which can be presented to a user based of |
| 203 // |password_from| field values. For web URIs |languages| is using in order to | 203 // |password_from| field values. For web URIs |languages| is using in order to |
| 204 // determine whether a URI is 'comprehensible' to a user who understands | 204 // determine whether a URI is 'comprehensible' to a user who understands |
| 205 // languages listed. | 205 // languages listed. |
| 206 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form, | 206 std::string GetHumanReadableOrigin(const autofill::PasswordForm& password_form, |
| 207 const std::string& languages); | 207 const std::string& languages); |
| 208 | 208 |
| 209 // Returns a string suitable for security display to the user (just like | |
| 210 // |FormatUrlForSecurityDisplayOmitScheme| based on |url| and |languages|) and | |
| 211 // without prefixes "m.", "mobile." or "www.". | |
| 212 std::string GetShownOrigin(const GURL& url, const std::string& languages); | |
|
vabr (Chromium)
2015/10/15 11:58:26
I don't think this has anything to do with affilia
| |
| 213 | |
| 209 // For logging use only. | 214 // For logging use only. |
| 210 std::ostream& operator<<(std::ostream& os, const FacetURI& facet_uri); | 215 std::ostream& operator<<(std::ostream& os, const FacetURI& facet_uri); |
| 211 | 216 |
| 212 } // namespace password_manager | 217 } // namespace password_manager |
| 213 | 218 |
| 214 // Provide a hash function so that hash_sets and maps can contain FacetURIs. | 219 // Provide a hash function so that hash_sets and maps can contain FacetURIs. |
| 215 namespace BASE_HASH_NAMESPACE { | 220 namespace BASE_HASH_NAMESPACE { |
| 216 | 221 |
| 217 template <> | 222 template <> |
| 218 struct hash<password_manager::FacetURI> { | 223 struct hash<password_manager::FacetURI> { |
| 219 size_t operator()(const password_manager::FacetURI& facet_uri) const { | 224 size_t operator()(const password_manager::FacetURI& facet_uri) const { |
| 220 return hash<std::string>()(facet_uri.potentially_invalid_spec()); | 225 return hash<std::string>()(facet_uri.potentially_invalid_spec()); |
| 221 } | 226 } |
| 222 }; | 227 }; |
| 223 | 228 |
| 224 } // namespace BASE_HASH_NAMESPACE | 229 } // namespace BASE_HASH_NAMESPACE |
| 225 | 230 |
| 226 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ | 231 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ |
| OLD | NEW |