| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool ChromePasswordManagerClient::IsSyncAccountCredential( | 163 bool ChromePasswordManagerClient::IsSyncAccountCredential( |
| 164 const std::string& username, const std::string& origin) const { | 164 const std::string& username, const std::string& origin) const { |
| 165 return password_manager_sync_metrics::IsSyncAccountCredential( | 165 return password_manager_sync_metrics::IsSyncAccountCredential( |
| 166 profile_, username, origin); | 166 profile_, username, origin); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void ChromePasswordManagerClient::AskUserAndMaybeReportURL( | 169 void ChromePasswordManagerClient::AskUserAndMaybeReportURL( |
| 170 const std::string& url) const { | 170 const std::string& url) const { |
| 171 // TODO(melandory) Show bubble which asks user if he wants to report the URL | 171 ManagePasswordsUIController* manage_passwords_ui_controller = |
| 172 // and report URL if needed. | 172 ManagePasswordsUIController::FromWebContents(web_contents()); |
| 173 manage_passwords_ui_controller->OnAskToReportURL(url); |
| 173 } | 174 } |
| 174 | 175 |
| 175 void ChromePasswordManagerClient::AutofillResultsComputed() { | 176 void ChromePasswordManagerClient::AutofillResultsComputed() { |
| 176 UMA_HISTOGRAM_BOOLEAN("PasswordManager.SyncCredentialFiltered", | 177 UMA_HISTOGRAM_BOOLEAN("PasswordManager.SyncCredentialFiltered", |
| 177 sync_credential_was_filtered_); | 178 sync_credential_was_filtered_); |
| 178 sync_credential_was_filtered_ = false; | 179 sync_credential_was_filtered_ = false; |
| 179 } | 180 } |
| 180 | 181 |
| 181 bool ChromePasswordManagerClient::PromptUserToSavePassword( | 182 bool ChromePasswordManagerClient::PromptUserToSavePassword( |
| 182 scoped_ptr<password_manager::PasswordFormManager> form_to_save) { | 183 scoped_ptr<password_manager::PasswordFormManager> form_to_save) { |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 | 541 |
| 541 if (group_name == "DisallowSyncCredentialsForReauth") { | 542 if (group_name == "DisallowSyncCredentialsForReauth") { |
| 542 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH; | 543 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH; |
| 543 } else if (group_name == "DisallowSyncCredentials") { | 544 } else if (group_name == "DisallowSyncCredentials") { |
| 544 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; | 545 autofill_sync_state_ = DISALLOW_SYNC_CREDENTIALS; |
| 545 } else { | 546 } else { |
| 546 // Allow by default. | 547 // Allow by default. |
| 547 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; | 548 autofill_sync_state_ = ALLOW_SYNC_CREDENTIALS; |
| 548 } | 549 } |
| 549 } | 550 } |
| OLD | NEW |