Cleanup code
authorWonYoung Choi <wy80.choi@samsung.com>
Wed, 8 Jul 2015 02:00:49 +0000 (11:00 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Thu, 9 Jul 2015 05:12:20 +0000 (14:12 +0900)
Change-Id: I19f9f39503149d4296474cbcde60e625ac5a02fe

src/bundle/object_tools_module.cc
src/common/locale_manager.cc
src/common/url.cc
src/runtime/native_window.cc
src/runtime/web_application.cc
src/runtime/web_view_impl.cc

index c19206c..7136886 100755 (executable)
@@ -17,6 +17,7 @@
 #include "bundle/object_tools_module.h"
 
 #include <v8/v8.h>
+#include <string>
 
 #include "common/logger.h"
 
index d31956c..06961d3 100755 (executable)
@@ -55,7 +55,8 @@ void LocaleManager::EnableAutoUpdate(bool enable) {
         LocaleManager* locale = static_cast<LocaleManager*>(user_data);
         locale->UpdateSystemLocale();
     };
-    system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, callback, this);
+    system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE,
+                                   callback, this);
   } else {
     system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE);
   }
@@ -75,8 +76,9 @@ void LocaleManager::SetDefaultLocale(const std::string& locale) {
 void LocaleManager::UpdateSystemLocale() {
   char* str = NULL;
   if (SYSTEM_SETTINGS_ERROR_NONE !=
-      system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &str)
-     || str == NULL) {
+      system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE,
+                                       &str) ||
+      str == NULL) {
     return;
   }
   std::string lang = localeToBCP47LangTag(str);
