| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } else { | 117 } else { |
| 118 std::string uma_histogram_suffix( | 118 std::string uma_histogram_suffix( |
| 119 password_manager::metrics_util::GroupIdToString( | 119 password_manager::metrics_util::GroupIdToString( |
| 120 password_manager::metrics_util::MonitoredDomainGroupId( | 120 password_manager::metrics_util::MonitoredDomainGroupId( |
| 121 form_to_save->realm(), GetPrefs()))); | 121 form_to_save->realm(), GetPrefs()))); |
| 122 SavePasswordInfoBarDelegate::Create( | 122 SavePasswordInfoBarDelegate::Create( |
| 123 web_contents(), form_to_save, uma_histogram_suffix); | 123 web_contents(), form_to_save, uma_histogram_suffix); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 void ChromePasswordManagerClient::ShowPasswordSaveConfirmation( |
| 128 scoped_ptr<password_manager::PasswordFormManager> saved_form) { |
| 129 if (IsTheHotNewBubbleUIEnabled()) { |
| 130 ManagePasswordsUIController* manage_passwords_ui_controller = |
| 131 ManagePasswordsUIController::FromWebContents(web_contents()); |
| 132 manage_passwords_ui_controller->ShowSaveConfirmation( |
| 133 saved_form.Pass()); |
| 134 } |
| 135 } |
| 136 |
| 127 void ChromePasswordManagerClient::PasswordWasAutofilled( | 137 void ChromePasswordManagerClient::PasswordWasAutofilled( |
| 128 const autofill::PasswordFormMap& best_matches) const { | 138 const autofill::PasswordFormMap& best_matches) const { |
| 129 ManagePasswordsUIController* manage_passwords_ui_controller = | 139 ManagePasswordsUIController* manage_passwords_ui_controller = |
| 130 ManagePasswordsUIController::FromWebContents(web_contents()); | 140 ManagePasswordsUIController::FromWebContents(web_contents()); |
| 131 if (manage_passwords_ui_controller && IsTheHotNewBubbleUIEnabled()) | 141 if (manage_passwords_ui_controller && IsTheHotNewBubbleUIEnabled()) |
| 132 manage_passwords_ui_controller->OnPasswordAutofilled(best_matches); | 142 manage_passwords_ui_controller->OnPasswordAutofilled(best_matches); |
| 133 } | 143 } |
| 134 | 144 |
| 135 void ChromePasswordManagerClient::PasswordAutofillWasBlocked( | 145 void ChromePasswordManagerClient::PasswordAutofillWasBlocked( |
| 136 const autofill::PasswordFormMap& best_matches) const { | 146 const autofill::PasswordFormMap& best_matches) const { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 | 379 |
| 370 if (command_line->HasSwitch( | 380 if (command_line->HasSwitch( |
| 371 password_manager::switches::kEnableManagerForSyncSignin)) | 381 password_manager::switches::kEnableManagerForSyncSignin)) |
| 372 return true; | 382 return true; |
| 373 | 383 |
| 374 // Default is enabled. | 384 // Default is enabled. |
| 375 std::string group_name = | 385 std::string group_name = |
| 376 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin"); | 386 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin"); |
| 377 return group_name != "Disabled"; | 387 return group_name != "Disabled"; |
| 378 } | 388 } |
| OLD | NEW |