OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 password manager's UI. | 5 // This file contains utilities related to password manager's UI. |
6 | 6 |
7 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_UI_UTILS_H_ | 7 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_UI_UTILS_H_ |
8 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_UI_UTILS_H_ | 8 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_UI_UTILS_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 namespace autofill { | 14 namespace autofill { |
15 struct PasswordForm; | 15 struct PasswordForm; |
16 } | 16 } |
17 | 17 |
18 namespace password_manager { | 18 namespace password_manager { |
19 | 19 |
20 // Returns a string suitable for security display to the user (just like | 20 // Returns a string suitable for security display to the user (just like |
21 // |FormatUrlForSecurityDisplayOmitScheme| based on origin of |password_form| | 21 // |FormatUrlForSecurityDisplayOmitScheme| based on origin of |password_form| |
22 // and |languages|) and without prefixes "m.", "mobile." or "www.". Also returns | 22 // and without prefixes "m.", "mobile." or "www.". Also returns the full URL of |
23 // the full URL of the origin as |link_url|. |link_url| will be also shown as | 23 // the origin as |link_url|. |link_url| will be also shown as tooltip on the |
24 // tooltip on the password page. | 24 // password page. |
25 // For Android forms with empty |password_form.affiliated_web_realm|, | 25 // For Android forms with empty |password_form.affiliated_web_realm|, |
26 // returns the result of GetHumanReadableOriginForAndroidUri. For other Android | 26 // returns the result of GetHumanReadableOriginForAndroidUri. For other Android |
27 // forms, returns |password_form.affiliated_web_realm|. | 27 // forms, returns |password_form.affiliated_web_realm|. |
28 // |*origin_is_clickable| is set to true, except for Android forms with empty | 28 // |*origin_is_clickable| is set to true, except for Android forms with empty |
29 // |password_form.affiliated_web_realm|. | 29 // |password_form.affiliated_web_realm|. |
30 // |is_android_url|, |link_url|, |origin_is_clickable| are required to non-null. | 30 // |is_android_url|, |link_url|, |origin_is_clickable| are required to non-null. |
31 std::string GetShownOriginAndLinkUrl( | 31 std::string GetShownOriginAndLinkUrl( |
32 const autofill::PasswordForm& password_form, | 32 const autofill::PasswordForm& password_form, |
33 const std::string& languages, | |
34 bool* is_android_uri, | 33 bool* is_android_uri, |
35 GURL* link_url, | 34 GURL* link_url, |
36 bool* origin_is_clickable); | 35 bool* origin_is_clickable); |
37 | 36 |
38 // Returns a string suitable for security display to the user (just like | 37 // Returns a string suitable for security display to the user (just like |
39 // |FormatUrlForSecurityDisplayOmitScheme| based on origin of |password_form| | 38 // |FormatUrlForSecurityDisplayOmitScheme| based on origin of |password_form|) |
40 // and |languages|) and without prefixes "m.", "mobile." or "www.". | 39 // and without prefixes "m.", "mobile." or "www.". |
41 std::string GetShownOrigin(const GURL& origin, const std::string& languages); | 40 std::string GetShownOrigin(const GURL& origin); |
42 | 41 |
43 } // namespace password_manager | 42 } // namespace password_manager |
44 | 43 |
45 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_UI_UTILS_H_ | 44 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_UI_UTILS_H_ |
OLD | NEW |