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

Unified Diff: chrome/browser/ui/views/login_view.cc

Issue 1384283003: Do not involve PasswordManagerDriver in filling HTTP-auth forms; also check realm (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Complete with new tests Created 5 years, 2 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/views/login_view.cc
diff --git a/chrome/browser/ui/views/login_view.cc b/chrome/browser/ui/views/login_view.cc
index 50f697a6291db4e32aa1cad15b75a9fd902969a9..24a8bb88359da78624c2dbb0055229a59972386a 100644
--- a/chrome/browser/ui/views/login_view.cc
+++ b/chrome/browser/ui/views/login_view.cc
@@ -21,7 +21,8 @@ using views::GridLayout;
// LoginView, public:
LoginView::LoginView(const base::string16& explanation,
- LoginModel* model)
+ LoginModel* model,
+ const autofill::PasswordForm* observed_form)
: username_field_(new views::Textfield()),
password_field_(new views::Textfield()),
username_label_(new views::Label(
@@ -30,6 +31,7 @@ LoginView::LoginView(const base::string16& explanation,
l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_PASSWORD_FIELD))),
message_label_(new views::Label(explanation)),
login_model_(model) {
+ DCHECK_EQ(login_model_ == nullptr, observed_form == nullptr);
password_field_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
message_label_->SetMultiLine(true);
message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
@@ -76,7 +78,7 @@ LoginView::LoginView(const base::string16& explanation,
layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing);
if (login_model_)
- login_model_->AddObserver(this);
+ login_model_->AddObserverAndDeliverCredentials(this, *observed_form);
}
LoginView::~LoginView() {
@@ -99,8 +101,9 @@ views::View* LoginView::GetInitiallyFocusedView() {
///////////////////////////////////////////////////////////////////////////////
// LoginView, views::View, password_manager::LoginModelObserver overrides:
-void LoginView::OnAutofillDataAvailable(const base::string16& username,
- const base::string16& password) {
+void LoginView::OnAutofillDataAvailableInternal(
+ const base::string16& username,
+ const base::string16& password) {
if (username_field_->text().empty()) {
username_field_->SetText(username);
password_field_->SetText(password);

Powered by Google App Engine
This is Rietveld 408576698