Chromium Code Reviews| Index: chrome/browser/ui/android/chrome_http_auth_handler.cc |
| diff --git a/chrome/browser/ui/android/chrome_http_auth_handler.cc b/chrome/browser/ui/android/chrome_http_auth_handler.cc |
| index 881e205cccc5550d62843700b6483b8753460daf..193d24a7e90491d5623178cbe163750dab2b6f07 100644 |
| --- a/chrome/browser/ui/android/chrome_http_auth_handler.cc |
| +++ b/chrome/browser/ui/android/chrome_http_auth_handler.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/android/scoped_java_ref.h" |
| #include "base/logging.h" |
| #include "base/strings/string16.h" |
| +#include "base/strings/utf_string_conversions.h" |
| #include "chrome/grit/generated_resources.h" |
| #include "jni/ChromeHttpAuthHandler_jni.h" |
| #include "ui/base/l10n/l10n_util.h" |
| @@ -21,10 +22,9 @@ using base::android::ConvertJavaStringToUTF16; |
| using base::android::ConvertUTF16ToJavaString; |
| using base::android::ScopedJavaLocalRef; |
| -ChromeHttpAuthHandler::ChromeHttpAuthHandler(const base::string16& explanation) |
| - : observer_(NULL), |
| - explanation_(explanation) { |
| -} |
| +ChromeHttpAuthHandler::ChromeHttpAuthHandler(const base::string16& authority, |
| + const base::string16& explanation) |
| + : observer_(nullptr), authority_(authority), explanation_(explanation) {} |
| ChromeHttpAuthHandler::~ChromeHttpAuthHandler() {} |
| @@ -79,7 +79,10 @@ void ChromeHttpAuthHandler::CancelAuth(JNIEnv* env, jobject) { |
| ScopedJavaLocalRef<jstring> ChromeHttpAuthHandler::GetMessageBody( |
| JNIEnv* env, jobject) { |
| - return ConvertUTF16ToJavaString(env, explanation_); |
| + if (explanation_.empty()) |
| + return ConvertUTF16ToJavaString(env, authority_); |
| + return ConvertUTF16ToJavaString( |
| + env, authority_ + base::ASCIIToUTF16(" ") + explanation_); |
|
Yaron
2015/11/23 16:56:14
You may want to put this into another TextView. Ot
palmer
2015/11/24 00:15:42
Well, there's not much vertical room to spare. You
Yaron
2015/11/24 16:01:28
hmm. I suppose that's reasonable.
+newt in case h
newt (away)
2015/11/24 16:57:28
A space between sentences doesn't localize especia
|
| } |
| // static |