Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1898)

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 2958533003: Disable Credential management API dialog in VR mode (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698