From e01457e9987cc2a284be2cd57fc6ef739cbd746b Mon Sep 17 00:00:00 2001 From: JongHeon Choi Date: Thu, 26 May 2016 17:12:15 +0900 Subject: [PATCH] Fixed certificate popup style --- runtime/browser/popup.cc | 14 +++++++++++++- runtime/browser/popup.h | 1 + runtime/browser/web_application.cc | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/runtime/browser/popup.cc b/runtime/browser/popup.cc index ed686c1..aaeacac 100644 --- a/runtime/browser/popup.cc +++ b/runtime/browser/popup.cc @@ -123,7 +123,7 @@ static Evas_Object* AddCheckBox(Evas_Object* parent) { Evas_Object* check = elm_check_add(parent); elm_object_style_set(check, kStyleDefault); elm_object_style_set(check, "multiline"); - evas_object_size_hint_align_set(check, 0.1, 0.0); + evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_check_state_set(check, EINA_TRUE); return check; } @@ -256,6 +256,18 @@ void Popup::SetBody(const std::string& str_id) { evas_object_show(label); } +void Popup::SetUrl(const std::string& url) { + Evas_Object* label = elm_label_add(box_); + elm_object_style_set(label, kStyleLabel); + elm_label_line_wrap_set(label, ELM_WRAP_MIXED); + elm_object_text_set(label, url.c_str()); + evas_object_color_set(label, 0, 0, 0, 255); + evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(box_, label); + evas_object_show(label); +} + void Popup::SetResultHandler(std::function handler, void* user_data) { handler_ = handler; diff --git a/runtime/browser/popup.h b/runtime/browser/popup.h index c1af8dd..0dcb0d5 100644 --- a/runtime/browser/popup.h +++ b/runtime/browser/popup.h @@ -64,6 +64,7 @@ class Popup { // etc. void SetTitle(const std::string& str_id); void SetBody(const std::string& str_id); + void SetUrl(const std::string& url); void SetResultHandler(std::function handler, void* user_data); diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index 9f836ea..fdce5d2 100644 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -951,7 +951,7 @@ void WebApplication::OnAuthenticationRequest( } void WebApplication::OnCertificateAllowRequest( - WebView*, const std::string& /*url*/, const std::string& pem, + WebView*, const std::string& url, const std::string& pem, std::function result_handler) { auto db = common::AppDB::GetInstance(); std::string reminder = @@ -968,6 +968,7 @@ void WebApplication::OnCertificateAllowRequest( popup->SetButtonType(Popup::ButtonType::AllowDenyButton); popup->SetTitle(popup_string::kPopupTitleCert); popup->SetBody(popup_string::kPopupBodyCert); + popup->SetUrl(url); popup->SetCheckBox(popup_string::kPopupCheckRememberPreference); popup->SetResultHandler( [db, result_handler, pem](Popup* popup, void* /*user_data*/) { -- 2.7.4