namespace autofill {
+// static
+AutofillClientEfl* AutofillClientEfl::FromWebContents(
+ content::WebContents* web_contents) {
+ return static_cast<AutofillClientEfl*>(
+ ContentAutofillClient::FromWebContents(web_contents));
+}
+
+// static
+void AutofillClientEfl::CreateForWebContents(content::WebContents* contents) {
+ DCHECK(contents);
+ if (!FromWebContents(contents)) {
+ contents->SetUserData(UserDataKey(),
+ base::WrapUnique(new AutofillClientEfl(contents)));
+ }
+}
+
AutofillClientEfl::AutofillClientEfl(content::WebContents* web_contents)
- : content::WebContentsObserver(web_contents),
- content::WebContentsUserData<AutofillClientEfl>(*web_contents),
+ : ContentAutofillClient(web_contents,
+ base::BindRepeating(&BrowserDriverInitHook,
+ this,
+ EWebView::GetPlatformLocale())),
+ content::WebContentsObserver(web_contents),
web_contents_(web_contents) {
DCHECK(web_contents);
}
}
bool AutofillClientEfl::IsOffTheRecord() {
- NOTIMPLEMENTED();
- return false;
+ return web_contents_->GetBrowserContext()->IsOffTheRecord();
}
scoped_refptr<network::SharedURLLoaderFactory>
AutofillClientEfl::GetURLLoaderFactory() {
- NOTIMPLEMENTED();
- return scoped_refptr<network::SharedURLLoaderFactory>();
+ return web_contents_->GetBrowserContext()
+ ->GetDefaultStoragePartition()
+ ->GetURLLoaderFactoryForBrowserProcess();
}
void AutofillClientEfl::ConfirmSaveIBANLocally(
FormInteractionsFlowId AutofillClientEfl::GetCurrentFormInteractionsFlowId() {
NOTIMPLEMENTED();
+ return {};
}
void AutofillClientEfl::UpdateAutofillIfRequired() {
NOTIMPLEMENTED();
}
-WEB_CONTENTS_USER_DATA_KEY_IMPL(AutofillClientEfl);
} // namespace autofill
#endif // TIZEN_AUTOFILL
#include "base/i18n/rtl.h"
#include "base/memory/weak_ptr.h"
#include "browser/autofill_popup_view_efl.h"
-#include "components/autofill/core/browser/autofill_client.h"
+#include "components/autofill/content/browser/content_autofill_client.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/password_manager/core/browser/password_form_manager.h"
#include "content/public/browser/web_contents_observer.h"
namespace autofill {
-class AutofillClientEfl
- : public AutofillClient,
- public content::WebContentsUserData<AutofillClientEfl>,
- public content::WebContentsObserver {
+class AutofillClientEfl : public ContentAutofillClient,
+ public content::WebContentsObserver {
public:
~AutofillClientEfl() override;
AutofillClientEfl(const AutofillClientEfl&) = delete;
AutofillClientEfl& operator=(const AutofillClientEfl&) = delete;
+ static AutofillClientEfl* FromWebContents(content::WebContents*);
+ static void CreateForWebContents(content::WebContents*);
+
bool IsOffTheRecord() override;
scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactory() override;
void DidFillOrPreviewForm(mojom::RendererFormDataAction action,
private:
explicit AutofillClientEfl(content::WebContents* web_contents);
- friend class content::WebContentsUserData<AutofillClientEfl>;
AutofillPopupViewEfl* GetOrCreatePopupController();
gfx::RectF GetElementBoundsInScreen(const gfx::RectF& element_bounds);
content::WebContents* const web_contents_;
EWebView* webview_ = nullptr;
AutofillPopupViewEfl* popup_controller_ = nullptr;
-
- WEB_CONTENTS_USER_DATA_KEY_DECL();
};
} // namespace autofill
#if defined(TIZEN_AUTOFILL)
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
autofill::switches::kDisableAutofill)) {
-#if !defined(EWK_BRINGUP) // FIXME: m114 bringup
AutofillClientEfl::CreateForWebContents(&web_contents_);
AutofillClientEfl* autofill_client =
AutofillClientEfl::FromWebContents(&web_contents_);
autofill_client->SetEWebView(view);
PasswordManagerClientEfl::CreateForWebContentsWithAutofillClient(
&web_contents_, autofill_client);
- ContentAutofillDriverFactory::CreateForWebContentsAndDelegate(
- &web_contents_, autofill_client,
- base::BindRepeating(&autofill::BrowserDriverInitHook, autofill_client,
- EWebView::GetPlatformLocale()));
-#endif
}
#if defined(TIZEN_AUTOFILL_FW)
LOG(INFO) << "[Autofill] " << __FUNCTION__ << " Create AutofillRequest";