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

Unified Diff: components/password_manager/core/browser/password_autofill_manager.cc

Issue 2478043002: HTTP Bad: Add warning message to autofill dropdown for http sites (Closed)
Patch Set: add test to AutofillManagerTest Created 4 years, 1 month 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
Index: components/password_manager/core/browser/password_autofill_manager.cc
diff --git a/components/password_manager/core/browser/password_autofill_manager.cc b/components/password_manager/core/browser/password_autofill_manager.cc
index 274041742dcbc989d14f22c752af2d70a5b39495..24a35b8020a4df34fa65ad62fc196f02936c20e5 100644
--- a/components/password_manager/core/browser/password_autofill_manager.cc
+++ b/components/password_manager/core/browser/password_autofill_manager.cc
@@ -9,6 +9,7 @@
#include <algorithm>
#include <vector>
+#include "base/command_line.h"
#include "base/i18n/case_conversion.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
@@ -24,6 +25,7 @@
#include "components/password_manager/core/browser/affiliation_utils.h"
#include "components/password_manager/core/browser/password_manager_driver.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
+#include "components/security_state/switches.h"
#include "components/strings/grit/components_strings.h"
#include "grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -205,6 +207,19 @@ void PasswordAutofillManager::OnShowPasswordSuggestions(
password_field_suggestions.frontend_id = autofill::POPUP_ITEM_ID_TITLE;
suggestions.insert(suggestions.begin(), password_field_suggestions);
}
+
+ std::string choice =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ security_state::switches::kMarkHttpAs);
+ if (!autofill_client_->IsTopLevelURLSecure() &&
+ choice == security_state::switches::kMarkHttpWithPasswordsOrCcWithChip) {
estark 2016/11/07 06:06:57 Same here
lshang 2016/11/07 06:12:12 Done.
+ autofill::Suggestion password_field_http_warning_suggestion(
+ l10n_util::GetStringUTF16(IDS_AUTOFILL_PASSWORD_HTTP_WARNING_MESSAGE));
+ password_field_http_warning_suggestion.frontend_id =
+ autofill::POPUP_ITEM_ID_WARNING_MESSAGE;
+ suggestions.insert(suggestions.begin(),
+ password_field_http_warning_suggestion);
+ }
autofill_client_->ShowAutofillPopup(bounds,
text_direction,
suggestions,

Powered by Google App Engine
This is Rietveld 408576698