Fixed certificate popup style
authorJongHeon Choi <j-h.choi@samsung.com>
Thu, 26 May 2016 08:12:15 +0000 (17:12 +0900)
committerJongHeon Choi <j-h.choi@samsung.com>
Thu, 26 May 2016 08:12:24 +0000 (17:12 +0900)
runtime/browser/popup.cc
runtime/browser/popup.h
runtime/browser/web_application.cc

index ed686c1..aaeacac 100644 (file)
@@ -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<void
     (Popup* popup, void* user_data)> handler, void* user_data) {
   handler_ = handler;
index c1af8dd..0dcb0d5 100644 (file)
@@ -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
       <void(Popup* popup, void* user_data)> handler, void* user_data);
 
index 9f836ea..fdce5d2 100644 (file)
@@ -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<void(bool allow)> 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*/) {