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

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

Issue 2722293004: Hide password saving UI for automated tests. (Closed)
Patch Set: add a unit test Created 3 years, 10 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 | chrome/browser/password_manager/chrome_password_manager_client_unittest.cc » ('j') | 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 02ea0fae013b909b3507b17a9bc2e8fd4877b433..d357d934e11ffdf1094e4a2b714843ba2bfd208f 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -208,10 +208,20 @@ bool ChromePasswordManagerClient::IsPasswordManagementEnabledForCurrentPage()
bool ChromePasswordManagerClient::IsSavingAndFillingEnabledForCurrentPage()
const {
- // TODO(melandory): remove saving_and_filling_passwords_enabled_ check from
- // here once we decide to switch to new settings behavior for everyone.
- return *saving_and_filling_passwords_enabled_ && !IsOffTheRecord() &&
- IsFillingEnabledForCurrentPage();
samuong 2017/03/03 00:03:05 I didn't want to add the HasSwitch check to this v
vabr (Chromium) 2017/03/04 20:00:20 Adding the test for kEnableAutomation as a separat
samuong 2017/03/06 18:32:01 Done.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableAutomation)) {
+ // Disable the password saving UI for automated tests. It obscures the
+ // page, and there is no API to access (or dismiss) UI bubbles/infobars.
+ return false;
+ }
+ if (!*saving_and_filling_passwords_enabled_) {
+ // TODO(melandory): remove saving_and_filling_passwords_enabled_ check from
+ // here once we decide to switch to new settings behavior for everyone.
+ return false;
+ }
+ if (IsOffTheRecord())
+ return false;
+ return IsFillingEnabledForCurrentPage();
}
bool ChromePasswordManagerClient::IsFillingEnabledForCurrentPage() const {
« no previous file with comments | « no previous file | chrome/browser/password_manager/chrome_password_manager_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698