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

Unified Diff: third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp

Issue 2515373003: Post tasks for sensitive input visibility notifications (Closed)
Patch Set: dcheng, haraken comments round 2 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: third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp b/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp
index 06b7fbc0df3c21bc0ac550e7dad4760e26b3ae2c..ab57a788443e9ea402e0c2e1d87f602729b4a3d3 100644
--- a/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp
@@ -38,8 +38,6 @@
#include "core/html/HTMLInputElement.h"
#include "core/html/forms/FormController.h"
#include "core/layout/LayoutTextControlSingleLine.h"
-#include "public/platform/InterfaceProvider.h"
-#include "public/platform/modules/sensitive_input_visibility/sensitive_input_visibility_service.mojom-blink.h"
#include "wtf/Assertions.h"
#include "wtf/PassRefPtr.h"
@@ -93,43 +91,11 @@ void PasswordInputType::disableSecureTextInput() {
}
void PasswordInputType::onAttachWithLayoutObject() {
- Document& document = element().document();
- DCHECK(document.frame());
- if (document.isSecureContext()) {
- // The browser process only cares about passwords on pages where the
- // top-level URL is not secure. Secure contexts must have a top-level
- // URL that is secure, so there is no need to send notifications for
- // password fields in secure contexts.
- return;
- }
-
- document.incrementPasswordCount();
- if (document.passwordCount() > 1) {
- // Only send a message on the first visible password field; the
- // browser process doesn't care about the presence of additional
- // password fields beyond that.
- return;
- }
- mojom::blink::SensitiveInputVisibilityServicePtr sensitiveInputServicePtr;
- document.frame()->interfaceProvider()->getInterface(
- mojo::GetProxy(&sensitiveInputServicePtr));
- sensitiveInputServicePtr->PasswordFieldVisibleInInsecureContext();
+ element().document().incrementPasswordCount();
}
void PasswordInputType::onDetachWithLayoutObject() {
- Document& document = element().document();
- DCHECK(document.frame());
- if (document.isSecureContext()) {
- return;
- }
- document.decrementPasswordCount();
- if (document.passwordCount() > 0)
- return;
-
- mojom::blink::SensitiveInputVisibilityServicePtr sensitiveInputServicePtr;
- document.frame()->interfaceProvider()->getInterface(
- mojo::GetProxy(&sensitiveInputServicePtr));
- sensitiveInputServicePtr->AllPasswordFieldsInInsecureContextInvisible();
+ element().document().decrementPasswordCount();
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/html/forms/PasswordInputTypeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698