index 8618987..2a6f2b2 100755 (executable)
@@ -129,9 +129,9 @@ void URLImpl::ExtractDomainPort() {
   if (port_separator != std::string::npos) {
     domain_ = domain.substr(0, port_separator);
     std::string port = domain.substr(port_separator+1);
-    if (port.empty())
+    if (port.empty()) {
       port_ = GetDefaultPort(scheme_);
-    else {
+    else {
       try {
         port_ = std::stoi(port);
       } catch (...) {
index 3512fce..0233027 100755 (executable)
@@ -205,7 +205,7 @@ void NativeWindow::RemoveRotationHandler(int id) {
 }
 
 void NativeWindow::SetRotationLock(int degree) {
-  rotation_ = degree%360;
+  rotation_ = degree % 360;
   elm_win_wm_rotation_preferred_rotation_set(window_, rotation_);
   elm_win_rotation_set(window_, rotation_);
 }
index 1612379..3b556a5 100755 (executable)
@@ -364,9 +364,8 @@ void WebApplication::Launch(std::unique_ptr<wrt::AppControl> appcontrol) {
   SetupWebView(view);
 
   // send widget info to injected bundle
-  // TODO(wy80.choi): ewk_send_widget_info should be fixed to receive uuid of
-  // application instead of widget_id.
-  // Currently, uuid is passed as encoded_bundle argument temporarily.
+  // TODO(wy80.choi): Currently, uuid is passed as encoded_bundle argument
+  // temporarily.
   ewk_send_widget_info(ewk_context_, appid_.c_str(),
                        elm_config_scale_get(),
                        elm_theme_get(NULL),
@@ -375,25 +374,10 @@ void WebApplication::Launch(std::unique_ptr<wrt::AppControl> appcontrol) {
   std::unique_ptr<ResourceManager::Resource> res =
     resource_manager_->GetStartResource(appcontrol.get());
   view->SetDefaultEncoding(res->encoding());
-  // TODO(wy80.choi): temporary comment for test, remove it later.
-  // view->LoadUrl("file:///home/owner/apps_rw/33CFo0eFJe/"
-  //               "33CFo0eFJe.annex/index.html");
   view->LoadUrl(res->uri());
   view_stack_.push_front(view);
   window_->SetContent(view->evas_object());
 
-  // TODO(sngn.lee): below code only debug code
-  auto callback = [](void*, Evas*, Evas_Object* obj,
-                     void*) -> void {
-    int x, y, w, h;
-    evas_object_geometry_get(obj, &x, &y, &w, &h);
-    LOGGER(DEBUG) << "resize ! ("
-                  << x << ", " << y << ", " << w << ", " << h << ")";
-  };
-  evas_object_event_callback_add(view->evas_object(),
-                                 EVAS_CALLBACK_RESIZE,
-                                 callback, NULL);
-
   if (appcontrol->data(kDebugKey) == "true") {
     debug_mode_ = true;
     LaunchInspector(appcontrol.get());
@@ -561,19 +545,6 @@ void WebApplication::OnReceivedWrtMessage(
       LOGGER(ERROR) << "Failed to send response";
     }
     ewk_ipc_wrt_message_data_del(ans);
-  } else if (TYPE_IS("tizen://test-sync")) {
-    // TODO(wy80.choi): this type should be removed after finish test
-    ewk_ipc_wrt_message_data_value_set(msg, "Reply!!");
-  } else if (TYPE_IS("tizen://test-async")) {
-    // TODO(wy80.choi): this type should be removed after finish test
-    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);
-    ewk_ipc_wrt_message_data_value_set(ans, "Aync Reply!!");
-    if (!ewk_ipc_wrt_message_send(ewk_context_, ans)) {
-      LOGGER(ERROR) << "Failed to send response";
-    }
-    ewk_ipc_wrt_message_data_del(ans);
   }
   #undef TYPE_IS
 
@@ -903,8 +874,6 @@ void WebApplication::HandleDBusMethod(GDBusConnection* /*connection*/,
     if (g_strcmp0(key, "runtime_name") == 0) {
       value = std::string("wrt");
     } else if (g_strcmp0(key, "app_id") == 0) {
-      // TODO(wy80.choi): TEC requries double quotes,
-      // but webapi-plugins doesn't. It should be fixed.
       value = "\"" + appid_ + "\"";
     } else if (g_strcmp0(key, "encoded_bundle") == 0) {
       value = received_appcontrol_->encoded_bundle();
index 583b37b..0bbf6d5 100755 (executable)
@@ -306,12 +306,10 @@ void WebViewImpl::InitQuotaExceededCallback() {
   // check http://tizen.org/privilege/unlimitedstorage
 
   // callback for database quota exceeded
-  // TODO(wy80.choi): AARCH64:
-  //   Fix ewk api to use stdint types instead of longlong.
   auto database_exceeded_callback = [](Evas_Object* view,
                                        Ewk_Security_Origin* origin,
                                        const char*,
-                                       unsigned long long,
+                                       unsigned long long, // NOLINT
                                        void* user_data) -> Eina_Bool {
     WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
     if (self == NULL || self->listener_ == NULL)
@@ -339,11 +337,9 @@ void WebViewImpl::InitQuotaExceededCallback() {
     this);
 
   // callback for indexed database quota exceeded
-  // TODO(wy80.choi): AARCH64:
-  //   Fix ewk api to use stdint types instead of longlong.
   auto indexed_db_exceeded_callback = [](Evas_Object* view,
                                        Ewk_Security_Origin* origin,
-                                       long long,
+                                       long long, // NOLINT
                                        void* user_data) -> Eina_Bool {
     WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
     if (self == NULL || self->listener_ == NULL)
@@ -371,11 +367,9 @@ void WebViewImpl::InitQuotaExceededCallback() {
     this);
 
   // callback for localfile quota exceeded
-  // TODO(wy80.choi): AARCH64:
-  //   Fix ewk api to use stdint types instead of longlong.
   auto localfile_exceeded_callback = [](Evas_Object* view,
                                        Ewk_Security_Origin* origin,
-                                       long long,
+                                       long long, // NOLINT
                                        void* user_data) -> Eina_Bool {
     WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
     if (self == NULL || self->listener_ == NULL)