2020-08-27 14:31:51 +00:00
|
|
|
// Copyright (c) 2019 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_H_
|
2020-08-27 14:31:51 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#if defined(TOOLKIT_VIEWS)
|
|
|
|
#include "shell/browser/ui/autofill_popup.h"
|
|
|
|
#endif
|
|
|
|
|
2023-05-11 20:07:39 +00:00
|
|
|
#include "base/memory/raw_ptr.h"
|
2021-03-04 17:27:05 +00:00
|
|
|
#include "mojo/public/cpp/bindings/associated_receiver.h"
|
|
|
|
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
|
2020-08-27 14:31:51 +00:00
|
|
|
#include "shell/common/api/api.mojom.h"
|
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
|
|
|
class AutofillDriver : public mojom::ElectronAutofillDriver {
|
|
|
|
public:
|
2021-11-03 17:17:06 +00:00
|
|
|
explicit AutofillDriver(content::RenderFrameHost* render_frame_host);
|
|
|
|
AutofillDriver(const AutofillDriver&) = delete;
|
|
|
|
AutofillDriver& operator=(const AutofillDriver&) = delete;
|
2020-08-27 14:31:51 +00:00
|
|
|
~AutofillDriver() override;
|
|
|
|
|
2021-11-03 17:17:06 +00:00
|
|
|
void BindPendingReceiver(
|
|
|
|
mojo::PendingAssociatedReceiver<mojom::ElectronAutofillDriver>
|
|
|
|
pending_receiver);
|
|
|
|
|
2020-08-27 14:31:51 +00:00
|
|
|
void ShowAutofillPopup(const gfx::RectF& bounds,
|
2021-03-16 16:18:45 +00:00
|
|
|
const std::vector<std::u16string>& values,
|
|
|
|
const std::vector<std::u16string>& labels) override;
|
2020-08-27 14:31:51 +00:00
|
|
|
void HideAutofillPopup() override;
|
|
|
|
|
|
|
|
private:
|
2023-05-11 20:07:39 +00:00
|
|
|
raw_ptr<content::RenderFrameHost> const render_frame_host_;
|
2020-08-27 14:31:51 +00:00
|
|
|
|
|
|
|
#if defined(TOOLKIT_VIEWS)
|
|
|
|
std::unique_ptr<AutofillPopup> autofill_popup_;
|
|
|
|
#endif
|
|
|
|
|
2021-11-03 17:17:06 +00:00
|
|
|
mojo::AssociatedReceiver<mojom::ElectronAutofillDriver> receiver_{this};
|
2020-08-27 14:31:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_H_
|