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

Side by Side Diff: chrome/browser/password_manager/password_form_manager.cc

Issue 9564001: Clean up password manager code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a unit test for sub-frame navigation Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/password_manager/password_form_manager.h" 5 #include "chrome/browser/password_manager/password_form_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/string_split.h" 10 #include "base/string_split.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // either: (1) we are in Incognito mode, or (2) the ACTION paths don't match. 298 // either: (1) we are in Incognito mode, or (2) the ACTION paths don't match.
299 bool wait_for_username = 299 bool wait_for_username =
300 profile_->IsOffTheRecord() || 300 profile_->IsOffTheRecord() ||
301 observed_form_.action.GetWithEmptyPath() != 301 observed_form_.action.GetWithEmptyPath() !=
302 preferred_match_->action.GetWithEmptyPath(); 302 preferred_match_->action.GetWithEmptyPath();
303 if (wait_for_username) 303 if (wait_for_username)
304 manager_action_ = kManagerActionNone; 304 manager_action_ = kManagerActionNone;
305 else 305 else
306 manager_action_ = kManagerActionAutofilled; 306 manager_action_ = kManagerActionAutofilled;
307 password_manager_->Autofill(observed_form_, best_matches_, 307 password_manager_->Autofill(observed_form_, best_matches_,
308 preferred_match_, wait_for_username); 308 *preferred_match_, wait_for_username);
309 } 309 }
310 310
311 void PasswordFormManager::OnPasswordStoreRequestDone( 311 void PasswordFormManager::OnPasswordStoreRequestDone(
312 CancelableRequestProvider::Handle handle, 312 CancelableRequestProvider::Handle handle,
313 const std::vector<PasswordForm*>& result) { 313 const std::vector<PasswordForm*>& result) {
314 DCHECK_EQ(state_, MATCHING_PHASE); 314 DCHECK_EQ(state_, MATCHING_PHASE);
315 DCHECK_EQ(pending_login_query_, handle); 315 DCHECK_EQ(pending_login_query_, handle);
316 316
317 if (result.empty()) { 317 if (result.empty()) {
318 state_ = POST_MATCHING_PHASE; 318 state_ = POST_MATCHING_PHASE;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 return score; 474 return score;
475 } 475 }
476 476
477 void PasswordFormManager::SubmitPassed() { 477 void PasswordFormManager::SubmitPassed() {
478 submit_result_ = kSubmitResultPassed; 478 submit_result_ = kSubmitResultPassed;
479 } 479 }
480 480
481 void PasswordFormManager::SubmitFailed() { 481 void PasswordFormManager::SubmitFailed() {
482 submit_result_ = kSubmitResultFailed; 482 submit_result_ = kSubmitResultFailed;
483 } 483 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698