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

Unified Diff: third_party/WebKit/Source/web/WebFormElementObserverImpl.h

Issue 2865233003: Use an MutationObserver to check when a password form disappears after XHR (Closed)
Patch Set: updates Created 3 years, 7 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
Index: third_party/WebKit/Source/web/WebFormElementObserverImpl.h
diff --git a/third_party/WebKit/Source/web/WebFormElementObserverImpl.h b/third_party/WebKit/Source/web/WebFormElementObserverImpl.h
new file mode 100644
index 0000000000000000000000000000000000000000..e6a734bdefb922b4b4d50815bc6b91aad420ce7e
--- /dev/null
+++ b/third_party/WebKit/Source/web/WebFormElementObserverImpl.h
@@ -0,0 +1,46 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WebFormElementObserverImpl_h
+#define WebFormElementObserverImpl_h
+
+#include "platform/heap/HeapAllocator.h"
+#include "platform/heap/Member.h"
+#include "platform/heap/SelfKeepAlive.h"
+#include "platform/wtf/Compiler.h"
+#include "public/web/modules/password_manager/WebFormElementObserver.h"
+#include "web/WebExport.h"
+
+namespace blink {
+
+class HTMLElement;
+class WebFormElementObserverCallback;
+
+class WEB_EXPORT WebFormElementObserverImpl final
+ : public GarbageCollectedFinalized<WebFormElementObserverImpl>,
+ NON_EXPORTED_BASE(public WebFormElementObserver) {
+ WTF_MAKE_NONCOPYABLE(WebFormElementObserverImpl);
+
+ public:
+ WebFormElementObserverImpl(HTMLElement&,
+ std::unique_ptr<WebFormElementObserverCallback>);
+ ~WebFormElementObserverImpl() override;
+
+ // WebFormElementObserver implementation.
+ void Disconnect() override;
+
+ DECLARE_VIRTUAL_TRACE();
+
+ private:
+ class ObserverCallback;
+
+ Member<ObserverCallback> mutation_callback_;
+
+ // WebFormElementObserverImpl must remain alive until Disconnect() is called.
+ SelfKeepAlive<WebFormElementObserverImpl> self_keep_alive_;
+};
+
+} // namespace blink
+
+#endif // WebFormElementObserverImpl_h

Powered by Google App Engine
This is Rietveld 408576698