OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |