Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1355)

Unified Diff: chrome/browser/ui/passwords/manage_passwords_view_utils.h

Issue 1181623004: [Password Manager] Replace "this site" in save password prompt with password's origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/passwords/manage_passwords_view_utils.h
diff --git a/chrome/browser/ui/passwords/manage_passwords_view_utils.h b/chrome/browser/ui/passwords/manage_passwords_view_utils.h
index 89757ca386d01ccab9a22d215f8b4982001c9310..5f70314a0be2f82c6c503a88288d1d253ee67954 100644
--- a/chrome/browser/ui/passwords/manage_passwords_view_utils.h
+++ b/chrome/browser/ui/passwords/manage_passwords_view_utils.h
@@ -5,13 +5,44 @@
#ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_
#define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_
+#include "base/strings/string16.h"
+
+namespace content {
+class WebContents;
+} // namespace content
+
namespace gfx {
class ImageSkia;
+class Range;
} // namespace gfx
+class GURL;
+
// The desired width and height in pixels for an account avatar.
extern const int kAvatarImageSize;
// Crops and scales |image_skia| to the desired size for an account avatar.
gfx::ImageSkia ScaleImageForAccountAvatar(gfx::ImageSkia image_skia);
+
+// This function sets formatted |tilte| in the "Save Password" dialog bubble. If
+// the hostname of |web_contents|'s visible URL differs from the hostname of
+// |form_origin|, sets resource string |IDS_SAVE_PASSWORD_TITLE| as the |title|
+// containing |form_origin|'s url with formatting that:
+//
+// - omits the path for standard schemes, excepting file and filesystem,
+// - omits the port if it is the default for the scheme,
+// - elides the standard schemes if scheme of |web_contents|'s visible URL
+// differs from the scheme of |form_origin|, excepting file and filesystem;
+//
+// otherwise sets resource string |IDS_SAVE_PASSWORD| as the |title| having
+// "this site". If |is_smartlock_branding_enabled| is true sets the
+// |title_link_range| for the "Google Smart Lock" text to be set as a hyperlink
+// in the dialog bubble.
+void GetSavePasswordTitleTextAndLinkRange(
+ const content::WebContents* web_contents,
+ const GURL& form_origin,
+ bool is_smartlock_branding_enabled,
+ base::string16* title,
+ gfx::Range* title_link_range);
+
#endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_VIEW_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698