OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/login_view.h" | 5 #include "chrome/browser/ui/views/login_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 bool enable_chrome_style) | 31 bool enable_chrome_style) |
32 : username_field_(new views::Textfield), | 32 : username_field_(new views::Textfield), |
33 password_field_(new views::Textfield(views::Textfield::STYLE_OBSCURED)), | 33 password_field_(new views::Textfield(views::Textfield::STYLE_OBSCURED)), |
34 username_label_(new views::Label( | 34 username_label_(new views::Label( |
35 l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_USERNAME_FIELD))), | 35 l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_USERNAME_FIELD))), |
36 password_label_(new views::Label( | 36 password_label_(new views::Label( |
37 l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_PASSWORD_FIELD))), | 37 l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_PASSWORD_FIELD))), |
38 message_label_(new views::Label(explanation)), | 38 message_label_(new views::Label(explanation)), |
39 login_model_(model) { | 39 login_model_(model) { |
40 message_label_->SetMultiLine(true); | 40 message_label_->SetMultiLine(true); |
41 message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 41 message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
42 message_label_->SetAllowCharacterBreak(true); | 42 message_label_->SetAllowCharacterBreak(true); |
43 | 43 |
44 // Initialize the Grid Layout Manager used for this dialog box. | 44 // Initialize the Grid Layout Manager used for this dialog box. |
45 GridLayout* layout = GridLayout::CreatePanel(this); | 45 GridLayout* layout = GridLayout::CreatePanel(this); |
46 SetLayoutManager(layout); | 46 SetLayoutManager(layout); |
47 | 47 |
48 if (enable_chrome_style) | 48 if (enable_chrome_style) |
49 layout->SetInsets(0, 0, ConstrainedWindowConstants::kRowPadding, 0); | 49 layout->SetInsets(0, 0, ConstrainedWindowConstants::kRowPadding, 0); |
50 | 50 |
51 // Add the column set for the information message at the top of the dialog | 51 // Add the column set for the information message at the top of the dialog |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // LoginView, views::View, views::LoginModelObserver overrides: | 116 // LoginView, views::View, views::LoginModelObserver overrides: |
117 | 117 |
118 void LoginView::OnAutofillDataAvailable(const string16& username, | 118 void LoginView::OnAutofillDataAvailable(const string16& username, |
119 const string16& password) { | 119 const string16& password) { |
120 if (username_field_->text().empty()) { | 120 if (username_field_->text().empty()) { |
121 username_field_->SetText(username); | 121 username_field_->SetText(username); |
122 password_field_->SetText(password); | 122 password_field_->SetText(password); |
123 username_field_->SelectAll(true); | 123 username_field_->SelectAll(true); |
124 } | 124 } |
125 } | 125 } |
OLD | NEW |