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 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ |
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ |
7 | 7 |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 | 9 |
10 namespace autofill { | 10 namespace autofill { |
11 struct PasswordForm; | 11 struct PasswordForm; |
12 } | 12 } |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class ImageSkia; | 15 class ImageSkia; |
16 class Range; | 16 class Range; |
17 } // namespace gfx | 17 } // namespace gfx |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 | 20 |
21 enum class PasswordTittleType { | 21 enum class PasswordTittleType { |
22 SAVE_PASSWORD, // plain password | 22 SAVE_PASSWORD, // plain password |
23 SAVE_ACCOUNT, // login via IDP | 23 SAVE_ACCOUNT, // login via IDP |
24 UPDATE_PASSWORD, // update plain password | 24 UPDATE_PASSWORD, // update plain password |
25 }; | 25 }; |
26 | 26 |
27 class Profile; | 27 class Profile; |
28 | 28 |
29 // The desired width and height in pixels for an account avatar. | 29 // The desired width and height in pixels for an account avatar. |
30 extern const int kAvatarImageSize; | 30 constexpr int kAvatarImageSize = 32; |
31 | 31 |
32 // Crops and scales |image_skia| to the desired size for an account avatar. | 32 // Crops and scales |image_skia| to the desired size for an account avatar. |
33 gfx::ImageSkia ScaleImageForAccountAvatar(gfx::ImageSkia image_skia); | 33 gfx::ImageSkia ScaleImageForAccountAvatar(gfx::ImageSkia image_skia); |
34 | 34 |
35 // Returns the upper and lower label to be displayed in the account chooser UI | 35 // Returns the upper and lower label to be displayed in the account chooser UI |
36 // for |form|. | 36 // for |form|. |
37 std::pair<base::string16, base::string16> GetCredentialLabelsForAccountChooser( | 37 std::pair<base::string16, base::string16> GetCredentialLabelsForAccountChooser( |
38 const autofill::PasswordForm& form); | 38 const autofill::PasswordForm& form); |
39 | 39 |
40 // Sets the formatted |title| in the Save Password bubble or the Update Password | 40 // Sets the formatted |title| in the Save Password bubble or the Update Password |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 gfx::Range* link_range); | 91 gfx::Range* link_range); |
92 | 92 |
93 // Returns an username in the form that should be shown in the bubble. | 93 // Returns an username in the form that should be shown in the bubble. |
94 base::string16 GetDisplayUsername(const autofill::PasswordForm& form); | 94 base::string16 GetDisplayUsername(const autofill::PasswordForm& form); |
95 | 95 |
96 // Check if |profile| syncing the Auto sign-in settings (by checking that user | 96 // Check if |profile| syncing the Auto sign-in settings (by checking that user |
97 // syncs the PRIORITY_PREFERENCE). The view appearance might depend on it. | 97 // syncs the PRIORITY_PREFERENCE). The view appearance might depend on it. |
98 bool IsSyncingAutosignSetting(Profile* profile); | 98 bool IsSyncingAutosignSetting(Profile* profile); |
99 | 99 |
100 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ | 100 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ |
OLD | NEW |