diff options
-rw-r--r-- | chrome/app/generated_resources.grd | 2 | ||||
-rw-r--r-- | chrome/browser/ui/login/login_prompt.cc | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index cd4c110..a9ea038 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -3375,7 +3375,7 @@ Other platform defines such as use_titlecase are declared in build/common.gypi. Authentication Required </message> <message name="IDS_LOGIN_DIALOG_DESCRIPTION" desc="String to be displayed in the login prompt dialog to explain what the user needs to do"> - The server <ph name="DOMAIN">$1<ex>google.com</ex></ph> at <ph name="REALM">$2<ex>site name</ex></ph> requires a username and password. + The server <ph name="DOMAIN">$1<ex>google.com</ex></ph> requires a username and password. The server says: <ph name="REALM">$2<ex>opaque string</ex></ph>. </message> <message name="IDS_LOGIN_DIALOG_DESCRIPTION_NO_REALM" desc="String to be displayed in the login prompt dialog to explain what the user needs to do"> The server <ph name="DOMAIN">$1<ex>google.com</ex></ph> requires a username and password. diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc index 2a28022..d34673f 100644 --- a/chrome/browser/ui/login/login_prompt.cc +++ b/chrome/browser/ui/login/login_prompt.cc @@ -26,6 +26,7 @@ #include "net/base/net_util.h" #include "net/url_request/url_request.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/base/text/text_elider.h" using webkit_glue::PasswordForm; @@ -414,7 +415,12 @@ class LoginDialogTask : public Task { handler_->SetPasswordManager(password_manager); string16 host_and_port_hack16 = WideToUTF16Hack(auth_info_->host_and_port); - string16 realm_hack16 = WideToUTF16Hack(auth_info_->realm); + + // The realm is controlled by the remote server, so there is no reason + // to believe it is of a reasonable length. + string16 realm_hack16; + ui::ElideString(WideToUTF16Hack(auth_info_->realm), 120, &realm_hack16); + string16 explanation = realm_hack16.empty() ? l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_DESCRIPTION_NO_REALM, host_and_port_hack16) : |