| 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 <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 bool ChromePasswordManagerClient::IsSavingAndFillingEnabledForCurrentPage() | 201 bool ChromePasswordManagerClient::IsSavingAndFillingEnabledForCurrentPage() |
| 202 const { | 202 const { |
| 203 // TODO(melandory): remove saving_and_filling_passwords_enabled_ check from | 203 // TODO(melandory): remove saving_and_filling_passwords_enabled_ check from |
| 204 // here once we decide to switch to new settings behavior for everyone. | 204 // here once we decide to switch to new settings behavior for everyone. |
| 205 return *saving_and_filling_passwords_enabled_ && !IsOffTheRecord() && | 205 return *saving_and_filling_passwords_enabled_ && !IsOffTheRecord() && |
| 206 IsFillingEnabledForCurrentPage(); | 206 IsFillingEnabledForCurrentPage(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 bool ChromePasswordManagerClient::IsFillingEnabledForCurrentPage() const { | 209 bool ChromePasswordManagerClient::IsFillingEnabledForCurrentPage() const { |
| 210 return (!password_manager::IsSettingsBehaviorChangeActive() || | 210 return !DidLastPageLoadEncounterSSLErrors() && |
| 211 *saving_and_filling_passwords_enabled_) && | |
| 212 !DidLastPageLoadEncounterSSLErrors() && | |
| 213 IsPasswordManagementEnabledForCurrentPage(); | 211 IsPasswordManagementEnabledForCurrentPage(); |
| 214 } | 212 } |
| 215 | 213 |
| 216 bool ChromePasswordManagerClient::OnCredentialManagerUsed() { | 214 bool ChromePasswordManagerClient::OnCredentialManagerUsed() { |
| 217 prerender::PrerenderContents* prerender_contents = | 215 prerender::PrerenderContents* prerender_contents = |
| 218 prerender::PrerenderContents::FromWebContents(web_contents()); | 216 prerender::PrerenderContents::FromWebContents(web_contents()); |
| 219 if (prerender_contents) { | 217 if (prerender_contents) { |
| 220 prerender_contents->Destroy(prerender::FINAL_STATUS_CREDENTIAL_MANAGER_API); | 218 prerender_contents->Destroy(prerender::FINAL_STATUS_CREDENTIAL_MANAGER_API); |
| 221 return false; | 219 return false; |
| 222 } | 220 } |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 ChromePasswordManagerClient::FromWebContents(web_contents); | 617 ChromePasswordManagerClient::FromWebContents(web_contents); |
| 620 | 618 |
| 621 // Try to bind to the driver, but if driver is not available for this render | 619 // Try to bind to the driver, but if driver is not available for this render |
| 622 // frame host, the request will be just dropped. This will cause the message | 620 // frame host, the request will be just dropped. This will cause the message |
| 623 // pipe to be closed, which will raise a connection error on the peer side. | 621 // pipe to be closed, which will raise a connection error on the peer side. |
| 624 if (!instance) | 622 if (!instance) |
| 625 return; | 623 return; |
| 626 | 624 |
| 627 instance->credential_manager_impl_.BindRequest(std::move(request)); | 625 instance->credential_manager_impl_.BindRequest(std::move(request)); |
| 628 } | 626 } |
| OLD | NEW |