1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_MODULES_AUTOFILL_WEB_FORM_ELEMENT_OBSERVER_H_
6 #define THIRD_PARTY_BLINK_PUBLIC_WEB_MODULES_AUTOFILL_WEB_FORM_ELEMENT_OBSERVER_H_
7 
8 #include <memory>
9 
10 #include "base/callback.h"
11 #include "third_party/blink/public/platform/web_common.h"
12 
13 namespace blink {
14 
15 class WebFormControlElement;
16 class WebFormElement;
17 
18 // TODO(tonikitoo): This uses BLINK_EXPORT instead of BLINK_MODULES_EXPORT
19 // because it is implemented by renderer/core/autofill code, where
20 // BLINK_MODULES_IMPLEMENTATION is not defined and compilation fails on win-dbg.
21 //
22 class BLINK_EXPORT WebFormElementObserver {
23  public:
24   // Creates a WebFormElementObserver. Delete this WebFormElementObsrver by
25   // calling WebFormElementObserver::Disconnect.
26   static WebFormElementObserver* Create(WebFormElement&, base::OnceClosure);
27   static WebFormElementObserver* Create(WebFormControlElement&,
28                                         base::OnceClosure);
29 
30   virtual void Disconnect() = 0;
31 
32  protected:
33   WebFormElementObserver() = default;
34   virtual ~WebFormElementObserver() = default;
35 };
36 
37 }  // namespace blink
38 
39 #endif  // THIRD_PARTY_BLINK_PUBLIC_WEB_MODULES_AUTOFILL_WEB_FORM_ELEMENT_OBSERVER_H_
40