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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_
6 #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_
8 #include "base/strings/string16.h"
17 // The desired width and height in pixels for an account avatar.
18 extern const int kAvatarImageSize
;
20 // Crops and scales |image_skia| to the desired size for an account avatar.
21 gfx::ImageSkia
ScaleImageForAccountAvatar(gfx::ImageSkia image_skia
);
23 // Sets the formatted |title| in the Save Password bubble or the Update Password
24 // bubble (depending on |is_update_password_bubble|). If the registry
25 // controlled domain of |user_visible_url| (i.e. the one seen in the omnibox)
26 // differs from the registry controlled domain of |form_origin_url|, sets
27 // |IDS_SAVE_PASSWORD_TITLE| as the |title| so that it replaces "this site" in
28 // title text with output of |FormatUrlForSecurityDisplay(form_origin_url)|.
29 // Otherwise, sets |IDS_SAVE_PASSWORD| as the |title| having "this site".
30 // If |is_smartlock_branding_enabled| is true, sets the |title_link_range| for
31 // the "Google Smart Lock" text range to be set visibly as a hyperlink in the
33 void GetSavePasswordDialogTitleTextAndLinkRange(
34 const GURL
& user_visible_url
,
35 const GURL
& form_origin_url
,
36 bool is_smartlock_branding_enabled
,
37 bool is_update_password_bubble
,
38 base::string16
* title
,
39 gfx::Range
* title_link_range
);
41 // Sets the formatted |title| in the Manage Passwords bubble. If the registry
42 // controlled domain of |user_visible_url| (i.e. the one seen in the omnibox)
43 // differs from the domain of the managed password origin URL
44 // |password_origin_url|, sets |IDS_MANAGE_PASSWORDS_TITLE_DIFFERENT_DOMAIN| as
45 // the |title| so that it replaces "this site" in title text with output of
46 // |FormatUrlForSecurityDisplay(password_origin_url)|.
47 // Otherwise, sets |IDS_MANAGE_PASSWORDS_TITLE| as the |title| having
49 void GetManagePasswordsDialogTitleText(const GURL
& user_visible_url
,
50 const GURL
& password_origin_url
,
51 base::string16
* title
);
53 // Sets the formatted |title| in the Account Chooser UI.
54 // If |is_smartlock_branding_enabled| is true, sets the |title_link_range| for
55 // the "Google Smart Lock" text range to be set visibly as a hyperlink in the
56 // dialog bubble otherwise chooses the title which doesn't contain Smart Lock
58 void GetAccountChooserDialogTitleTextAndLinkRange(
59 bool is_smartlock_branding_enabled
,
60 base::string16
* title
,
61 gfx::Range
* title_link_range
);
63 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_