| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 98 } |
| 99 | 99 |
| 100 void ChromePasswordManagerClient::PasswordWasAutofilled( | 100 void ChromePasswordManagerClient::PasswordWasAutofilled( |
| 101 const autofill::PasswordFormMap& best_matches) const { | 101 const autofill::PasswordFormMap& best_matches) const { |
| 102 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller = | 102 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller = |
| 103 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); | 103 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); |
| 104 if (manage_passwords_bubble_ui_controller && IsTheHotNewBubbleUIEnabled()) | 104 if (manage_passwords_bubble_ui_controller && IsTheHotNewBubbleUIEnabled()) |
| 105 manage_passwords_bubble_ui_controller->OnPasswordAutofilled(best_matches); | 105 manage_passwords_bubble_ui_controller->OnPasswordAutofilled(best_matches); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void ChromePasswordManagerClient::PasswordAutofillWasBlocked() const { | 108 void ChromePasswordManagerClient::PasswordAutofillWasBlocked( |
| 109 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller = | 109 const autofill::PasswordFormMap& best_matches) const { |
| 110 ManagePasswordsBubbleUIController* controller = |
| 110 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); | 111 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); |
| 111 if (manage_passwords_bubble_ui_controller && IsTheHotNewBubbleUIEnabled()) | 112 if (controller && IsTheHotNewBubbleUIEnabled()) |
| 112 manage_passwords_bubble_ui_controller->OnBlacklistBlockedAutofill(); | 113 controller->OnBlacklistBlockedAutofill(best_matches); |
| 113 } | 114 } |
| 114 | 115 |
| 115 void ChromePasswordManagerClient::AuthenticateAutofillAndFillForm( | 116 void ChromePasswordManagerClient::AuthenticateAutofillAndFillForm( |
| 116 scoped_ptr<autofill::PasswordFormFillData> fill_data) { | 117 scoped_ptr<autofill::PasswordFormFillData> fill_data) { |
| 117 #if defined(OS_ANDROID) | 118 #if defined(OS_ANDROID) |
| 118 PasswordAuthenticationManager::AuthenticatePasswordAutofill( | 119 PasswordAuthenticationManager::AuthenticatePasswordAutofill( |
| 119 web_contents(), | 120 web_contents(), |
| 120 base::Bind(&ChromePasswordManagerClient::CommitFillPasswordForm, | 121 base::Bind(&ChromePasswordManagerClient::CommitFillPasswordForm, |
| 121 weak_factory_.GetWeakPtr(), | 122 weak_factory_.GetWeakPtr(), |
| 122 base::Owned(fill_data.release()))); | 123 base::Owned(fill_data.release()))); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 web_contents(), | 303 web_contents(), |
| 303 web_contents()->GetView()->GetNativeView()); | 304 web_contents()->GetView()->GetNativeView()); |
| 304 popup_controller_->Show(false /* display_password */); | 305 popup_controller_->Show(false /* display_password */); |
| 305 #endif // #if defined(USE_AURA) | 306 #endif // #if defined(USE_AURA) |
| 306 } | 307 } |
| 307 | 308 |
| 308 void ChromePasswordManagerClient::CommitFillPasswordForm( | 309 void ChromePasswordManagerClient::CommitFillPasswordForm( |
| 309 autofill::PasswordFormFillData* data) { | 310 autofill::PasswordFormFillData* data) { |
| 310 driver_.FillPasswordForm(*data); | 311 driver_.FillPasswordForm(*data); |
| 311 } | 312 } |
| OLD | NEW |