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 b85147dd480d01941d6b859ea38b71b67b70e1e1..e4ccba94c7635e2e1a05697629fe23b9d521947e 100644 |
| --- a/chrome/browser/password_manager/chrome_password_manager_client.cc |
| +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc |
| @@ -86,6 +86,11 @@ |
| #include "extensions/common/constants.h" |
| #endif |
| +#include "device/vr/features/features.h" |
|
vasilii
2017/06/26 10:38:27
unused
billorr
2017/06/29 22:26:02
It is used for the definition of ENABLE_VR.
|
| +#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; |
| @@ -296,6 +301,14 @@ bool ChromePasswordManagerClient::PromptUserToChooseCredentials( |
| base::Bind(&ChromePasswordManagerClient::OnCredentialsChosen, |
| base::Unretained(this), callback, local_forms.size() == 1); |
| #if defined(OS_ANDROID) |
| + |
| +// Do not show popup dialogs while in VR |
| +#if BUILDFLAG(ENABLE_VR) |
| + if (vr_shell::VrTabHelper::IsInVr(web_contents())) { |
| + return false; |
| + } |
| +#endif // BUILDFLAG(ENABLE_VR) |
| + |
| // Deletes itself on the event from Java counterpart, when user interacts with |
| // dialog. |
| AccountChooserDialogAndroid* acccount_chooser_dialog = |
| @@ -303,10 +316,10 @@ bool ChromePasswordManagerClient::PromptUserToChooseCredentials( |
| origin, intercept); |
| acccount_chooser_dialog->ShowDialog(); |
| return true; |
| -#else |
| +#else // defined(OS_ANDROID) |
| return PasswordsClientUIDelegateFromWebContents(web_contents()) |
| ->OnChooseCredentials(std::move(local_forms), origin, intercept); |
| -#endif |
| +#endif // defined(OS_ANDROID) |
| } |
| void ChromePasswordManagerClient::OnCredentialsChosen( |
| @@ -608,14 +621,22 @@ void ChromePasswordManagerClient::PromptUserToEnableAutosigninIfNecessary() { |
| return; |
| #if defined(OS_ANDROID) |
| + |
| +// Do not show popup dialogs while in VR |
| +#if BUILDFLAG(ENABLE_VR) |
| + if (vr_shell::VrTabHelper::IsInVr(web_contents())) { |
| + return; |
| + } |
| +#endif // BUILDFLAG(ENABLE_VR) |
| + |
| // Dialog is deleted by the Java counterpart after user interacts with it. |
| AutoSigninFirstRunDialogAndroid* auto_signin_first_run_dialog = |
| new AutoSigninFirstRunDialogAndroid(web_contents()); |
| auto_signin_first_run_dialog->ShowDialog(); |
| -#else |
| +#else // defined(OS_ANDROID) |
| PasswordsClientUIDelegateFromWebContents(web_contents()) |
| ->OnPromptEnableAutoSignin(); |
| -#endif |
| +#endif // defined(OS_ANDROID) |
| } |
| void ChromePasswordManagerClient::GenerationAvailableForForm( |