From 76857834da6767305bf4bf8ed4de7a2f7b025b9b Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Mon, 18 May 2015 15:51:16 +0900 Subject: [PATCH] Cleanup code Change-Id: Ieb256cc6c1b824cb301f87d815f4b6a14f2bb150 --- src/bundle/runtime_ipc_client.cc | 2 +- src/bundle/runtime_ipc_client.h | 7 ++++--- src/runtime/popup.cc | 5 ----- src/runtime/web_application.cc | 25 +++++++++++++------------ src/runtime/web_view_impl.cc | 4 ++-- tests/popup/popup.cc | 1 - tests/popup/popup.h | 2 +- tests/popup/test_popup.cc | 10 +++++----- 8 files changed, 26 insertions(+), 30 deletions(-) mode change 100644 => 100755 src/runtime/popup.cc diff --git a/src/bundle/runtime_ipc_client.cc b/src/bundle/runtime_ipc_client.cc index 08995ce..b49a3af 100644 --- a/src/bundle/runtime_ipc_client.cc +++ b/src/bundle/runtime_ipc_client.cc @@ -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; diff --git a/src/bundle/runtime_ipc_client.h b/src/bundle/runtime_ipc_client.h index 91bac59..a098270 100644 --- a/src/bundle/runtime_ipc_client.h +++ b/src/bundle/runtime_ipc_client.h @@ -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 callbacks_; }; -} // namespace +} // namespace wrt -#endif // WRT_BUNDLE_RUNTIME_IPC_CLIENT_H_ \ No newline at end of file +#endif // WRT_BUNDLE_RUNTIME_IPC_CLIENT_H_ diff --git a/src/runtime/popup.cc b/src/runtime/popup.cc old mode 100644 new mode 100755 index e262355..5310283 --- a/src/runtime/popup.cc +++ b/src/runtime/popup.cc @@ -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: diff --git a/src/runtime/web_application.cc b/src/runtime/web_application.cc index ab6d79c..0678c79 100755 --- a/src/runtime/web_application.cc +++ b/src/runtime/web_application.cc @@ -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::functionSetTitle(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 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) { diff --git a/src/runtime/web_view_impl.cc b/src/runtime/web_view_impl.cc index 90a487a..d5ce222 100755 --- a/src/runtime/web_view_impl.cc +++ b/src/runtime/web_view_impl.cc @@ -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(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(user_data); self->fullscreen_ = false; self->window_->FullScreen(false); diff --git a/tests/popup/popup.cc b/tests/popup/popup.cc index e71de94..b4e0b7c 100755 --- a/tests/popup/popup.cc +++ b/tests/popup/popup.cc @@ -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: diff --git a/tests/popup/popup.h b/tests/popup/popup.h index 9a28e50..679af03 100644 --- a/tests/popup/popup.h +++ b/tests/popup/popup.h @@ -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 diff --git a/tests/popup/test_popup.cc b/tests/popup/test_popup.cc index ae953bf..524bc92 100755 --- a/tests/popup/test_popup.cc +++ b/tests/popup/test_popup.cc @@ -4,9 +4,9 @@ #include #include +#include #include "popup/popup.h" #include "popup/popup_string.h" -#include 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(); -- 2.7.4