Cleanup code
authorWonYoung Choi <wy80.choi@samsung.com>
Mon, 18 May 2015 06:51:16 +0000 (15:51 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Mon, 18 May 2015 07:41:42 +0000 (16:41 +0900)
Change-Id: Ieb256cc6c1b824cb301f87d815f4b6a14f2bb150

src/bundle/runtime_ipc_client.cc
src/bundle/runtime_ipc_client.h
src/runtime/popup.cc [changed mode: 0644->0755]
src/runtime/web_application.cc
src/runtime/web_view_impl.cc
tests/popup/popup.cc
tests/popup/popup.h
tests/popup/test_popup.cc

index 08995ce..b49a3af 100644 (file)
@@ -110,7 +110,7 @@ void RuntimeIPCClient::HandleMessageFromRuntime(
 
   Eina_Stringshare* msg_refid = ewk_ipc_wrt_message_data_reference_id_get(msg);
 
-  if (msg_refid == NULL || !strcmp(msg_refid,"")) {
+  if (msg_refid == NULL || !strcmp(msg_refid, "")) {
     if (msg_refid) eina_stringshare_del(msg_refid);
     LOGGER(ERROR) << "No reference id of received message.";
     return;
index 91bac59..a098270 100644 (file)
@@ -39,7 +39,8 @@ class RuntimeIPCClient {
   void SendMessage(const std::string& type, const std::string& value);
 
   // Send message to BrowserProcess synchronous with reply
-  std::string SendSyncMessage(const std::string& type, const std::string& value);
+  std::string SendSyncMessage(const std::string& type,
+                              const std::string& value);
 
   // Send message to BrowserProcess asynchronous,
   // reply message will be passed to callback function.
@@ -68,6 +69,6 @@ class RuntimeIPCClient {
   std::map<std::string, AsyncData> callbacks_;
 };
 
-}  // namespace
+}  // namespace wrt
 
-#endif  // WRT_BUNDLE_RUNTIME_IPC_CLIENT_H_
\ No newline at end of file
+#endif  // WRT_BUNDLE_RUNTIME_IPC_CLIENT_H_
old mode 100644 (file)
new mode 100755 (executable)
index e262355..5310283
@@ -14,15 +14,11 @@ namespace wrt {
 
 namespace {
 
-const char* kEdjPath = "/usr/share/edje/wrt/wrt.edj";
-const char* kEdcGroupName = "PopupCommon";
-
 const char* kContentTitle = "title,text";
 const char* kContentButton1 = "button1";
 const char* kContentButton2 = "button2";
 
 const char* kStyleDefault = "default";
-const char* kStylePopup = "popup";
 const char* kStyleLabel = "default";
 const char* kStyleButton = "popup";
 const char* kStyleEditPw = "editfield/password/popup";
@@ -150,7 +146,6 @@ Popup* Popup::CreatePopup(NativeWindow* window) {
 }
 
 void Popup::SetButtonType(ButtonType type) {
-  using namespace popup_string;
   enable_button_ = true;
   switch (type) {
     case ButtonType::OkButton:
index ab6d79c..0678c79 100755 (executable)
@@ -226,7 +226,7 @@ bool WebApplication::Initialize() {
                                              vibration_stop_callback,
                                              NULL);
 
-  auto download_callback = [](const char* downloadUrl, void* data) {
+  auto download_callback = [](const char* downloadUrl, void* /*data*/) {
     SendDownloadRequest(downloadUrl);
   };
   ewk_context_did_start_download_callback_set(ewk_context_,
@@ -474,7 +474,7 @@ void WebApplication::OnClosedWebView(WebView * view) {
 }
 
 void WebApplication::OnReceivedWrtMessage(
-    WebView* view,
+    WebView* /*view*/,
     Ewk_IPC_Wrt_Message_Data* msg) {
 
   Eina_Stringshare* msg_id = ewk_ipc_wrt_message_data_id_get(msg);
@@ -505,7 +505,7 @@ void WebApplication::OnReceivedWrtMessage(
     Ewk_IPC_Wrt_Message_Data* ans = ewk_ipc_wrt_message_data_new();
     ewk_ipc_wrt_message_data_type_set(ans, msg_type);
     ewk_ipc_wrt_message_data_reference_id_set(ans, msg_id);
-    if(ret)
+    if (ret)
       ewk_ipc_wrt_message_data_value_set(ans, "success");
     else
       ewk_ipc_wrt_message_data_value_set(ans, "failed");
@@ -625,7 +625,8 @@ void WebApplication::SetupWebView(WebView* view) {
   // TODO(sngn.lee): set CSP
 }
 
-bool WebApplication::OnDidNavigation(WebView* view, const std::string& url) {
+bool WebApplication::OnDidNavigation(WebView* /*view*/,
+                                     const std::string& /*url*/) {
   // TODO(sngn.lee): scheme handling
   // except(file , http, https, app) pass to appcontrol and return false
   return true;
@@ -658,7 +659,7 @@ void WebApplication::OnNotificationPermissionRequest(
   popup->SetBody(popup_string::kPopupBodyWebNotification);
   popup->SetCheckBox(popup_string::kPopupCheckRememberPreference);
   popup->SetResultHandler(
-    [db, result_handler, url](Popup* popup, void* user_data) {
+    [db, result_handler, url](Popup* popup, void* /*user_data*/) {
       bool result = popup->GetButtonResult();
       bool remember = popup->GetCheckBoxResult();
       if (remember) {
@@ -701,7 +702,7 @@ void WebApplication::OnGeolocationPermissionRequest(
   popup->SetBody(popup_string::kPopupBodyGeoLocation);
   popup->SetCheckBox(popup_string::kPopupCheckRememberPreference);
   popup->SetResultHandler(
-    [db, result_handler, url](Popup* popup, void* user_data) {
+    [db, result_handler, url](Popup* popup, void* /*user_data*/) {
       bool result = popup->GetButtonResult();
       bool remember = popup->GetCheckBoxResult();
       if (remember) {
@@ -741,7 +742,7 @@ void WebApplication::OnQuotaExceed(
   popup->SetBody(popup_string::kPopupBodyWebStorage);
   popup->SetCheckBox(popup_string::kPopupCheckRememberPreference);
   popup->SetResultHandler(
-    [db, result_handler, url](Popup* popup, void* user_data) {
+    [db, result_handler, url](Popup* popup, void* /*user_data*/) {
       bool result = popup->GetButtonResult();
       bool remember = popup->GetCheckBoxResult();
       if (remember) {
@@ -755,8 +756,8 @@ void WebApplication::OnQuotaExceed(
 
 void WebApplication::OnAuthenticationRequest(
       WebView*,
-      const std::string& url,
-      const std::string& message,
+      const std::string& /*url*/,
+      const std::string& /*message*/,
       std::function<void(bool submit,
                          const std::string& id,
                          const std::string& password)
@@ -770,7 +771,7 @@ void WebApplication::OnAuthenticationRequest(
   popup->SetTitle(popup_string::kPopupTitleAuthRequest);
   popup->SetBody(popup_string::kPopupBodyAuthRequest);
   popup->SetResultHandler(
-    [result_handler](Popup* popup, void* user_data) {
+    [result_handler](Popup* popup, void* /*user_data*/) {
       bool result = popup->GetButtonResult();
       std::string id = popup->GetFirstEntryResult();
       std::string passwd = popup->GetSecondEntryResult();
@@ -781,7 +782,7 @@ void WebApplication::OnAuthenticationRequest(
 
 void WebApplication::OnCertificateAllowRequest(
       WebView*,
-      const std::string& url,
+      const std::string& /*url*/,
       const std::string& pem,
       std::function<void(bool allow)> result_handler) {
   auto db = AppDB::GetInstance();
@@ -799,7 +800,7 @@ void WebApplication::OnCertificateAllowRequest(
   popup->SetBody(popup_string::kPopupBodyCert);
   popup->SetCheckBox(popup_string::kPopupCheckRememberPreference);
   popup->SetResultHandler(
-    [db, result_handler, pem](Popup* popup, void* user_data) {
+    [db, result_handler, pem](Popup* popup, void* /*user_data*/) {
       bool result = popup->GetButtonResult();
       bool remember = popup->GetCheckBoxResult();
       if (remember) {
index 90a487a..d5ce222 100755 (executable)
@@ -524,14 +524,14 @@ void WebViewImpl::InitWindowCreateCallback() {
 void WebViewImpl::InitFullscreenCallback() {
   auto enter_callback = [](void* user_data,
                             Evas_Object*,
-                            void* event_info) {
+                            void* /*event_info*/) {
     WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
     self->fullscreen_ = true;
     self->window_->FullScreen(true);
   };
   auto exit_callback =  [](void* user_data,
                             Evas_Object*,
-                            void* event_info) {
+                            void* /*event_info*/) {
     WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
     self->fullscreen_ = false;
     self->window_->FullScreen(false);
index e71de94..b4e0b7c 100755 (executable)
@@ -150,7 +150,6 @@ Popup* Popup::CreatePopup(Evas_Object* window) {
 }
 
 void Popup::SetButtonType(ButtonType type) {
-  using namespace popup_string;
   enable_button_ = true;
   switch (type) {
     case ButtonType::OkButton:
index 9a28e50..679af03 100644 (file)
@@ -29,7 +29,7 @@ class Popup {
     Edit,
     PwEdit
   };
-  //static Popup* CreatePopup(NativeWindow* window);
+  // static Popup* CreatePopup(NativeWindow* window);
   static Popup* CreatePopup(Evas_Object* window);
 
   // button
index ae953bf..524bc92 100755 (executable)
@@ -4,9 +4,9 @@
 
 #include <Elementary.h>
 #include <string>
+#include <iostream>
 #include "popup/popup.h"
 #include "popup/popup_string.h"
-#include <iostream>
 
 int main(int argc, char **argv) {
   const char* kLocaleKorean = "ko_KR";
@@ -38,10 +38,10 @@ int main(int argc, char **argv) {
   popup->SetCheckBox(check_label);
   popup->SetButtonType(wrt::Popup::ButtonType::AllowDenyButton);
   popup-> SetResultHandler([](wrt::Popup* popup, void* user_data) {
-   std::cout<< popup->GetFirstEntryResult() << std::endl;
-   std::cout<< popup->GetSecondEntryResult() << std::endl;
-   std::cout<< popup->GetCheckBoxResult() << std::endl;
-   std::cout<< popup->GetButtonResult() << std::endl;
+    std::cout<< popup->GetFirstEntryResult() << std::endl;
+    std::cout<< popup->GetSecondEntryResult() << std::endl;
+    std::cout<< popup->GetCheckBoxResult() << std::endl;
+    std::cout<< popup->GetButtonResult() << std::endl;
   }, NULL);
   popup->Show();