In current implementation, we just call signal of authentication.
But we need to offer default popup about authentication.
If application developer wants to customize authentication,
use "ewk_view_authentication_callback_set".
Reference: https://review.tizen.org/gerrit/245896
Change-Id: Ie637aaf65a49c24a126167fed4fc98a74fff7acd
Signed-off-by: Surya Kumar <surya.kumar7@samsung.com>
}
sources += [
+ "authentication_challenge_popup.cc",
+ "authentication_challenge_popup.h",
"autofill_popup_view_efl.cc",
"autofill_popup_view_efl.h",
"browser/background_sync_controller_efl.cc",
--- /dev/null
+// Copyright 2021 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ewk/efl_integration/authentication_challenge_popup.h"
+
+#if defined(OS_TIZEN)
+#include <efl_extension.h>
+#endif
+
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+#include "base/strings/utf_string_conversions.h"
+#include "content/common/paths_efl.h"
+#include "ewk/efl_integration/eweb_view.h"
+#include "public/ewk_view.h"
+
+// Color of text_box border
+static const int kBorderColorRed = 10;
+static const int kBorderColorGreen = 10;
+static const int kBorderColorBlue = 10;
+
+// Length of text_box border
+static const int kBorderWidth = 200;
+static const int kBorderHeight = 30;
+static const int kBorderThickness = 3;
+
+AuthenticationChallengePopup::AuthenticationChallengePopup(
+ Ewk_Auth_Challenge* auth_challenge,
+ Evas_Object* ewk_view)
+ : conformant_(nullptr),
+ ewk_view_(ewk_view),
+ login_button_(nullptr),
+ layout_(nullptr),
+ password_entry_(nullptr),
+ popup_(nullptr),
+ user_name_entry_(nullptr),
+ auth_challenge_(auth_challenge) {}
+
+AuthenticationChallengePopup::~AuthenticationChallengePopup() {
+ if (login_button_)
+ evas_object_smart_callback_del(login_button_, "clicked",
+ AuthenticationLoginCallback);
+#if defined(OS_TIZEN)
+ if (popup_) {
+ eext_object_event_callback_del(popup_, EEXT_CALLBACK_BACK,
+ HwBackKeyCallback);
+ }
+#endif
+ if (conformant_) {
+ evas_object_del(conformant_);
+ conformant_ = nullptr;
+ }
+}
+
+void AuthenticationChallengePopup::AuthenticationLoginCallback(
+ void* data,
+ Evas_Object* obj,
+ void* event_info) {
+ auto auth_challenge_popup = static_cast<AuthenticationChallengePopup*>(data);
+ if (!auth_challenge_popup) {
+ LOG(ERROR) << "Showing authentication popup failed";
+ return;
+ }
+
+ const char* username =
+ elm_entry_entry_get(auth_challenge_popup->user_name_entry_);
+ const char* password =
+ elm_entry_entry_get(auth_challenge_popup->password_entry_);
+ ewk_auth_challenge_credential_use(auth_challenge_popup->auth_challenge_,
+ username, password);
+ delete auth_challenge_popup;
+}
+
+#if defined(OS_TIZEN)
+void AuthenticationChallengePopup::HwBackKeyCallback(void* data,
+ Evas_Object* obj,
+ void* event_info) {
+ auto* auth_challenge_popup = static_cast<AuthenticationChallengePopup*>(data);
+ if (!auth_challenge_popup) {
+ LOG(ERROR) << "Showing authentication popup failed";
+ return;
+ }
+ ewk_auth_challenge_credential_cancel(auth_challenge_popup->auth_challenge_);
+ delete auth_challenge_popup;
+}
+#endif
+
+Evas_Object* AuthenticationChallengePopup::CreateBorder(
+ const std::string& text,
+ Evas_Object* entry_box) {
+ Evas_Object* border = elm_bg_add(popup_);
+ if (!border)
+ return nullptr;
+
+ elm_bg_color_set(border, kBorderColorRed, kBorderColorGreen,
+ kBorderColorBlue);
+ if (!text.compare("border_up") || !text.compare("border_down"))
+ evas_object_size_hint_min_set(border, kBorderWidth, kBorderThickness);
+ else
+ evas_object_size_hint_min_set(border, kBorderThickness, kBorderHeight);
+
+ evas_object_show(border);
+ elm_object_part_content_set(entry_box, text.c_str(), border);
+
+ return border;
+}
+
+Evas_Object* AuthenticationChallengePopup::CreateTextBox(
+ const char* edj_path,
+ Evas_Object* container_box) {
+ Evas_Object* entry_box = elm_layout_add(popup_);
+ if (!entry_box)
+ return nullptr;
+ elm_layout_file_set(entry_box, edj_path, "authentication_challenge");
+
+ Evas_Object* text_box = elm_entry_add(entry_box);
+ if (!text_box)
+ return nullptr;
+ elm_entry_single_line_set(text_box, EINA_TRUE);
+ elm_object_focus_set(text_box, EINA_TRUE);
+ elm_entry_scrollable_set(text_box, true);
+ evas_object_show(text_box);
+
+ elm_object_part_content_set(entry_box, "elm.swallow.entry", text_box);
+
+ CreateBorder("border_up", entry_box);
+ CreateBorder("border_down", entry_box);
+ CreateBorder("border_left", entry_box);
+ CreateBorder("border_right", entry_box);
+
+ elm_box_pack_end(container_box, entry_box);
+ evas_object_show(entry_box);
+
+ return text_box;
+}
+
+bool AuthenticationChallengePopup::CreateTextLabel(const char* text,
+ Evas_Object* container_box) {
+ Evas_Object* text_label = elm_label_add(popup_);
+ if (!text_label)
+ return false;
+ elm_object_text_set(text_label, text);
+ elm_box_pack_end(container_box, text_label);
+ evas_object_show(text_label);
+ return true;
+}
+
+Evas_Object* AuthenticationChallengePopup::CreateContainerBox() {
+ Evas_Object* box = elm_box_add(popup_);
+ if (!box)
+ return nullptr;
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(box);
+
+ if (!CreateTextLabel(dgettext("WebKit", "IDS_WEBVIEW_BODY_USERNAME"), box))
+ return nullptr;
+ base::FilePath edj_dir, authentication_edj;
+ base::PathService::Get(PathsEfl::EDJE_RESOURCE_DIR, &edj_dir);
+ authentication_edj =
+ edj_dir.Append(FILE_PATH_LITERAL("AuthenticationPopup.edj"));
+
+ user_name_entry_ =
+ CreateTextBox(authentication_edj.AsUTF8Unsafe().c_str(), box);
+ if (!user_name_entry_)
+ return nullptr;
+
+ if (!CreateTextLabel(dgettext("WebKit", "IDS_WEBVIEW_BODY_PASSWORD"), box))
+ return nullptr;
+
+ password_entry_ =
+ CreateTextBox(authentication_edj.AsUTF8Unsafe().c_str(), box);
+ if (!password_entry_)
+ return nullptr;
+ elm_entry_password_set(password_entry_, EINA_TRUE);
+ elm_entry_input_panel_layout_set(password_entry_,
+ ELM_INPUT_PANEL_LAYOUT_PASSWORD);
+
+ return box;
+}
+
+bool AuthenticationChallengePopup::ShowAuthenticationPopup(const char* url) {
+ Evas_Object* parent =
+ elm_object_top_widget_get(elm_object_parent_widget_get(ewk_view_));
+ if (!parent)
+ parent = ewk_view_;
+
+ conformant_ = elm_conformant_add(parent);
+ if (!conformant_)
+ return false;
+
+ evas_object_size_hint_weight_set(conformant_, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(parent, conformant_);
+
+ layout_ = elm_layout_add(conformant_);
+ if (!layout_)
+ return false;
+ elm_layout_theme_set(layout_, "layout", "application", "default");
+ evas_object_size_hint_weight_set(layout_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_content_set(conformant_, layout_);
+ evas_object_show(layout_);
+
+ popup_ = elm_popup_add(layout_);
+ if (!popup_)
+ return false;
+ elm_object_part_text_set(popup_, "title,text", url);
+
+ Evas_Object* box = CreateContainerBox();
+ if (!box)
+ return false;
+ elm_object_content_set(popup_, box);
+ login_button_ = elm_button_add(popup_);
+ if (!login_button_)
+ return false;
+ elm_object_style_set(login_button_, "popup");
+ evas_object_size_hint_weight_set(login_button_, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(login_button_, EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
+ elm_object_text_set(login_button_, dgettext("WebKit", "IDS_BR_BODY_LOG_IN"));
+ elm_box_pack_end(box, login_button_);
+ elm_object_part_content_set(popup_, "button1", login_button_);
+ evas_object_show(login_button_);
+
+ evas_object_smart_callback_add(login_button_, "clicked",
+ AuthenticationLoginCallback, this);
+#if defined(OS_TIZEN)
+ eext_object_event_callback_add(popup_, EEXT_CALLBACK_BACK, HwBackKeyCallback,
+ this);
+#endif
+ evas_object_show(popup_);
+
+ return true;
+}
+
+void AuthenticationChallengePopup::CreateAndShow(
+ Ewk_Auth_Challenge* auth_challenge,
+ Evas_Object* ewk_view) {
+ if (!auth_challenge)
+ return;
+ auto popup = new AuthenticationChallengePopup(auth_challenge, ewk_view);
+
+ const char* url = ewk_auth_challenge_url_get(auth_challenge);
+
+ ewk_auth_challenge_suspend(auth_challenge);
+ if (!popup->ShowAuthenticationPopup(url)) {
+ LOG(ERROR) << "Showing authentication popup is failed";
+ ewk_auth_challenge_credential_cancel(auth_challenge);
+ delete popup;
+ }
+}
--- /dev/null
+// Copyright 2021 Samsung Electronics. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EWK_EFL_INTEGRATION_AUTHENTICATION_CHALLENGE_POPUP_H_
+#define EWK_EFL_INTEGRATION_AUTHENTICATION_CHALLENGE_POPUP_H_
+
+#include <Elementary.h>
+#include <string>
+
+#include "public/ewk_auth_challenge_internal.h"
+
+class AuthenticationChallengePopup {
+ public:
+ ~AuthenticationChallengePopup();
+
+ static void CreateAndShow(Ewk_Auth_Challenge* auth_challenge,
+ Evas_Object* ewk_view);
+
+ private:
+ explicit AuthenticationChallengePopup(Ewk_Auth_Challenge* auth_challenge,
+ Evas_Object* ewk_view);
+
+ bool ShowAuthenticationPopup(const char* url);
+ static void AuthenticationLoginCallback(void* data,
+ Evas_Object* obj,
+ void* event_info);
+#if defined(OS_TIZEN)
+ static void HwBackKeyCallback(void* data, Evas_Object* obj, void* event_info);
+#endif
+ Evas_Object* CreateBorder(const std::string& text, Evas_Object* entry_box);
+ Evas_Object* CreateContainerBox();
+ Evas_Object* CreateTextBox(const char* edj_path, Evas_Object* container_box);
+ bool CreateTextLabel(const char* edj_path, Evas_Object* container_box);
+
+ Evas_Object* conformant_;
+ Evas_Object* ewk_view_;
+ Evas_Object* login_button_;
+ Evas_Object* layout_;
+ Evas_Object* password_entry_;
+ Evas_Object* popup_;
+ Evas_Object* user_name_entry_;
+ Ewk_Auth_Challenge* auth_challenge_;
+};
+
+#endif // EWK_EFL_INTEGRATION_AUTHENTICATION_CHALLENGE_POPUP_H_
\ No newline at end of file
web_contents_->WasHidden();
}
+void EWebView::SetViewAuthCallback(Ewk_View_Authentication_Callback callback,
+ void* user_data) {
+ authentication_cb_.Set(callback, user_data);
+}
+
void EWebView::InvokeAuthCallback(LoginDelegateEfl* login_delegate,
const GURL& url,
const std::string& realm) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
auth_challenge_.reset(new _Ewk_Auth_Challenge(login_delegate, url, realm));
- SmartCallback<EWebViewCallbacks::AuthChallenge>().call(auth_challenge_.get());
+ authentication_cb_.Run(evas_object_, auth_challenge_.get());
if (!auth_challenge_->is_decided && !auth_challenge_->is_suspended) {
auth_challenge_->is_decided = true;
int error_code,
const std::string& error_description,
bool is_main_frame);
+
+ void SetViewAuthCallback(Ewk_View_Authentication_Callback callback,
+ void* user_data);
void InvokeAuthCallback(LoginDelegateEfl* login_delegate,
const GURL& url,
const std::string& realm);
WebViewCallback<Ewk_Quota_Permission_Request_Callback,
const _Ewk_Quota_Permission_Request*>
quota_request_callback_;
+ WebViewCallback<Ewk_View_Authentication_Callback, _Ewk_Auth_Challenge*>
+ authentication_cb_;
std::unique_ptr<content::InputPicker> inputPicker_;
base::IDMap<WebApplicationIconUrlGetCallback*>
GeoLocationPermissionRequest,
GeoLocationValid,
RequestCertificateConfirm,
- AuthChallenge,
SetCertificatePem,
PolicyResponseDecide,
ContextMenuCustomize,
DECLARE_EWK_VIEW_CALLBACK(GeoLocationPermissionRequest, "geolocation,permission,request", _Ewk_Geolocation_Permission_Request*);
DECLARE_EWK_VIEW_CALLBACK(GeoLocationValid, "geolocation,valid", Eina_Bool*);
DECLARE_EWK_VIEW_CALLBACK(RequestCertificateConfirm, "request,certificate,confirm", _Ewk_Certificate_Policy_Decision*);
-DECLARE_EWK_VIEW_CALLBACK(AuthChallenge, "authentication,challenge", _Ewk_Auth_Challenge*);
DECLARE_EWK_VIEW_CALLBACK(SetCertificatePem, "certificate,pem,set", const char*);
DECLARE_EWK_VIEW_CALLBACK(PolicyResponseDecide, "policy,response,decide", _Ewk_Policy_Decision*);
DECLARE_EWK_VIEW_CALLBACK(ContextMenuCustomize, "contextmenu,customize", _Ewk_Context_Menu*);
#include <Evas.h>
+#include "authentication_challenge_popup.h"
#include "content/public/browser/navigation_controller.h"
#include "cookie_manager.h"
#include "eweb_view.h"
static Eina_Bool _ewk_view_default_notification_permission(
Evas_Object*, Ewk_Notification_Permission_Request*, void*);
+static void _ewk_view_default_authentication(
+ Evas_Object*, Ewk_Auth_Challenge*, void*);
+
Eina_Bool ewk_view_smart_class_set(Ewk_View_Smart_Class* api)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(api, false);
_ewk_view_default_geolocation_permission, 0);
ewk_view_notification_permission_callback_set(ewk_view,
_ewk_view_default_notification_permission, 0);
+ ewk_view_authentication_callback_set(ewk_view,
+ _ewk_view_default_authentication, nullptr);
}
return ewk_view;
LOG_EWK_API_MOCKUP();
}
+void ewk_view_authentication_callback_set(
+ Evas_Object* ewk_view,
+ Ewk_View_Authentication_Callback callback,
+ void* user_data)
+{
+ EWK_VIEW_IMPL_GET_OR_RETURN(ewk_view, impl);
+ impl->SetViewAuthCallback(callback, user_data);
+
+}
+
+static void _ewk_view_default_authentication(Evas_Object* ewk_view,
+ Ewk_Auth_Challenge* auth_challenge,
+ void* user_data)
+{
+ AuthenticationChallengePopup::CreateAndShow(auth_challenge, ewk_view);
+}
+
void ewk_view_app_installation_request_callback_set(Evas_Object* o, Ewk_App_Installation_Request_Callback callback, void* user_data)
{
LOG_EWK_API_MOCKUP();
--- /dev/null
+collections {
+ group {
+ name: "authentication_challenge";
+ parts {
+ part {
+ name: "background";
+ type: RECT;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: 200 30;
+ max: 200 30;
+ visible: 1;
+ }
+ }
+ part {
+ name: "elm.swallow.entry";
+ type: SWALLOW;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ min: 200 30;
+ max: 200 30;
+ color: 0 217 217 255;
+ visible: 1;
+ rel1{
+ relative: 0 0;
+ to: "background";
+ }
+ rel2{
+ relative: 1 1;
+ to: "background";
+ }
+ }
+ }
+ part {
+ name: "border_up";
+ type: SWALLOW;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ align: 0 0;
+ visible: 1;
+ fixed: 1 1;
+ rel1{
+ relative: 0 0;
+ to: "background";
+ }
+ rel2{
+ relative: 1 0;
+ to: "background";
+ }
+ }
+ }
+ part {
+ name: "border_down";
+ type: SWALLOW;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ align: 1 1;
+ visible: 1;
+ fixed: 1 1;
+ rel1{
+ relative: 0 1;
+ to: "background";
+ }
+ rel2{
+ relative: 1 1;
+ to: "background";
+ }
+ }
+ }
+ part {
+ name: "border_left";
+ type: SWALLOW;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ align: 0 0;
+ visible: 1;
+ fixed: 1 1;
+ rel1{
+ relative: 0 0;
+ to: "background";
+ }
+ rel2{
+ relative: 0 1;
+ to: "background";
+ }
+ }
+ }
+ part {
+ name: "border_right";
+ type: SWALLOW;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ align: 0 0;
+ visible: 1;
+ fixed: 1 1;
+ rel1{
+ relative: 1 0;
+ to: "background";
+ }
+ rel2{
+ relative: 1 1;
+ to: "background";
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
edje_res_ewk("edje_resources_ewk") {
sources = [
+ "AuthenticationPopup.edc",
"AutofillPopup.edc",
"JavaScriptPopup.edc",
"control.edc",
static void __did_commit_load_for_frame(void *data, Evas_Object *obj, void *event_info);
static void __geoLocation_popup_display_cb(void *data, Evas_Object *obj, void *event_info);
void __script_executed_cb(Evas_Object *obj, const char *javascript_result, void *data);
-static void __auth_challenge_cb(void* data, Evas_Object *obj, void *event_info);
+static void __auth_challenge_cb(Evas_Object* ewk_view, Ewk_Auth_Challenge* auth_challenge, void* user_data);
static void __policy_response_decide_cb(void *data, Evas_Object *obj, void *event_info);
static void __customize_context_menu_cb(void* data, Evas_Object *obj, void *event_info);
static void __customize_context_menu_item_selected_cb(void* data, Evas_Object *obj, void *event_info);
evas_object_smart_callback_add(view, "load,committed", __did_commit_load_for_frame, 0);
evas_object_smart_callback_add(view, "load,provisional,started", __did_start_provisional_load_for_frame_cb, 0);
evas_object_smart_callback_add(view, "geolocation,permission,request", __geoLocation_popup_display_cb,0);
- evas_object_smart_callback_add(view, "authentication,challenge", __auth_challenge_cb, 0);
evas_object_smart_callback_add(view, "policy,response,decide", __policy_response_decide_cb, 0);
evas_object_smart_callback_add(view, "contextmenu,customize", __customize_context_menu_cb, 0);
evas_object_smart_callback_add(view, "contextmenu,selected", __customize_context_menu_item_selected_cb, 0);
ewk_view_custom_header_add(view, "X-Test-header", "X-Value-1");
ewk_view_notification_permission_callback_set(view, __notification_permission_cb, 0);
+ ewk_view_authentication_callback_set(view, __auth_challenge_cb, NULL);
#if defined(OS_TIZEN)
if (IsMobileProfile() || IsWearableProfile()) {
ewk_policy_decision_use(decision);
}
-void __auth_challenge_cb(void* data, Evas_Object *obj, void *event_info)
+void __auth_challenge_cb(Evas_Object* ewk_view, Ewk_Auth_Challenge* auth_challenge, void* user_data)
{
printf("APP.C callback called __auth_challenge_cb \n");
- Ewk_Auth_Challenge* auth_challenge = (Ewk_Auth_Challenge*)event_info;
auth_challenge_holder = auth_challenge;
- if (!auth_challenge)
+ if (!auth_challenge) {
fprintf(stderr, "auth_challenge NULL\n");
+ return;
+ }
const char* realm = ewk_auth_challenge_realm_get(auth_challenge);
const char* url = ewk_auth_challenge_url_get(auth_challenge);
class utc_blink_ewk_auth_challenge_credential_cancel : public utc_blink_ewk_base {
protected:
- void PostSetUp() {
- evas_object_smart_callback_add(GetEwkWebView(), "authentication,challenge", authentication_challenge, this);
+ void PostSetUp() override
+ {
+ ewk_view_authentication_callback_set(GetEwkWebView(), AuthenticationChallenge, this);
}
- void PreTearDown() {
- evas_object_smart_callback_del(GetEwkWebView(), "authentication,challenge", authentication_challenge);
+ void PreTearDown() override
+ {
+ ewk_view_authentication_callback_set(GetEwkWebView(), nullptr, nullptr);
}
void LoadFinished(Evas_Object* webview)
EventLoopStop(utc_blink_ewk_base::Failure); // will noop if EventLoopStop was alraedy called
}
- static void authentication_challenge(void* data, Evas_Object* webview, void* event_info)
+ static void AuthenticationChallenge(Evas_Object* o, Ewk_Auth_Challenge* auth_challenge, void* data)
{
utc_blink_ewk_auth_challenge_credential_cancel *owner = static_cast<utc_blink_ewk_auth_challenge_credential_cancel*>(data);
utc_message("[authentication_challenge] :: ");
- Ewk_Auth_Challenge* auth_challenge = (Ewk_Auth_Challenge*)event_info;
if (!auth_challenge) {
owner->EventLoopStop(utc_blink_ewk_base::Failure);
return;
class utc_blink_ewk_auth_challenge_credential_use : public utc_blink_ewk_base
{
protected:
- void PostSetUp()
+ void PostSetUp() override
{
- evas_object_smart_callback_add( GetEwkWebView(), "authentication,challenge", authentication_challenge, this);
+ ewk_view_authentication_callback_set(GetEwkWebView(), AuthenticationChallenge, this);
}
- void PreTearDown()
+ void PreTearDown() override
{
evas_object_smart_callback_del( GetEwkWebView(), "authentication,challenge", authentication_challenge);
+ ewk_view_authentication_callback_set(GetEwkWebView(), nullptr, nullptr);
}
void LoadFinished(Evas_Object* webview)
EventLoopStop( utc_blink_ewk_base::Failure ); // will noop if EventLoopStop was alraedy called
}
- static void authentication_challenge(void* data, Evas_Object* webview, void* event_info)
+ static void AuthenticationChallenge(Evas_Object* o, Ewk_Auth_Challenge* auth_challenge, void* data)
{
utc_message("[authentication_challenge] :: ");
utc_blink_ewk_auth_challenge_credential_use *owner = static_cast<utc_blink_ewk_auth_challenge_credential_use*>(data);
- Ewk_Auth_Challenge* auth_challenge = (Ewk_Auth_Challenge*)event_info;
if (!auth_challenge) {
owner->EventLoopStop( utc_blink_ewk_base::Failure ); // will noop if EventLoopStop was alraedy called
utc_fail();
{
protected:
- void PostSetUp()
+ void PostSetUp() override
{
- evas_object_smart_callback_add(GetEwkWebView(), "authentication,challenge", authentication_challenge, this);
+ ewk_view_authentication_callback_set(GetEwkWebView(), AuthenticationChallenge, this);
}
- void PreTearDown()
+ void PreTearDown() override
{
- evas_object_smart_callback_del(GetEwkWebView(), "authentication,challenge", authentication_challenge);
+ ewk_view_authentication_callback_set(GetEwkWebView(), nullptr, nullptr);
}
void LoadFinished(Evas_Object* webview)
EventLoopStop( utc_blink_ewk_base::Failure ); // will noop if EventLoopStop was alraedy called
}
- static void authentication_challenge(void* data, Evas_Object* webview, void* event_info)
+ static void AuthenticationChallenge(Evas_Object* o, Ewk_Auth_Challenge* auth_challenge, void* data)
{
ASSERT_TRUE(data != NULL);
utc_blink_ewk_auth_challenge_realm_get *owner = static_cast<utc_blink_ewk_auth_challenge_realm_get*>(data);
- Ewk_Auth_Challenge* auth_challenge = static_cast<Ewk_Auth_Challenge*>(event_info);
-
- if(auth_challenge)
+ if (auth_challenge)
{
std::string realm = ewk_auth_challenge_realm_get(auth_challenge);
- if( realm == "Widget TestCases EARLY ACCESS" ) {
-
+ if (realm == "Widget TestCases EARLY ACCESS") {
owner->EventLoopStop(utc_blink_ewk_base::Success);
return;
}
{
protected:
- void PostSetUp()
+ void PostSetUp() override
{
- evas_object_smart_callback_add(GetEwkWebView(), "authentication,challenge", authentication_challenge, this);
+ ewk_view_authentication_callback_set(GetEwkWebView(), AuthenticationChallenge, this);
}
- void PreTearDown()
+ void PreTearDown() override
{
- evas_object_smart_callback_del(GetEwkWebView(), "authentication,challenge", authentication_challenge);
+ ewk_view_authentication_callback_set(GetEwkWebView(), nullptr, nullptr);
}
void LoadFinished(Evas_Object* webview)
EventLoopStop( utc_blink_ewk_base::Failure ); // will noop if EventLoopStop was alraedy called
}
- static void authentication_challenge(void* data, Evas_Object* webview, void* event_info)
+ static void AuthenticationChallenge(Evas_Object* o, Ewk_Auth_Challenge* auth_challenge, void* data)
{
ASSERT_TRUE(data != NULL);
Ewk_Auth_Challenge* auth_challenge = static_cast<Ewk_Auth_Challenge*>(event_info);
- if(auth_challenge)
+ if (auth_challenge)
{
ewk_auth_challenge_suspend(auth_challenge);