Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / passwords / manage_passwords_view_utils.h
blob51a0e0e6752333f246d4a01bd2165f19f80f9071
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"
10 namespace gfx {
11 class ImageSkia;
12 class Range;
13 } // namespace gfx
15 class GURL;
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
32 // dialog bubble.
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 Account Chooser UI.
42 // If |is_smartlock_branding_enabled| is true, sets the |title_link_range| for
43 // the "Google Smart Lock" text range to be set visibly as a hyperlink in the
44 // dialog bubble otherwise chooses the title which doesn't contain Smart Lock
45 // branding.
46 void GetAccountChooserDialogTitleTextAndLinkRange(
47 bool is_smartlock_branding_enabled,
48 base::string16* title,
49 gfx::Range* title_link_range);
51 #endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_