electron_autofill_driver.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (c) 2019 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_H_
  5. #define SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_H_
  6. #include <memory>
  7. #include <vector>
  8. #if defined(TOOLKIT_VIEWS)
  9. #include "shell/browser/ui/autofill_popup.h"
  10. #endif
  11. #include "mojo/public/cpp/bindings/associated_binding.h"
  12. #include "shell/common/api/api.mojom.h"
  13. namespace electron {
  14. class AutofillDriver : public mojom::ElectronAutofillDriver {
  15. public:
  16. AutofillDriver(content::RenderFrameHost* render_frame_host,
  17. mojom::ElectronAutofillDriverAssociatedRequest request);
  18. ~AutofillDriver() override;
  19. void ShowAutofillPopup(const gfx::RectF& bounds,
  20. const std::vector<base::string16>& values,
  21. const std::vector<base::string16>& labels) override;
  22. void HideAutofillPopup() override;
  23. private:
  24. content::RenderFrameHost* const render_frame_host_;
  25. #if defined(TOOLKIT_VIEWS)
  26. std::unique_ptr<AutofillPopup> autofill_popup_;
  27. #endif
  28. mojo::AssociatedBinding<mojom::ElectronAutofillDriver> binding_;
  29. };
  30. } // namespace electron
  31. #endif // SHELL_BROWSER_ELECTRON_AUTOFILL_DRIVER_H_