Chromium Code Reviews| Index: components/autofill/core/browser/autofill_handler_proxy.h |
| diff --git a/components/autofill/core/browser/autofill_handler_proxy.h b/components/autofill/core/browser/autofill_handler_proxy.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6ade241af9d38069403bdfe285c5cdf78982797d |
| --- /dev/null |
| +++ b/components/autofill/core/browser/autofill_handler_proxy.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright 2013 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 COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_HANDLER_PROXY_H_ |
| +#define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_HANDLER_PROXY_H_ |
| + |
| +#include "base/memory/weak_ptr.h" |
| +#include "components/autofill/core/browser/autofill_handler.h" |
| + |
| +namespace autofill { |
| + |
| +class AutofillProvider; |
| + |
| +// This class forwards AutofillHandler calls to AutofillProvider. |
| +class AutofillHandlerProxy : public AutofillHandler { |
|
sebsg
2017/05/24 13:32:42
This could be moved to an android location with th
Roger McFarlane (Chromium)
2017/05/24 20:03:31
Why have AutofillHandlerProxy be a wrapper for Aut
michaelbai
2017/05/24 20:43:23
It because that a WebContents has one AutofillProv
michaelbai
2017/05/26 23:12:08
As we discussed, we will not use ifdef.
|
| + public: |
| + AutofillHandlerProxy(AutofillDriver* driver, AutofillProvider* provider); |
| + ~AutofillHandlerProxy() override; |
| + |
| + void OnFocusNoLongerOnForm() override; |
| + |
| + void OnDidFillAutofillFormData(const FormData& form, |
| + const base::TimeTicks& timestamp) override; |
| + |
| + void OnDidPreviewAutofillFormData() override; |
| + |
| + void OnFormsSeen(const std::vector<FormData>& forms, |
| + const base::TimeTicks& timestamp) override; |
| + |
| + bool OnFormSubmitted(const FormData& form) override; |
| + |
| + void OnDidEndTextFieldEditing() override; |
| + void OnHidePopup() override; |
| + void OnSetDataList(const std::vector<base::string16>& values, |
| + const std::vector<base::string16>& labels) override; |
| + |
| + void Reset() override; |
| + |
| + base::WeakPtr<AutofillHandlerProxy> GetWeakPtr() { |
| + return weak_ptr_factory_.GetWeakPtr(); |
| + } |
| + |
| + protected: |
| + bool OnWillSubmitFormImpl(const FormData& form, |
| + const base::TimeTicks& timestamp) override; |
| + |
| + void OnTextFieldDidChangeImpl(const FormData& form, |
| + const FormFieldData& field, |
| + const base::TimeTicks& timestamp) override; |
| + |
| + void OnQueryFormFieldAutofillImpl(int query_id, |
| + const FormData& form, |
| + const FormFieldData& field, |
| + const gfx::RectF& bounding_box) override; |
| + |
| + private: |
| + AutofillProvider* provider_; |
| + base::WeakPtrFactory<AutofillHandlerProxy> weak_ptr_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AutofillHandlerProxy); |
| +}; |
| + |
| +} // namespace autofill |
| + |
| +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_HANDLER_PROXY_H_ |