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 19e3d7e39e71d8f6abe01bd81df5fc9b6e961bd2..25a2eecfee1ff7aea2293d6b90aea78da2cebb39 100644 |
| --- a/chrome/browser/password_manager/chrome_password_manager_client.cc |
| +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc |
| @@ -88,6 +88,11 @@ |
| #include "extensions/common/constants.h" |
| #endif |
| +#include "device/vr/features/features.h" |
|
vasilii
2017/06/30 11:52:15
unused?
vabr (Chromium)
2017/06/30 12:14:43
It's used for ENABLE_VR.
Theoretically, this shou
|
| +#if BUILDFLAG(ENABLE_VR) |
| +#include "chrome/browser/android/vr_shell/vr_tab_helper.h" |
| +#endif // BUILDFLAG(ENABLE_VR) |
| + |
| using password_manager::ContentPasswordManagerDriverFactory; |
| using password_manager::PasswordManagerInternalsService; |
| using sessions::SerializedNavigationEntry; |
| @@ -209,6 +214,9 @@ bool ChromePasswordManagerClient::IsPasswordManagementEnabledForCurrentPage() |
| is_enabled = |
| entry->GetURL().host_piece() != chrome::kChromeUIChromeSigninHost; |
| } |
| + if (IsInVr()) { |
|
vabr (Chromium)
2017/06/30 10:06:07
Given that this is the only necessary use of IsInV
billorr
2017/06/30 17:54:18
Done.
|
| + is_enabled = false; |
| + } |
| if (log_manager_->IsLoggingActive()) { |
| password_manager::BrowserSavePasswordProgressLogger logger( |
| log_manager_.get()); |
| @@ -252,7 +260,9 @@ bool ChromePasswordManagerClient::OnCredentialManagerUsed() { |
| prerender_contents->Destroy(prerender::FINAL_STATUS_CREDENTIAL_MANAGER_API); |
| return false; |
| } |
| - return true; |
| + |
| + // The credential manager is not used while in VR. |
| + return !IsInVr(); |
|
vabr (Chromium)
2017/06/30 10:06:07
No need to check this again, the IsPasswordManagem
billorr
2017/06/30 17:54:18
Done.
|
| } |
| bool ChromePasswordManagerClient::PromptUserToSaveOrUpdatePassword( |
| @@ -292,6 +302,10 @@ bool ChromePasswordManagerClient::PromptUserToChooseCredentials( |
| std::vector<std::unique_ptr<autofill::PasswordForm>> local_forms, |
| const GURL& origin, |
| const CredentialsCallback& callback) { |
| + // Do not show popup dialogs while in VR. |
| + if (IsInVr()) |
|
vabr (Chromium)
2017/06/30 10:06:07
This is also covered by IsPasswordManagementEnable
billorr
2017/06/30 17:54:18
Done.
|
| + return false; |
| + |
| // Set up an intercept callback if the prompt is zero-clickable (e.g. just one |
| // form provided). |
| CredentialsCallback intercept = |
| @@ -551,6 +565,14 @@ bool ChromePasswordManagerClient::IsIncognito() const { |
| return web_contents()->GetBrowserContext()->IsOffTheRecord(); |
| } |
| +bool ChromePasswordManagerClient::IsInVr() const { |
| +#if BUILDFLAG(ENABLE_VR) |
| + return vr_shell::VrTabHelper::IsInVr(web_contents()); |
| +#else |
| + return false; |
| +#endif // BUILDFLAG(ENABLE_VR) |
| +} |
| + |
| const password_manager::PasswordManager* |
| ChromePasswordManagerClient::GetPasswordManager() const { |
| return &password_manager_; |
| @@ -625,7 +647,7 @@ void ChromePasswordManagerClient::PromptUserToEnableAutosigninIfNecessary() { |
| GetPrefs()) || |
| !GetPrefs()->GetBoolean( |
| password_manager::prefs::kCredentialsEnableAutosignin) || |
| - IsIncognito()) |
| + IsIncognito() || IsInVr()) |
|
vabr (Chromium)
2017/06/30 10:06:07
This is also unnecessary. The two codepaths leadin
billorr
2017/06/30 17:54:18
Done.
|
| return; |
| #if defined(OS_ANDROID) |