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

Side by Side Diff: components/password_manager/core/browser/affiliation_utils.h

Issue 1318523011: [Password Manager] Copiable username and origin. Linkable origin elided from the left. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments to new css classes. Removed left align for rtl locales. Created 5 years, 2 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 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
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 // Remove prefixes "m.", "mobile." or "www." from the result of
Evan Stade 2015/10/05 18:59:41 nit: this kind of comment is likely to get out of
kolos1 2015/10/06 18:52:33 Yes, I agree, but there are many ways to get "huma
210 // |FormatUrlForSecurityDisplayOmitScheme| based on |url| and |languages|.
211 std::string GetShownOrigin(const GURL& url, const std::string& languages);
212
209 // For logging use only. 213 // For logging use only.
210 std::ostream& operator<<(std::ostream& os, const FacetURI& facet_uri); 214 std::ostream& operator<<(std::ostream& os, const FacetURI& facet_uri);
211 215
212 } // namespace password_manager 216 } // namespace password_manager
213 217
214 // Provide a hash function so that hash_sets and maps can contain FacetURIs. 218 // Provide a hash function so that hash_sets and maps can contain FacetURIs.
215 namespace BASE_HASH_NAMESPACE { 219 namespace BASE_HASH_NAMESPACE {
216 220
217 template <> 221 template <>
218 struct hash<password_manager::FacetURI> { 222 struct hash<password_manager::FacetURI> {
219 size_t operator()(const password_manager::FacetURI& facet_uri) const { 223 size_t operator()(const password_manager::FacetURI& facet_uri) const {
220 return hash<std::string>()(facet_uri.potentially_invalid_spec()); 224 return hash<std::string>()(facet_uri.potentially_invalid_spec());
221 } 225 }
222 }; 226 };
223 227
224 } // namespace BASE_HASH_NAMESPACE 228 } // namespace BASE_HASH_NAMESPACE
225 229
226 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_ 230 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_AFFILIATION_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698