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

Side by Side Diff: chrome/browser/login_prompt.cc

Issue 1656005: Fix password mgr heuristics for sites that keep the login form around after signin (Closed)
Patch Set: Responding to feedback Created 10 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/login_prompt.h" 5 #include "chrome/browser/login_prompt.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 if (!parent_contents) { 366 if (!parent_contents) {
367 // The request was probably cancelled. 367 // The request was probably cancelled.
368 return; 368 return;
369 } 369 }
370 370
371 // Tell the password manager to look for saved passwords. 371 // Tell the password manager to look for saved passwords.
372 PasswordManager* password_manager = 372 PasswordManager* password_manager =
373 parent_contents->GetPasswordManager(); 373 parent_contents->GetPasswordManager();
374 std::vector<PasswordForm> v; 374 std::vector<PasswordForm> v;
375 MakeInputForPasswordManager(&v); 375 MakeInputForPasswordManager(&v);
376 password_manager->PasswordFormsSeen(v); 376 password_manager->PasswordFormsFound(v);
377 handler_->SetPasswordManager(password_manager); 377 handler_->SetPasswordManager(password_manager);
378 378
379 std::wstring explanation = auth_info_->realm.empty() ? 379 std::wstring explanation = auth_info_->realm.empty() ?
380 l10n_util::GetStringF(IDS_LOGIN_DIALOG_DESCRIPTION_NO_REALM, 380 l10n_util::GetStringF(IDS_LOGIN_DIALOG_DESCRIPTION_NO_REALM,
381 auth_info_->host_and_port) : 381 auth_info_->host_and_port) :
382 l10n_util::GetStringF(IDS_LOGIN_DIALOG_DESCRIPTION, 382 l10n_util::GetStringF(IDS_LOGIN_DIALOG_DESCRIPTION,
383 auth_info_->host_and_port, 383 auth_info_->host_and_port,
384 auth_info_->realm); 384 auth_info_->realm);
385 handler_->BuildViewForPasswordManager(password_manager, 385 handler_->BuildViewForPasswordManager(password_manager,
386 explanation); 386 explanation);
387 } 387 }
388 388
389 private: 389 private:
390 // Helper to create a PasswordForm and stuff it into a vector as input 390 // Helper to create a PasswordForm and stuff it into a vector as input
391 // for PasswordManager::PasswordFormsSeen, the hook into PasswordManager. 391 // for PasswordManager::PasswordFormsFound, the hook into PasswordManager.
392 void MakeInputForPasswordManager( 392 void MakeInputForPasswordManager(
393 std::vector<PasswordForm>* password_manager_input) { 393 std::vector<PasswordForm>* password_manager_input) {
394 PasswordForm dialog_form; 394 PasswordForm dialog_form;
395 if (LowerCaseEqualsASCII(auth_info_->scheme, "basic")) { 395 if (LowerCaseEqualsASCII(auth_info_->scheme, "basic")) {
396 dialog_form.scheme = PasswordForm::SCHEME_BASIC; 396 dialog_form.scheme = PasswordForm::SCHEME_BASIC;
397 } else if (LowerCaseEqualsASCII(auth_info_->scheme, "digest")) { 397 } else if (LowerCaseEqualsASCII(auth_info_->scheme, "digest")) {
398 dialog_form.scheme = PasswordForm::SCHEME_DIGEST; 398 dialog_form.scheme = PasswordForm::SCHEME_DIGEST;
399 } else { 399 } else {
400 dialog_form.scheme = PasswordForm::SCHEME_OTHER; 400 dialog_form.scheme = PasswordForm::SCHEME_OTHER;
401 } 401 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 // Public API 435 // Public API
436 436
437 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, 437 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info,
438 URLRequest* request) { 438 URLRequest* request) {
439 LoginHandler* handler = LoginHandler::Create(auth_info, request); 439 LoginHandler* handler = LoginHandler::Create(auth_info, request);
440 ChromeThread::PostTask( 440 ChromeThread::PostTask(
441 ChromeThread::UI, FROM_HERE, new LoginDialogTask( 441 ChromeThread::UI, FROM_HERE, new LoginDialogTask(
442 request->url(), auth_info, handler)); 442 request->url(), auth_info, handler));
443 return handler; 443 return handler;
444 } 444 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/account_creation_view.cc ('k') | chrome/browser/password_manager/password_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698