Index: chrome/browser/ui/views/login_view.cc |
diff --git a/chrome/browser/ui/views/login_view.cc b/chrome/browser/ui/views/login_view.cc |
index 78768e7fe0b91423630c791cb190967307fcc8be..77337702b3eaab14c77a712e7e6f4a4a152c8817 100644 |
--- a/chrome/browser/ui/views/login_view.cc |
+++ b/chrome/browser/ui/views/login_view.cc |
@@ -6,6 +6,7 @@ |
#include "chrome/grit/generated_resources.h" |
#include "ui/base/l10n/l10n_util.h" |
+#include "ui/views/background.h" |
#include "ui/views/controls/label.h" |
#include "ui/views/controls/textfield/textfield.h" |
#include "ui/views/layout/grid_layout.h" |
@@ -20,7 +21,8 @@ using views::GridLayout; |
/////////////////////////////////////////////////////////////////////////////// |
// LoginView, public: |
-LoginView::LoginView(const base::string16& explanation, |
+LoginView::LoginView(const base::string16& authority, |
+ const base::string16& explanation, |
LoginHandler::LoginModelData* login_model_data) |
: username_field_(new views::Textfield()), |
password_field_(new views::Textfield()), |
@@ -28,12 +30,19 @@ LoginView::LoginView(const base::string16& explanation, |
l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_USERNAME_FIELD))), |
password_label_(new views::Label( |
l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_PASSWORD_FIELD))), |
+ authority_label_(new views::Label(authority)), |
message_label_(new views::Label(explanation)), |
login_model_(login_model_data ? login_model_data->model : nullptr) { |
password_field_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); |
+ |
+ authority_label_->SetMultiLine(true); |
+ authority_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
+ authority_label_->SetAllowCharacterBreak(true); |
+ |
message_label_->SetMultiLine(true); |
message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
message_label_->SetAllowCharacterBreak(true); |
+ message_label_->SetEnabledColor(SK_ColorGRAY); |
// Initialize the Grid Layout Manager used for this dialog box. |
GridLayout* layout = GridLayout::CreatePanel(this); |
@@ -59,7 +68,12 @@ LoginView::LoginView(const base::string16& explanation, |
column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing); |
layout->StartRow(0, single_column_view_set_id); |
- layout->AddView(message_label_); |
+ layout->AddView(authority_label_); |
+ if (!explanation.empty()) { |
+ layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
+ layout->StartRow(0, single_column_view_set_id); |
+ layout->AddView(message_label_); |
+ } |
layout->AddPaddingRow(0, views::kUnrelatedControlLargeVerticalSpacing); |