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 |
| 10 namespace content { |
| 11 class WebContents; |
| 12 } // namespace content |
| 13 |
8 namespace gfx { | 14 namespace gfx { |
9 class ImageSkia; | 15 class ImageSkia; |
| 16 class Range; |
10 } // namespace gfx | 17 } // namespace gfx |
11 | 18 |
| 19 class GURL; |
| 20 |
12 // The desired width and height in pixels for an account avatar. | 21 // The desired width and height in pixels for an account avatar. |
13 extern const int kAvatarImageSize; | 22 extern const int kAvatarImageSize; |
14 | 23 |
15 // Crops and scales |image_skia| to the desired size for an account avatar. | 24 // Crops and scales |image_skia| to the desired size for an account avatar. |
16 gfx::ImageSkia ScaleImageForAccountAvatar(gfx::ImageSkia image_skia); | 25 gfx::ImageSkia ScaleImageForAccountAvatar(gfx::ImageSkia image_skia); |
| 26 |
| 27 // This function sets formatted |tilte| in the "Save Password" dialog bubble. If |
| 28 // the hostname of |web_contents|'s visible URL differs from the hostname of |
| 29 // |form_origin|, sets resource string |IDS_SAVE_PASSWORD_TITLE| as the |title| |
| 30 // containing |form_origin|'s url with formatting that: |
| 31 // |
| 32 // - omits the path for standard schemes, excepting file and filesystem, |
| 33 // - omits the port if it is the default for the scheme, |
| 34 // - elides the standard schemes if scheme of |web_contents|'s visible URL |
| 35 // differs from the scheme of |form_origin|, excepting file and filesystem; |
| 36 // |
| 37 // otherwise sets resource string |IDS_SAVE_PASSWORD| as the |title| having |
| 38 // "this site". If |is_smartlock_branding_enabled| is true sets the |
| 39 // |title_link_range| for the "Google Smart Lock" text to be set as a hyperlink |
| 40 // in the dialog bubble. |
| 41 void GetSavePasswordTitleTextAndLinkRange( |
| 42 const content::WebContents* web_contents, |
| 43 const GURL& form_origin, |
| 44 bool is_smartlock_branding_enabled, |
| 45 base::string16* title, |
| 46 gfx::Range* title_link_range); |
| 47 |
17 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ | 48 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_ |
OLD | NEW |