Chromium Code Reviews| Index: chrome/browser/password_manager/chrome_password_manager_client.cc |
| diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc |
| index 518a64b5275529cc8231958e7b4f54ae7a437301..4d2968cc61a71e6441153aee5428c612c05b3490 100644 |
| --- a/chrome/browser/password_manager/chrome_password_manager_client.cc |
| +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc |
| @@ -18,6 +18,7 @@ |
| #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/chrome_version_info.h" |
| +#include "chrome/common/url_constants.h" |
| #include "components/autofill/content/common/autofill_messages.h" |
| #include "components/autofill/core/browser/password_generator.h" |
| #include "components/autofill/core/common/password_form.h" |
| @@ -28,6 +29,7 @@ |
| #include "components/password_manager/core/browser/password_manager_internals_service.h" |
| #include "components/password_manager/core/browser/password_manager_metrics_util.h" |
| #include "components/password_manager/core/common/password_manager_switches.h" |
| +#include "content/public/browser/navigation_entry.h" |
| #include "content/public/browser/render_view_host.h" |
| #include "content/public/browser/web_contents.h" |
| @@ -101,6 +103,21 @@ bool ChromePasswordManagerClient::IsAutomaticPasswordSavingEnabled() const { |
| chrome::VersionInfo::CHANNEL_UNKNOWN; |
| } |
| +bool ChromePasswordManagerClient::IsPasswordManagerEnabledForCurrentPage() |
| + const { |
| + DCHECK(web_contents()); |
| + content::NavigationEntry* entry = |
| + web_contents()->GetController().GetLastCommittedEntry(); |
| + if (!entry) { |
| + NOTREACHED(); |
|
vabr (Chromium)
2014/06/24 08:49:49
Could we leave out the NOTREACHED?
I'm currently w
vabr (Chromium)
2014/06/24 14:28:24
I looked into the NOTREACHED a bit more: http://cr
Garrett Casto
2014/07/07 21:09:02
Added.
|
| + return true; |
| + } |
| + // We neither fill nor save password when a user is signing in for sync. This |
| + // is because users need to remember their password if they are syncing as |
| + // this is effectively their master password. |
| + return entry->GetURL().host() != chrome::kChromeUIChromeSigninHost; |
|
Roger Tawa OOO till Jul 10th
2014/06/26 14:15:05
The chrome://chrome-signin/ page hosts a regular g
Garrett Casto
2014/07/07 21:09:02
Yeah, as long as we can uniquely identify the page
|
| +} |
| + |
| void ChromePasswordManagerClient::PromptUserToSavePassword( |
| password_manager::PasswordFormManager* form_to_save) { |
| if (IsTheHotNewBubbleUIEnabled()) { |