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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 void ChromePasswordManagerClient::PasswordWasAutofilled( | 106 void ChromePasswordManagerClient::PasswordWasAutofilled( |
107 const autofill::PasswordFormMap& best_matches) const { | 107 const autofill::PasswordFormMap& best_matches) const { |
108 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller = | 108 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller = |
109 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); | 109 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); |
110 if (manage_passwords_bubble_ui_controller && IsTheHotNewBubbleUIEnabled()) | 110 if (manage_passwords_bubble_ui_controller && IsTheHotNewBubbleUIEnabled()) |
111 manage_passwords_bubble_ui_controller->OnPasswordAutofilled(best_matches); | 111 manage_passwords_bubble_ui_controller->OnPasswordAutofilled(best_matches); |
112 } | 112 } |
113 | 113 |
114 void ChromePasswordManagerClient::PasswordAutofillWasBlocked() const { | 114 void ChromePasswordManagerClient::PasswordAutofillWasBlocked( |
115 ManagePasswordsBubbleUIController* manage_passwords_bubble_ui_controller = | 115 const autofill::PasswordFormMap& best_matches) const { |
| 116 ManagePasswordsBubbleUIController* controller = |
116 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); | 117 ManagePasswordsBubbleUIController::FromWebContents(web_contents()); |
117 if (manage_passwords_bubble_ui_controller && IsTheHotNewBubbleUIEnabled()) | 118 if (controller && IsTheHotNewBubbleUIEnabled()) |
118 manage_passwords_bubble_ui_controller->OnBlacklistBlockedAutofill(); | 119 controller->OnBlacklistBlockedAutofill(best_matches); |
119 } | 120 } |
120 | 121 |
121 void ChromePasswordManagerClient::AuthenticateAutofillAndFillForm( | 122 void ChromePasswordManagerClient::AuthenticateAutofillAndFillForm( |
122 scoped_ptr<autofill::PasswordFormFillData> fill_data) { | 123 scoped_ptr<autofill::PasswordFormFillData> fill_data) { |
123 #if defined(OS_ANDROID) | 124 #if defined(OS_ANDROID) |
124 PasswordAuthenticationManager::AuthenticatePasswordAutofill( | 125 PasswordAuthenticationManager::AuthenticatePasswordAutofill( |
125 web_contents(), | 126 web_contents(), |
126 base::Bind(&ChromePasswordManagerClient::CommitFillPasswordForm, | 127 base::Bind(&ChromePasswordManagerClient::CommitFillPasswordForm, |
127 weak_factory_.GetWeakPtr(), | 128 weak_factory_.GetWeakPtr(), |
128 base::Owned(fill_data.release()))); | 129 base::Owned(fill_data.release()))); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 web_contents(), | 308 web_contents(), |
308 web_contents()->GetNativeView()); | 309 web_contents()->GetNativeView()); |
309 popup_controller_->Show(false /* display_password */); | 310 popup_controller_->Show(false /* display_password */); |
310 #endif // #if defined(USE_AURA) | 311 #endif // #if defined(USE_AURA) |
311 } | 312 } |
312 | 313 |
313 void ChromePasswordManagerClient::CommitFillPasswordForm( | 314 void ChromePasswordManagerClient::CommitFillPasswordForm( |
314 autofill::PasswordFormFillData* data) { | 315 autofill::PasswordFormFillData* data) { |
315 driver_.FillPasswordForm(*data); | 316 driver_.FillPasswordForm(*data); |
316 } | 317 } |
OLD | NEW |