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" |
| 9 |
8 namespace gfx { | 10 namespace gfx { |
9 class ImageSkia; | 11 class ImageSkia; |
| 12 class Range; |
10 } // namespace gfx | 13 } // namespace gfx |
11 | 14 |
| 15 class GURL; |
| 16 |
12 // The desired width and height in pixels for an account avatar. | 17 // The desired width and height in pixels for an account avatar. |
13 extern const int kAvatarImageSize; | 18 extern const int kAvatarImageSize; |
14 | 19 |
15 // Crops and scales |image_skia| to the desired size for an account avatar. | 20 // Crops and scales |image_skia| to the desired size for an account avatar. |
16 gfx::ImageSkia ScaleImageForAccountAvatar(gfx::ImageSkia image_skia); | 21 gfx::ImageSkia ScaleImageForAccountAvatar(gfx::ImageSkia image_skia); |
| 22 |
| 23 // Sets the formatted |title| in the Save Password bubble. If the registry |
| 24 // controlled domain of |user_visible_url| (i.e. the one seen in the omnibox) |
| 25 // differs from the registry controlled domain of |form_origin_url|, sets |
| 26 // |IDS_SAVE_PASSWORD_TITLE| as the |title| so that it replaces "this site" in |
| 27 // title text with output of |FormatUrlForSecurityDisplay(form_origin_url)|. |
| 28 // Otherwise, sets |IDS_SAVE_PASSWORD| as the |title| having "this site". |
| 29 // If |is_smartlock_branding_enabled| is true, sets the |title_link_range| for |
| 30 // the "Google Smart Lock" text range to be set visibly as a hyperlink in the |
| 31 // dialog bubble. |
| 32 void GetSavePasswordDialogTitleTextAndLinkRange( |
| 33 const GURL& user_visible_url, |
| 34 const GURL& form_origin_url, |
| 35 bool is_smartlock_branding_enabled, |
| 36 base::string16* title, |
| 37 gfx::Range* title_link_range); |
| 38 |
17 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ | 39 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ |
OLD | NEW |