diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2021-06-14 16:20:26 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-06-19 03:08:06 +0200 |
commit | 19c6b0a22f20a33c8c1fd4bdea29468fa8b4e10e (patch) | |
tree | 03631f39583e2b18b06b373f364f00f3d5ab17de /src/core/web_contents_adapter.cpp | |
parent | e2d3beb65653bb96342a80b436d8935e903fdd70 (diff) |
Support HTML5 <datalist> element
The datalist uses Chromium's autofill component to fetch and filter
predefined options in the list and autocomplete the field with the
selected option. Autofill component is added to build and bound to
WebEngine. All the unnecessary autofill features for datalist are
supposed to be disabled: payment/credit card support, password manager,
save profile data, store suggestions in database etc.
Custom popups for the dropdown are implemented for Widget and Quick.
Scrolling in dropdown is not implemented in this change.
Fixes: QTBUG-54433
Pick-to: 6.4
Change-Id: I155d02d6dbc9d88fbca4bc5f55b76c19d0ba7a9d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 45dfd1017..525ee728d 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -43,6 +43,7 @@ #include "web_contents_adapter.h" +#include "autofill_client_qt.h" #include "devtools_frontend_qt.h" #include "download_manager_delegate_qt.h" #include "favicon_driver_qt.h" @@ -66,6 +67,8 @@ #include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h" #include "base/values.h" #include "chrome/browser/tab_contents/form_interaction_tab_helper.h" +#include "components/autofill/core/browser/autofill_manager.h" +#include "components/autofill/content/browser/content_autofill_driver_factory.h" #include "components/favicon/core/favicon_service.h" #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/renderer_host/text_input_manager.h" @@ -517,6 +520,11 @@ void WebContentsAdapter::initialize(content::SiteInstance *site) FaviconDriverQt::CreateForWebContents( webContents(), FaviconServiceFactoryQt::GetForBrowserContext(context), m_adapterClient); + AutofillClientQt::CreateForWebContents(webContents()); + autofill::ContentAutofillDriverFactory::CreateForWebContentsAndDelegate( + webContents(), AutofillClientQt::FromWebContents(webContents()), + /* app_locale = */ "", autofill::AutofillManager::DISABLE_AUTOFILL_DOWNLOAD_MANAGER); + // Create an instance of WebEngineVisitedLinksManager to catch the first // content::NOTIFICATION_RENDERER_PROCESS_CREATED event. This event will // force to initialize visited links in VisitedLinkSlave. |