tizen 2.3.1 release submit/tizen_2.3.1/20150915.085854 tizen_2.3.1_release
authorjk7744.park <jk7744.park@samsung.com>
Tue, 8 Sep 2015 15:23:52 +0000 (00:23 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Tue, 8 Sep 2015 15:23:52 +0000 (00:23 +0900)
320 files changed:
.gitignore [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
DESCRIPTION [new file with mode: 0644]
LICENSE.APLv2 [new file with mode: 0644]
LICENSE.Flora [new file with mode: 0644]
NOTICE [new file with mode: 0644]
README [new file with mode: 0755]
WARP_Widgets_Access Request Policy_PAG Report_49839.pdf [new file with mode: 0644]
build/Options.cmake [new file with mode: 0644]
data/DESCRIPTION [new file with mode: 0644]
data/Wrt.edc [new file with mode: 0644]
data/generic_popup.edc [new file with mode: 0644]
data/generic_popup_horizontal.edc [new file with mode: 0644]
dir-struct.py [new file with mode: 0755]
doxyfile [new file with mode: 0644]
packaging/wrt.spec [new file with mode: 0755]
pkgconfig/wrt-core.pc.in [new file with mode: 0644]
po/CMakeLists.txt [new file with mode: 0755]
po/ar.po [new file with mode: 0755]
po/az.po [new file with mode: 0755]
po/bg.po [new file with mode: 0755]
po/bn.po [new file with mode: 0755]
po/ca.po [new file with mode: 0755]
po/cs.po [new file with mode: 0755]
po/da.po [new file with mode: 0755]
po/de_DE.po [new file with mode: 0755]
po/el_GR.po [new file with mode: 0755]
po/en.po [new file with mode: 0755]
po/en_PH.po [new file with mode: 0755]
po/en_US.po [new file with mode: 0755]
po/es_ES.po [new file with mode: 0755]
po/es_MX.po [new file with mode: 0755]
po/es_US.po [new file with mode: 0755]
po/et.po [new file with mode: 0755]
po/eu.po [new file with mode: 0755]
po/fi.po [new file with mode: 0755]
po/fr_CA.po [new file with mode: 0755]
po/fr_FR.po [new file with mode: 0755]
po/ga.po [new file with mode: 0755]
po/gl.po [new file with mode: 0755]
po/gu.po [new file with mode: 0755]
po/hi.po [new file with mode: 0755]
po/hr.po [new file with mode: 0755]
po/hu.po [new file with mode: 0755]
po/hy.po [new file with mode: 0755]
po/id.po [new file with mode: 0755]
po/is.po [new file with mode: 0755]
po/it_IT.po [new file with mode: 0755]
po/ja_JP.po [new file with mode: 0755]
po/ka.po [new file with mode: 0755]
po/kk.po [new file with mode: 0755]
po/km.po [new file with mode: 0755]
po/kn.po [new file with mode: 0755]
po/ko_KR.po [new file with mode: 0755]
po/lo.po [new file with mode: 0755]
po/lt.po [new file with mode: 0755]
po/lv.po [new file with mode: 0755]
po/mk.po [new file with mode: 0755]
po/ml.po [new file with mode: 0755]
po/mn_MN.po [new file with mode: 0755]
po/mr.po [new file with mode: 0755]
po/ms.po [new file with mode: 0755]
po/my.po [new file with mode: 0755]
po/nb.po [new file with mode: 0755]
po/ne.po [new file with mode: 0755]
po/nl_NL.po [new file with mode: 0755]
po/or.po [new file with mode: 0755]
po/pa.po [new file with mode: 0755]
po/pl.po [new file with mode: 0755]
po/pt_BR.po [new file with mode: 0755]
po/pt_PT.po [new file with mode: 0755]
po/ro.po [new file with mode: 0755]
po/ru_RU.po [new file with mode: 0755]
po/si.po [new file with mode: 0755]
po/sk.po [new file with mode: 0755]
po/sl.po [new file with mode: 0755]
po/sr.po [new file with mode: 0755]
po/sv.po [new file with mode: 0755]
po/ta.po [new file with mode: 0755]
po/te.po [new file with mode: 0755]
po/th.po [new file with mode: 0755]
po/tl.po [new file with mode: 0755]
po/tr_TR.po [new file with mode: 0755]
po/uk.po [new file with mode: 0755]
po/ur.po [new file with mode: 0755]
po/uz.po [new file with mode: 0755]
po/vi.po [new file with mode: 0755]
po/zh_CN.po [new file with mode: 0755]
po/zh_HK.po [new file with mode: 0755]
po/zh_SG.po [new file with mode: 0755]
po/zh_TW.po [new file with mode: 0755]
src/CMakeLists.txt [new file with mode: 0644]
src/DESCRIPTION [new file with mode: 0644]
src/api_new/CMakeLists.txt [new file with mode: 0644]
src/api_new/core_module.cpp [new file with mode: 0644]
src/api_new/core_module.h [new file with mode: 0644]
src/api_new/i_runnable_widget_object.h [new file with mode: 0644]
src/api_new/runnable_widget_object.cpp [new file with mode: 0644]
src/api_new/runnable_widget_object.h [new file with mode: 0644]
src/api_new/runnable_widget_object_state.cpp [new file with mode: 0644]
src/api_new/runnable_widget_object_state.h [new file with mode: 0644]
src/api_new/security_support.cpp [new file with mode: 0755]
src/api_new/security_support.h [new file with mode: 0644]
src/api_new/user_delegates.h [new file with mode: 0755]
src/domain/DESCRIPTION [new file with mode: 0644]
src/domain/application_data.cpp [new file with mode: 0644]
src/domain/application_data.h [new file with mode: 0644]
src/domain/iana_record_types.h [new file with mode: 0644]
src/domain/localization_setting.cpp [new file with mode: 0644]
src/domain/localization_setting.h [new file with mode: 0644]
src/domain/main_thread.cpp [new file with mode: 0644]
src/domain/main_thread.h [new file with mode: 0644]
src/domain/message_support.h [new file with mode: 0644]
src/domain/permission_popup_manager.cpp [new file with mode: 0644]
src/domain/permission_popup_manager.h [new file with mode: 0644]
src/domain/widget_data_types.cpp [new file with mode: 0755]
src/domain/widget_data_types.h [new file with mode: 0755]
src/domain/widget_deserialize_model.cpp [new file with mode: 0644]
src/domain/widget_deserialize_model.h [new file with mode: 0644]
src/domain/widget_model.cpp [new file with mode: 0644]
src/domain/widget_model.h [new file with mode: 0644]
src/domain/widget_string.h [new file with mode: 0644]
src/pre-launching/pre_launching_support.cpp [new file with mode: 0644]
src/pre-launching/pre_launching_support.h [new file with mode: 0644]
src/profiling/CMakeLists.txt [new file with mode: 0644]
src/profiling/profiling_util.cpp [new file with mode: 0644]
src/profiling/profiling_util.h [new file with mode: 0644]
src/profiling/script/profiling-host-part.pl [new file with mode: 0755]
src/profiling/script/profiling-target-part.pl [new file with mode: 0755]
src/profiling/script/ranges [new file with mode: 0644]
src/profiling/script/ranges.py [new file with mode: 0755]
src/profiling/script/test-widgets/0Jet_Pack_Agent.wgt [new file with mode: 0644]
src/profiling/script/test-widgets/UnitTestAuto.wgt [new file with mode: 0644]
src/profiling/script/test-widgets/minimal.wgt [new file with mode: 0644]
src/profiling/script/utils/analyse.pl [new file with mode: 0755]
src/profiling/script/utils/csv-stats.pl [new file with mode: 0755]
src/profiling/script/utils/generate-plot.sh [new file with mode: 0755]
src/profiling/script/utils/plot-generator.gplot [new file with mode: 0644]
src/profiling/script/utils/wrt-preloader [new file with mode: 0755]
src/view/CMakeLists.txt [new file with mode: 0644]
src/view/common/CMakeLists.txt [new file with mode: 0644]
src/view/common/application_launcher.cpp [new file with mode: 0644]
src/view/common/application_launcher.h [new file with mode: 0644]
src/view/common/evas_object.cpp [new file with mode: 0644]
src/view/common/evas_object.h [new file with mode: 0644]
src/view/common/scheme.cpp [new file with mode: 0644]
src/view/common/scheme.h [new file with mode: 0644]
src/view/common/scheme_action_map.cpp [new file with mode: 0644]
src/view/common/scheme_action_map.h [new file with mode: 0644]
src/view/common/scheme_action_map_data.h [new file with mode: 0644]
src/view/common/scheme_action_map_type.h [new file with mode: 0644]
src/view/common/view_logic_apps_support.cpp [new file with mode: 0644]
src/view/common/view_logic_apps_support.h [new file with mode: 0644]
src/view/common/view_logic_certificate_support.cpp [new file with mode: 0644]
src/view/common/view_logic_certificate_support.h [new file with mode: 0644]
src/view/common/view_logic_custom_header_support.cpp [new file with mode: 0644]
src/view/common/view_logic_custom_header_support.h [new file with mode: 0644]
src/view/common/view_logic_get_parent_window_util.h [new file with mode: 0644]
src/view/common/view_logic_help_popup_support.cpp [new file with mode: 0644]
src/view/common/view_logic_help_popup_support.h [new file with mode: 0644]
src/view/common/view_logic_privilege_support.cpp [new file with mode: 0644]
src/view/common/view_logic_privilege_support.h [new file with mode: 0644]
src/view/common/view_logic_security_origin_support.cpp [new file with mode: 0644]
src/view/common/view_logic_security_origin_support.h [new file with mode: 0755]
src/view/common/view_logic_security_origin_support_util.cpp [new file with mode: 0644]
src/view/common/view_logic_security_origin_support_util.h [new file with mode: 0644]
src/view/common/view_logic_security_support.cpp [new file with mode: 0644]
src/view/common/view_logic_security_support.h [new file with mode: 0644]
src/view/common/view_logic_storage_support.cpp [new file with mode: 0644]
src/view/common/view_logic_storage_support.h [new file with mode: 0644]
src/view/common/view_logic_uri_support.cpp [new file with mode: 0644]
src/view/common/view_logic_uri_support.h [new file with mode: 0644]
src/view/common/view_logic_vibration_support.cpp [new file with mode: 0644]
src/view/common/view_logic_vibration_support.h [new file with mode: 0644]
src/view/context_manager.cpp [new file with mode: 0644]
src/view/i_context_manager.h [new file with mode: 0644]
src/view/i_view_module.h [new file with mode: 0644]
src/view/view_module.cpp [new file with mode: 0644]
src/view/webkit/CMakeLists.txt [new file with mode: 0644]
src/view/webkit/ewk_context_manager.cpp [new file with mode: 0644]
src/view/webkit/ewk_context_manager.h [new file with mode: 0644]
src/view/webkit/injected-bundle/CMakeLists.txt [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_decryption_support.h [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_decryption_support_impl.cpp [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_decryption_support_impl.h [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_plugin_interface.cpp [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_plugin_interface.h [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_threaded_decryption_support_impl.cpp [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_threaded_decryption_support_impl.h [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_uri_handling.h [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.cpp [new file with mode: 0644]
src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.h [new file with mode: 0644]
src/view/webkit/injected-bundle/page_global_context_container.cpp [new file with mode: 0644]
src/view/webkit/injected-bundle/page_global_context_container.h [new file with mode: 0644]
src/view/webkit/injected-bundle/wrt-injected-bundle.cpp [new file with mode: 0644]
src/view/webkit/injected-bundle/wrt-injected-bundle.h [new file with mode: 0644]
src/view/webkit/injected-bundle/wrt-injected-bundle.map [new file with mode: 0644]
src/view/webkit/view_logic.cpp [new file with mode: 0644]
src/view/webkit/view_logic.h [new file with mode: 0644]
src/view/webkit/view_logic_authentication_challenge_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_authentication_challenge_support.h [new file with mode: 0644]
src/view/webkit/view_logic_authentication_request_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_authentication_request_support.h [new file with mode: 0644]
src/view/webkit/view_logic_certificate_confirm_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_certificate_confirm_support.h [new file with mode: 0755]
src/view/webkit/view_logic_geolocation_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_geolocation_support.h [new file with mode: 0644]
src/view/webkit/view_logic_message_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_message_support.h [new file with mode: 0644]
src/view/webkit/view_logic_orientation_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_orientation_support.h [new file with mode: 0644]
src/view/webkit/view_logic_scheme_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_scheme_support.h [new file with mode: 0644]
src/view/webkit/view_logic_user_agent_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_user_agent_support.h [new file with mode: 0644]
src/view/webkit/view_logic_usermedia_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_usermedia_support.h [new file with mode: 0644]
src/view/webkit/view_logic_web_notification_data.cpp [new file with mode: 0644]
src/view/webkit/view_logic_web_notification_data.h [new file with mode: 0644]
src/view/webkit/view_logic_web_notification_permission_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_web_notification_permission_support.h [new file with mode: 0644]
src/view/webkit/view_logic_web_notification_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_web_notification_support.h [new file with mode: 0644]
src/view/webkit/view_logic_web_storage_support.cpp [new file with mode: 0644]
src/view/webkit/view_logic_web_storage_support.h [new file with mode: 0644]
src/wrt-client/CMakeLists.txt [new file with mode: 0644]
src/wrt-client/DESCRIPTION [new file with mode: 0644]
src/wrt-client/client_command_line_parser.cpp [new file with mode: 0644]
src/wrt-client/client_command_line_parser.h [new file with mode: 0644]
src/wrt-client/client_ide_support.cpp [new file with mode: 0644]
src/wrt-client/client_ide_support.h [new file with mode: 0644]
src/wrt-client/client_orientation_support.cpp [new file with mode: 0644]
src/wrt-client/client_orientation_support.h [new file with mode: 0644]
src/wrt-client/client_submode_support.cpp [new file with mode: 0644]
src/wrt-client/client_submode_support.h [new file with mode: 0644]
src/wrt-client/process_pool/smack_labeling_support.cpp [new file with mode: 0644]
src/wrt-client/process_pool/smack_labeling_support.h [new file with mode: 0644]
src/wrt-client/splash_screen_support.cpp [new file with mode: 0644]
src/wrt-client/splash_screen_support.h [new file with mode: 0644]
src/wrt-client/web_app_manager.cpp [new file with mode: 0644]
src/wrt-client/web_app_manager.h [new file with mode: 0644]
src/wrt-client/widget_state.h [new file with mode: 0644]
src/wrt-client/window_data.cpp [new file with mode: 0644]
src/wrt-client/window_data.h [new file with mode: 0644]
src/wrt-client/wrt-client-lite.cpp [new file with mode: 0644]
src/wrt-client/wrt-client-lite.h [new file with mode: 0644]
src/wrt-client/wrt-client.cpp [new file with mode: 0644]
src/wrt-client/wrt-client.h [new file with mode: 0755]
src/wrt-launcher/CMakeLists.txt [new file with mode: 0644]
src/wrt-launcher/wrt-launcher.cpp [new file with mode: 0755]
src/wrt-launchpad-daemon/CMakeLists.txt [new file with mode: 0644]
src/wrt-launchpad-daemon/data/preload_list_wrt.in [new file with mode: 0644]
src/wrt-launchpad-daemon/data/preload_list_wrt_lite.in [new file with mode: 0644]
src/wrt-launchpad-daemon/data/preload_list_wrt_one_ui.in [new file with mode: 0644]
src/wrt-launchpad-daemon/include/access_control.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/app_signal.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/app_sock.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/config.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/execute_on_whole_thread_util.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/launchpad_util.h [new file with mode: 0755]
src/wrt-launchpad-daemon/include/menu_db_util.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/pre_launching.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/preexec.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/preload.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/process_pool.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/process_pool_launchpad_util.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/sigchild.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/simple_util.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/web_app_core.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/web_app_core_data.h [new file with mode: 0644]
src/wrt-launchpad-daemon/include/web_app_core_tskmgr_util.h [new file with mode: 0755]
src/wrt-launchpad-daemon/include/web_app_core_x_util.h [new file with mode: 0755]
src/wrt-launchpad-daemon/include/web_internal_eventloop.h [new file with mode: 0644]
src/wrt-launchpad-daemon/src/access_control.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/app_sock.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/launchpad.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/launchpad_lite.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/pre_launching.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/process_pool.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/simple_util.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/web_app_core.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/web_app_core_data.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/web_app_core_tskmgr_util.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/web_app_core_x_util.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/src/web_internal_eventloop.cpp [new file with mode: 0644]
src/wrt-launchpad-daemon/wrt_launchpad_daemon.map [new file with mode: 0644]
systemd/wrt_launchpad_daemon@.service [new file with mode: 0644]
systemd/wrt_launchpad_daemon_1.socket [new file with mode: 0644]
systemd/wrt_launchpad_daemon_1.socket.in [new file with mode: 0644]
systemd/wrt_launchpad_daemon_1.socket.lite.in [new file with mode: 0644]
systemd/wrt_launchpad_daemon_2.socket [new file with mode: 0644]
tests/CMakeLists.txt [new file with mode: 0644]
tests/widgets/CMakeLists.txt [new file with mode: 0644]
tests/widgets/CMakeUtils.txt [new file with mode: 0644]
tests/widgets/TestCases.cpp [new file with mode: 0644]
tests/widgets/TestInit.cpp [new file with mode: 0644]
tests/widgets/common/CMakeLists.txt [new file with mode: 0644]
tests/widgets/common/include/InstallerWrapper.h [new file with mode: 0644]
tests/widgets/common/include/RunnableObjectStateTester.h [new file with mode: 0644]
tests/widgets/common/include/mock/MockContextManager.h [new file with mode: 0644]
tests/widgets/common/include/mock/MockViewModule.h [new file with mode: 0644]
tests/widgets/common/src/InstallerWrapper.cpp [new file with mode: 0644]
tests/widgets/common/src/RunnableObjectStateTester.cpp [new file with mode: 0644]
tests/widgets/common/src/mock/MockContextManager.cpp [new file with mode: 0644]
tests/widgets/common/src/mock/MockViewModule.cpp [new file with mode: 0644]
tests/widgets/files/CMakeLists.txt [new file with mode: 0644]
tests/widgets/files/any.wgt [new file with mode: 0644]
tests/widgets/files/minimal.wgt [new file with mode: 0644]
uncrustify.cfg [new file with mode: 0644]
uncrustify.sh [new file with mode: 0755]
wrt-engine-test.map [new file with mode: 0644]
wrt-engine.map [new file with mode: 0644]
wrt.manifest [new file with mode: 0644]
wrt_env.sh [new file with mode: 0644]
wrt_launchpad_daemon.rule.in [new file with mode: 0644]
wrt_launchpad_daemon.rule.lite.in [new file with mode: 0644]
wrt_reset_all.sh [new file with mode: 0755]
wrt_reset_db.sh [new file with mode: 0755]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..23e9fb0
--- /dev/null
@@ -0,0 +1,41 @@
+build_log
+*.log
+*.pyc
+usr
+opt
+*.o
+*.os
+*.exe
+packages
+binaries
+*.ipk
+*~
+*.lo
+.libs
+.deps
+*.la
+Makefile.in
+Makefile
+Documentation/html/
+build-stamp
+CMakeFiles
+CMakeCache.txt
+data/*.edj
+cmake_build_tmp/
+.cproject
+.project
+debian/files
+debian/tmp/
+debian/wrt/*
+debian/wrt.debhelper.log
+debian/wrt.install
+debian/wrt.postinst
+debian/wrt.postinst.debhelper
+debian/wrt.postrm.debhelper
+debian/wrt.substvars
+debian/wrt-dbg/
+debian/wrt-dbg.substvars
+debian/wrt-test/
+debian/wrt-test.debhelper.log
+debian/wrt-test.substvars
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..eba7100
--- /dev/null
@@ -0,0 +1,346 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+#
+# @file        CMakeLists.txt
+# @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
+# @author      Pawel Sikorski (p.sikorski@samsung.com)
+# @version     1.0
+# @brief
+#
+
+# Check minimum CMake version
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+# Project name
+PROJECT(wrt)
+
+INCLUDE(FindPkgConfig)
+INCLUDE (CMakeParseArguments)
+
+FUNCTION (GROUP_DEPS _name)
+   CMAKE_PARSE_ARGUMENTS (PARAM "" "" "DEPS" ${ARGN})
+
+   FOREACH (_dep ${PARAM_DEPS})
+      LIST (APPEND ${_name}_LIBRARIES ${${_dep}_LIBRARIES})
+      LIST (APPEND ${_name}_INCLUDE_DIRS ${${_dep}_INCLUDE_DIRS})
+      LIST (APPEND ${_name}_CFLAGS ${${_dep}_CFLAGS})
+      LIST (APPEND ${_name}_CFLAGS_OTHER ${${_dep}_CFLAGS_OTHER})
+      LIST (APPEND ${_name}_LIBRARY_DIRS ${${_dep}_LIBRARY_DIRS})
+   ENDFOREACH()
+
+   SET (${_name}_INCLUDE_DIRS ${${_name}_INCLUDE_DIRS} PARENT_SCOPE)
+   SET (${_name}_LIBRARIES ${${_name}_LIBRARIES} PARENT_SCOPE)
+   SET (${_name}_CFLAGS ${${_name}_CFLAGS} PARENT_SCOPE)
+   SET (${_name}_CFLAGS_OTHER ${${_name}_CFLAGS_OTHER} PARENT_SCOPE)
+   SET (${_name}_LIBRARY_DIRS ${${_name}_LIBRARY_DIRS} PARENT_SCOPE)
+ENDFUNCTION()
+
+PKG_SEARCH_MODULE(libsmack REQUIRED libsmack)
+PKG_SEARCH_MODULE(dpl-efl REQUIRED dpl-efl)
+PKG_SEARCH_MODULE(dpl-dbus-efl REQUIRED dpl-dbus-efl)
+PKG_SEARCH_MODULE(dpl-event-efl REQUIRED dpl-event-efl)
+PKG_SEARCH_MODULE(dpl-utils-efl REQUIRED dpl-utils-efl)
+PKG_SEARCH_MODULE(wrt-popup-ace-runner REQUIRED wrt-popup-ace-runner)
+PKG_SEARCH_MODULE(security-core REQUIRED security-core)
+PKG_SEARCH_MODULE(security-client REQUIRED security-client)
+PKG_SEARCH_MODULE(elementary REQUIRED elementary)
+PKG_SEARCH_MODULE(ewebkit2 REQUIRED ewebkit2)
+PKG_SEARCH_MODULE(openssl REQUIRED openssl)
+PKG_SEARCH_MODULE(libpcrecpp REQUIRED libpcrecpp)
+PKG_SEARCH_MODULE(glib REQUIRED glib-2.0)
+PKG_SEARCH_MODULE(gthread REQUIRED gthread-2.0)
+PKG_SEARCH_MODULE(libsoup REQUIRED libsoup-2.4)
+PKG_SEARCH_MODULE(libiri REQUIRED libiri)
+PKG_SEARCH_MODULE(appsvc REQUIRED appsvc)
+PKG_SEARCH_MODULE(cert-svc-vcore REQUIRED cert-svc-vcore)
+PKG_SEARCH_MODULE(edje REQUIRED edje)
+PKG_SEARCH_MODULE(ecore REQUIRED ecore)
+PKG_SEARCH_MODULE(ecore-x REQUIRED ecore-x)
+PKG_SEARCH_MODULE(evas REQUIRED evas)
+PKG_SEARCH_MODULE(eina REQUIRED eina)
+PKG_SEARCH_MODULE(vconf REQUIRED vconf)
+PKG_SEARCH_MODULE(cert-svc REQUIRED cert-svc)
+PKG_SEARCH_MODULE(ui-gadget-1 REQUIRED ui-gadget-1)
+PKG_SEARCH_MODULE(secure-storage REQUIRED secure-storage)
+PKG_SEARCH_MODULE(capi-appfw-app-manager REQUIRED capi-appfw-app-manager)
+PKG_SEARCH_MODULE(wrt-commons-custom-handler-dao-ro REQUIRED wrt-commons-custom-handler-dao-ro)
+PKG_SEARCH_MODULE(aul REQUIRED aul)
+PKG_SEARCH_MODULE(efl-assist REQUIRED efl-assist)
+PKG_SEARCH_MODULE(deviced REQUIRED deviced)
+PKG_SEARCH_MODULE(libcurl REQUIRED libcurl)
+PKG_SEARCH_MODULE(notification REQUIRED notification)
+PKG_SEARCH_MODULE(dpl-wrt-dao-ro REQUIRED dpl-wrt-dao-ro)
+PKG_SEARCH_MODULE(wrt-commons-security-origin-dao REQUIRED wrt-commons-security-origin-dao)
+PKG_SEARCH_MODULE(wrt-commons-certificate-dao REQUIRED wrt-commons-certificate-dao)
+PKG_SEARCH_MODULE(wrt-popup-wrt-runner REQUIRED wrt-popup-wrt-runner)
+PKG_SEARCH_MODULE(wrt-commons-custom-handler-dao-rw REQUIRED wrt-commons-custom-handler-dao-rw)
+PKG_SEARCH_MODULE(wrt-dispatch-event REQUIRED wrt-dispatch-event)
+PKG_SEARCH_MODULE(wrt-plugins-ipc-message REQUIRED wrt-plugins-ipc-message)
+PKG_SEARCH_MODULE(wrt-plugin-js-overlay REQUIRED wrt-plugin-js-overlay)
+PKG_SEARCH_MODULE(wrt-popup-wrt-runner REQUIRED wrt-popup-wrt-runner)
+PKG_SEARCH_MODULE(capi-system-system-settings REQUIRED capi-system-system-settings)
+PKG_SEARCH_MODULE(libprivilege-control REQUIRED libprivilege-control)
+PKG_SEARCH_MODULE(ail REQUIRED ail)
+PKG_SEARCH_MODULE(appcore-efl REQUIRED appcore-efl)
+PKG_SEARCH_MODULE(capi-appfw-application REQUIRED capi-appfw-application)
+PKG_SEARCH_MODULE(libsystemd-daemon REQUIRED libsystemd-daemon)
+PKG_SEARCH_MODULE(dpl-db-efl REQUIRED dpl-db-efl)
+PKG_SEARCH_MODULE(dpl-wrt-dao-rw REQUIRED dpl-wrt-dao-rw)
+PKG_SEARCH_MODULE(dlog REQUIRED dlog)
+PKG_SEARCH_MODULE(app-checker REQUIRED app-checker)
+PKG_SEARCH_MODULE(bundle REQUIRED bundle)
+PKG_SEARCH_MODULE(dbus-glib-1 REQUIRED dbus-glib-1)
+PKG_SEARCH_MODULE(x11 REQUIRED x11)
+PKG_SEARCH_MODULE(sqlite3 REQUIRED sqlite3)
+PKG_SEARCH_MODULE(rua REQUIRED rua)
+PKG_SEARCH_MODULE(wrt-plugin-loading REQUIRED wrt-plugin-loading)
+PKG_SEARCH_MODULE(pkgmgr-info REQUIRED pkgmgr-info)
+PKG_SEARCH_MODULE(privacy-manager-client REQUIRED privacy-manager-client)
+
+STRING(REGEX MATCH "([^.]*)" PROJECT_API_VERSION "${PROJECT_VERSION}")
+ADD_DEFINITIONS("-DPROJECT_API_VERSION=\"$(PROJECT_API_VERSION)\"")
+MESSAGE(STATUS "Version from changelog: ${PROJECT_VERSION}")
+#ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")
+
+#############################
+# Build type
+IF(NOT CMAKE_BUILD_TYPE)
+    SET(CMAKE_BUILD_TYPE "Release")
+ENDIF(NOT CMAKE_BUILD_TYPE)
+
+OPTION(DPL_LOG "DPL logs status" ON)
+SET(LOG_TAG "WRT")
+OPTION(WITH_TESTS "Build tests" OFF)
+
+# logs can be only enabled in debug mode
+IF(CMAKE_BUILD_TYPE MATCHES "Profiling" AND DPL_LOG)
+    MESSAGE(STATUS "Logging disabled for DPL")
+ELSE(CMAKE_BUILD_TYPE MATCHES "Profiling" AND DPL_LOG)
+    ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
+    MESSAGE(STATUS "Logging enabled for DPL")
+ENDIF(CMAKE_BUILD_TYPE MATCHES "Profiling" AND DPL_LOG)
+
+MESSAGE(STATUS "WITH_TESTS: " ${WITH_TESTS})
+MESSAGE(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+OPTION(PROFILING "Profiling status" OFF)
+IF(CMAKE_BUILD_TYPE MATCHES "Profiling")
+    MESSAGE(STATUS "PROFILING: ENABLED")
+    ADD_DEFINITIONS("-DPROFILING_ENABLED")
+    SET(PROFILING ON)
+ELSE(CMAKE_BUILD_TYPE MATCHES "Profiling")
+    MESSAGE(STATUS "PROFILING: DISABLED")
+ENDIF(CMAKE_BUILD_TYPE MATCHES "Profiling")
+
+SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/build")
+INCLUDE(Options)
+
+SET(Boost_USE_STATIC_LIBS OFF)
+SET(Boost_USE_MULTITHREADED ON)
+SET(Boost_USE_STATIC_RUNTIME OFF)
+
+FIND_PACKAGE(Boost 1.51.0 REQUIRED filesystem system)
+
+# Compiler flags
+SET(CMAKE_C_FLAGS_PROFILING    "-O2 -Wl,--no-undefined")
+SET(CMAKE_CXX_FLAGS_PROFILING  "-O2 -std=c++0x -Wl,--no-undefined")
+SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g -Wl,--no-undefined")
+SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++0x -g -Wl,--no-undefined")
+SET(CMAKE_C_FLAGS_RELEASE      "-O2 -g -Wl,--no-undefined")
+SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -std=c++0x -g -fvisibility-inlines-hidden -Wl,--no-undefined")
+SET(CMAKE_CXX_FLAGS_CCOV       "-O0 -std=c++0x -g --coverage -Wl,--no-undefined")
+
+ADD_DEFINITIONS("-fPIC")                        # If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table. This option makes a difference on the m68k, PowerPC and SPARC. (BJ: our ARM too?)
+#ADD_DEFINITIONS("-fvisibility=hidden")          # Set the default ELF image symbol visibility to hidden - all symbols will be marked with this unless overridden within the code.
+
+# Set compiler warning flags
+#ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
+ADD_DEFINITIONS("-Wall")                        # Generate all warnings
+ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
+ADD_DEFINITIONS("-Wno-variadic-macros")         # Inhibit variadic macros warnings (needed for ORM)
+#ADD_DEFINITIONS("-ansi")                        # Accept only ANSI code
+#ADD_DEFINITIONS("-pedantic")                    # Accept only pedantic code
+#ADD_DEFINITIONS("-Weffc++")                     # Accept only effective C++ code
+#ADD_DEFINITIONS("-Wwrite-strings")              # Do not accept writing to contant string memory
+#ADD_DEFINITIONS("-Winit-self")                  # Do not accept initializing variable with itself
+#ADD_DEFINITIONS("-Wcast-align")                 # Do not accept misaligning with casting
+#ADD_DEFINITIONS("-Wcast-qual")                  # Do not accept removing qualifiers with casting
+#ADD_DEFINITIONS("-Wold-style-cast")             # Do not accept old style casting
+#ADD_DEFINITIONS("-Wpointer-arith")              # Warn about void pointer arthimetic
+#ADD_DEFINITIONS("-Wstrict-aliasing")            # Ensure strict aliasing
+#ADD_DEFINITIONS("-Wuninitialized")              # Do not accept uninitialized variables
+#ADD_DEFINITIONS("-Wmissing-declarations")       # Warn about global and non-accesible functions
+#ADD_DEFINITIONS("-Woverloaded-virtual")         # Warn about incidental overiding non-virtual base methods
+#ADD_DEFINITIONS("-Wnon-virtual-dtor")           # Warn about non-virtual destructor
+#ADD_DEFINITIONS("-Wctor-dtor-privacy")          # Warn about useless and non-constructible classes
+#ADD_DEFINITIONS("-Wlong-long")                  # Do not allow using long long
+#ADD_DEFINITIONS("-Wunreachable-code")           # Warn about unreachable code
+#ADD_DEFINITIONS("-Wfloat-equal")                # Do not accept comparing floating points with equal operator
+#ADD_DEFINITIONS("-Wabi")                        # Warn about possible ABI problems
+#ADD_DEFINITIONS("-Wswitch-enum")                # Check switch enumeration
+#ADD_DEFINITIONS("-Wformat=2")                   # Check printf formatting
+#ADD_DEFINITIONS("-Wundef")                      # Warn if an undefined identifier is evaluated in an @if directive.
+#ADD_DEFINITIONS("-Wshadow")                     # Warn whenever a local variable shadows another local variable, parameter or global variable or whenever a built-in function is shadowed
+#ADD_DEFINITIONS("-Wconversion")                 # Warn for implicit conversions that may alter a value
+#ADD_DEFINITIONS("-Wlogical-op")                 # Warn about suspicious uses of logical operators in expressions
+#ADD_DEFINITIONS("-Waggregate-return")           # Warn if any functions that return structures or unions are defined or called.
+#ADD_DEFINITIONS("-Wmissing-field-initializers") # Warn if a structure's initializer has some fields missing.
+#ADD_DEFINITIONS("-Wredundant-decls")            # Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing.
+#ADD_DEFINITIONS("-Wmissing-include-dirs")       # Warn if a user-supplied include directory does not exist.
+#ADD_DEFINITIONS("-Wswitch-default")             # Warn whenever a switch statement does not have a default case.
+#ADD_DEFINITIONS("-Wsync-nand")                  # Warn when __sync_fetch_and_nand and __sync_nand_and_fetch built-in functions are used. These functions changed semantics in GCC 4.4.
+#ADD_DEFINITIONS("-Wunused")                     # All the above -Wunused options combined.
+#ADD_DEFINITIONS("-Wstrict-overflow=5")          # Also warn about cases where the compiler reduces the magnitude of a constant involved in a comparison.
+#ADD_DEFINITIONS("-Wunsafe-loop-optimizations")  # Warn if the loop cannot be optimized because the compiler could not assume anything on the bounds of the loop indices. With -funsafe-loop-optimizations warn if the compiler made such assumptions.
+#ADD_DEFINITIONS("-Wmissing-format-attribute")   # Warn about function pointers which might be candidates for format attributes.
+#ADD_DEFINITIONS("-Wpadded")                     # Warn if padding is included in a structure, either to align an element of the structure or to align the whole structure.
+#ADD_DEFINITIONS("-Winline")                     # Warn if a function can not be inlined and it was declared as inline.
+#ADD_DEFINITIONS("-Wdisabled-optimization")      # Warn if a requested optimization pass is disabled.
+ADD_DEFINITIONS("-Wno-deprecated")               # No warnings about deprecated features
+#############################
+# Targets names
+SET(TARGET_WRT_ENGINE_STATIC  "wrt-engine-static")
+SET(TARGET_TESTS_COMMON_LIB "wrt-engine-tests-lib") #tests only
+SET(TARGET_PROFILING_LIB "wrt-profiling")
+SET(TARGET_VIEW_MODULE_LIB "wrt-view-module")
+SET(TARGET_VIEW_COMMON_LIB_STATIC "wrt-view-common")
+SET(TARGET_CORE_MODULE_LIB "wrt-core-module")
+SET(TARGET_INJECTED_BUNDLE_LIB "wrt-injected-bundle")
+SET(PROF_LIB "")
+SET(TARGET_SMACK_LABELING_SUPPORT_STATIC "smack-labeling-support-static")
+SET(TARGET_CLIENT_SUPPORT_STATIC "client-support-static")
+SET(TARGET_PRE_LAUNCHING_SUPPORT_STATIC  "pre-launching-support-static")
+SET(TARGET_LAUNCHER "wrt-launcher")
+SET(TARGET_WRT_CLIENT "wrt-client")
+SET(TARGET_WRT_LAUNCH_PAD_NAME "wrt_launchpad_daemon")
+IF(PROFILING)
+    SET(PROF_LIB ${TARGET_PROFILING_LIB})
+ENDIF(PROFILING)
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+    SET(TARGET_WRT_EVENT_LOOP_LIB "wrt-event-loop")
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+IF(PRODUCT_FEATURE_WRT_LITE)
+    SET (EDC_DEFINITIONS "-DTIZEN_LITE")
+ELSE(PRODUCT_FEATURE_WRT_LITE)
+    SET (EDC_DEFINITIONS "-DTIZEN")
+ENDIF(PRODUCT_FEATURE_WRT_LITE)
+#############################
+# definitions
+ADD_DEFINITIONS("-DSHARE_PREFIX=\"/usr/share/aul\"")
+ADD_DEFINITIONS("-DWRT_EDJ_PATH=\"/usr/share/edje/wrt/Wrt.edj\"")
+
+#############################
+# edc build
+ADD_CUSTOM_COMMAND(
+    OUTPUT ${PROJECT_SOURCE_DIR}/data/Wrt.edj
+    COMMAND edje_cc ${EDC_DEFINITIONS}
+    ARGS  ${PROJECT_SOURCE_DIR}/data/Wrt.edc
+          ${PROJECT_SOURCE_DIR}/data/Wrt.edj
+    DEPENDS ${PROJECT_SOURCE_DIR}/data/Wrt.edc
+)
+ADD_CUSTOM_TARGET(WRT_EDJE ALL
+    DEPENDS ${PROJECT_SOURCE_DIR}/data/Wrt.edj
+)
+
+ADD_CUSTOM_COMMAND(
+    OUTPUT ${PROJECT_SOURCE_DIR}/data/generic_popup.edj
+    COMMAND edje_cc
+    ARGS  ${PROJECT_SOURCE_DIR}/data/generic_popup.edc
+          ${PROJECT_SOURCE_DIR}/data/generic_popup.edj
+    DEPENDS ${PROJECT_SOURCE_DIR}/data/generic_popup.edc
+)
+ADD_CUSTOM_TARGET(WRT_GENERIC_POPUP_EDJE ALL
+    DEPENDS ${PROJECT_SOURCE_DIR}/data/generic_popup.edj
+)
+
+ADD_CUSTOM_COMMAND(
+    OUTPUT ${PROJECT_SOURCE_DIR}/data/generic_popup_horizontal.edj
+    COMMAND edje_cc
+    ARGS  ${PROJECT_SOURCE_DIR}/data/generic_popup_horizontal.edc
+          ${PROJECT_SOURCE_DIR}/data/generic_popup_horizontal.edj
+    DEPENDS ${PROJECT_SOURCE_DIR}/data/generic_popup_horizontal.edc
+)
+ADD_CUSTOM_TARGET(WRT_GENERIC_POPUP_HORIZONTAL_EDJE ALL
+    DEPENDS ${PROJECT_SOURCE_DIR}/data/generic_popup_horizontal.edj
+)
+
+#############################
+# install
+INSTALL(FILES
+    ${PROJECT_SOURCE_DIR}/wrt_reset_db.sh
+    ${PROJECT_SOURCE_DIR}/wrt_reset_all.sh
+    DESTINATION /usr/bin/
+)
+INSTALL(FILES
+    ${PROJECT_SOURCE_DIR}/data/Wrt.edj
+    DESTINATION share/edje/wrt/
+)
+INSTALL(FILES
+    ${PROJECT_SOURCE_DIR}/data/generic_popup.edj
+    ${PROJECT_SOURCE_DIR}/data/generic_popup_horizontal.edj
+    DESTINATION share/edje/ace/
+)
+
+#############################
+# install launchpad files
+INSTALL(FILES   ${CMAKE_SOURCE_DIR}/wrt_env.sh
+    DESTINATION /etc/profile.d/
+)
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+INSTALL(FILES
+    ${CMAKE_SOURCE_DIR}/wrt_launchpad_daemon.rule.lite.in
+    DESTINATION /etc/smack/accesses.d/
+    RENAME wrt_launchpad_daemon.rule
+)
+INSTALL(FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon_1.socket.lite.in
+    DESTINATION /usr/lib/systemd/system/
+    RENAME wrt_launchpad_daemon_1.socket
+)
+ELSE(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+INSTALL(FILES
+    ${CMAKE_SOURCE_DIR}/wrt_launchpad_daemon.rule.in
+    DESTINATION /etc/smack/accesses.d/
+    RENAME wrt_launchpad_daemon.rule
+)
+INSTALL(FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon_1.socket.in
+    DESTINATION /usr/lib/systemd/system/
+    RENAME wrt_launchpad_daemon_1.socket
+)
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+INSTALL(FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon@.service
+    ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon_2.socket
+    DESTINATION /usr/lib/systemd/system/
+)
+
+ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(po)
+
+SET(WRT_API_NEW_INCLUDES
+    "${PROJECT_SOURCE_DIR}/src/api_new/"
+    "${PROJECT_SOURCE_DIR}/src/domain/"
+    "${PROJECT_SOURCE_DIR}/src/view/")
+
+SET(PKGCONFIG_DIR ${PROJECT_SOURCE_DIR}/pkgconfig)
+
+CONFIGURE_FILE(${PKGCONFIG_DIR}/wrt-core.pc.in
+    ${PKGCONFIG_DIR}/wrt-core.pc @ONLY)
+INSTALL(FILES ${PKGCONFIG_DIR}/wrt-core.pc DESTINATION lib/pkgconfig)
+
+IF(WITH_TESTS)
+    add_subdirectory(tests)
+ENDIF(WITH_TESTS)
diff --git a/DESCRIPTION b/DESCRIPTION
new file mode 100644 (file)
index 0000000..68aa8f4
--- /dev/null
@@ -0,0 +1 @@
+Main package folder
diff --git a/LICENSE.APLv2 b/LICENSE.APLv2
new file mode 100644 (file)
index 0000000..247c97d
--- /dev/null
@@ -0,0 +1,203 @@
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/LICENSE.Flora b/LICENSE.Flora
new file mode 100644 (file)
index 0000000..4a0af40
--- /dev/null
@@ -0,0 +1,206 @@
+Flora License
+
+Version 1.1, April, 2013
+
+http://floralicense.org/license/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by
+the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and
+all other entities that control, are controlled by, or are
+under common control with that entity. For the purposes of
+this definition, "control" means (i) the power, direct or indirect,
+to cause the direction or management of such entity,
+whether by contract or otherwise, or (ii) ownership of fifty percent (50%)
+or more of the outstanding shares, or (iii) beneficial ownership of
+such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity
+exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical
+transformation or translation of a Source form, including but
+not limited to compiled object code, generated documentation,
+and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form,
+made available under the License, as indicated by a copyright notice
+that is included in or attached to the work (an example is provided
+in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this License,
+Derivative Works shall not include works that remain separable from,
+or merely link (or bind by name) to the interfaces of, the Work and
+Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original
+version of the Work and any modifications or additions to that Work or
+Derivative Works thereof, that is intentionally submitted to Licensor
+for inclusion in the Work by the copyright owner or by an individual or
+Legal Entity authorized to submit on behalf of the copyright owner.
+For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or
+its representatives, including but not limited to communication on
+electronic mailing lists, source code control systems, and issue
+tracking systems that are managed by, or on behalf of, the Licensor
+for the purpose of discussing and improving the Work, but excluding
+communication that is conspicuously marked or otherwise designated
+in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+"Tizen Certified Platform" shall mean a software platform that complies
+with the standards set forth in the Tizen Compliance Specification
+and passes the Tizen Compliance Tests as defined from time to time
+by the Tizen Technical Steering Group and certified by the Tizen
+Association or its designated agent.
+
+2. Grant of Copyright License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the
+Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.  Subject to the terms and conditions of
+this License, each Contributor hereby grants to You a perpetual,
+worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+(except as stated in this section) patent license to make, have made,
+use, offer to sell, sell, import, and otherwise transfer the Work
+solely as incorporated into a Tizen Certified Platform, where such
+license applies only to those patent claims licensable by such
+Contributor that are necessarily infringed by their Contribution(s)
+alone or by combination of their Contribution(s) with the Work solely
+as incorporated into a Tizen Certified Platform to which such
+Contribution(s) was submitted. If You institute patent litigation
+against any entity (including a cross-claim or counterclaim
+in a lawsuit) alleging that the Work or a Contribution incorporated
+within the Work constitutes direct or contributory patent infringement,
+then any patent licenses granted to You under this License for that
+Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution.  You may reproduce and distribute copies of the
+Work or Derivative Works thereof pursuant to the copyright license
+above, in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+  1. You must give any other recipients of the Work or Derivative Works
+     a copy of this License; and
+  2. You must cause any modified files to carry prominent notices stating
+     that You changed the files; and
+  3. You must retain, in the Source form of any Derivative Works that
+     You distribute, all copyright, patent, trademark, and attribution
+     notices from the Source form of the Work, excluding those notices
+     that do not pertain to any part of the Derivative Works; and
+  4. If the Work includes a "NOTICE" text file as part of its distribution,
+     then any Derivative Works that You distribute must include a readable
+     copy of the attribution notices contained within such NOTICE file,
+     excluding those notices that do not pertain to any part of
+     the Derivative Works, in at least one of the following places:
+     within a NOTICE text file distributed as part of the Derivative Works;
+     within the Source form or documentation, if provided along with the
+     Derivative Works; or, within a display generated by the Derivative Works,
+     if and wherever such third-party notices normally appear.
+     The contents of the NOTICE file are for informational purposes only
+     and do not modify the License. You may add Your own attribution notices
+     within Derivative Works that You distribute, alongside or as an addendum
+     to the NOTICE text from the Work, provided that such additional attribution
+     notices cannot be construed as modifying the License. You may add Your own
+     copyright statement to Your modifications and may provide additional or
+     different license terms and conditions for use, reproduction, or
+     distribution of Your modifications, or for any such Derivative Works
+     as a whole, provided Your use, reproduction, and distribution of
+     the Work otherwise complies with the conditions stated in this License
+     and your own copyright statement or terms and conditions do not conflict
+     the conditions stated in the License including section 3.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+any Contribution intentionally submitted for inclusion in the Work
+by You to the Licensor shall be under the terms and conditions of
+this License, without any additional terms or conditions.
+Notwithstanding the above, nothing herein shall supersede or modify
+the terms of any separate license agreement you may have executed
+with Licensor regarding such Contributions.
+
+6. Trademarks.  This License does not grant permission to use the trade
+names, trademarks, service marks, or product names of the Licensor,
+except as required for reasonable and customary use in describing the
+origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+agreed to in writing, Licensor provides the Work (and each
+Contributor provides its Contributions) on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+implied, including, without limitation, any warranties or conditions
+of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any
+risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+whether in tort (including negligence), contract, or otherwise,
+unless required by applicable law (such as deliberate and grossly
+negligent acts) or agreed to in writing, shall any Contributor be
+liable to You for damages, including any direct, indirect, special,
+incidental, or consequential damages of any character arising as a
+result of this License or out of the use or inability to use the
+Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all
+other commercial damages or losses), even if such Contributor
+has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+the Work or Derivative Works thereof, You may choose to offer,
+and charge a fee for, acceptance of support, warranty, indemnity,
+or other liability obligations and/or rights consistent with this
+License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf
+of any other Contributor, and only if You agree to indemnify,
+defend, and hold each Contributor harmless for any liability
+incurred by, or claims asserted against, such Contributor by reason
+of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Flora License to your work
+
+To apply the Flora License to your work, attach the following
+boilerplate notice, with the fields enclosed by brackets "[]"
+replaced with your own identifying information. (Don't include
+the brackets!) The text should be enclosed in the appropriate
+comment syntax for the file format. We also recommend that a
+file or class name and description of purpose be included on the
+same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Flora License, Version 1.1 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://floralicense.org/license/
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..ded3804
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1 @@
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
\ No newline at end of file
diff --git a/README b/README
new file mode 100755 (executable)
index 0000000..cc937dc
--- /dev/null
+++ b/README
@@ -0,0 +1,39 @@
+README file for WARP PATENT ISSUE\r
+\r
+The files below have been implemented in compliance with  W3C WARP SPEC.\r
\r
+src/domain/efl/view_logic.cpp\r
+src/domain/warp_iri.cpp\r
+src/domain/widget_data_types.h\r
+tests/warp_tests/TestCases.cpp\r
+tests/warp_tests/WarpIriTestBase.cpp\r
+\r
+There are some patent issue between  W3C WARP SPEC and  APPPLE.\r
+If you want to use this files, refer to the W3C Notices.\r
+\r
+[W3C Notice]\r
+http://www.w3.org/2010/12/cfpa\r
+refer to the WARP_Widgets_Access Request Policy_PAG Report_49839.pdf  in root directory or http://www.w3.org/2009/11/widgets-pag/pagreport\r
+\r
+\r
+W3C's Disclaimer\r
+--------------------------------------------------------------------------------------------------------------------------------------\r
+Although portions of this PAG analysis were drafted by attorneys following review of the facts,\r
+none of the authors is your attorney. No part of this report is intended as legal advice either to W3C or to its members.\r
+It is intended merely as a summary of what the PAG has learned to date.\r
+Rely on this report entirely at your own risk. However, nothing should prevent even\r
+an attorney from expressing his or her personal opinions, and so this analysis includes the personal opinions of the authors.\r
+\r
+With respect to W3C, the publication of the WARP Candidate Recommendation would not, by itself, be patent infringement\r
+of any patents owned by Apple or anyone else. Implementers and distributors of software products,\r
+though, are encouraged to read the analysis below, consult with their own attorneys, and form their own conclusions.\r
+\r
+THESE RECOMMENDATIONS OF THE PATENT ADVISORY GROUP ARE NOT LEGAL ADVICE.\r
+NEITHER W3C NOR ANY OF THE PARTICIPANTS OF THE WIDGET UPDATES PATENT ADVISORY GROUP\r
+OR THEIR RESPECTIVE EMPLOYERS TAKES ANY RESPONSIBILITY FOR THE ACCURACY, LEGAL CORRECTNESS\r
+OR OTHER FITNESS FOR ANY PURPOSE OF THE INFORMATION PROVIDED IN THIS REPORT. ESPECIALLY,\r
+NEITHER W3C NOR ANY OF THE PARTICIPANTS OF THE WIDGET UPDATES PATENT ADVISORY GROUP\r
+OR ANY OF THEIR RESPECTIVE EMPLOYERS MAKE ANY REPRESENTATION THAT FOLLOWING THE RECOMMENDATIONS\r
+HERE WILL AVOID AN INFRINGEMENT OF THE US PATENT NR. 7,743,336 OR ANY OTHER PATENT MENTIONED\r
+ IN THE REPORT OR THE PAGE ON PRIOR ART.\r
+--------------------------------------------------------------------------------------------------------------------------------------\r
diff --git a/WARP_Widgets_Access Request Policy_PAG Report_49839.pdf b/WARP_Widgets_Access Request Policy_PAG Report_49839.pdf
new file mode 100644 (file)
index 0000000..c38b56b
Binary files /dev/null and b/WARP_Widgets_Access Request Policy_PAG Report_49839.pdf differ
diff --git a/build/Options.cmake b/build/Options.cmake
new file mode 100644 (file)
index 0000000..e54748b
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+#
+# @file        Options.cmake
+# @author      Jihoon Chung (jihoon.chung@samsung.com)
+#
+
+# Macro declaration
+#  - WRT_OPTION() : Wrapper omitting description argument from OPTION() command.
+MACRO(WRT_OPTION feature_name on_off)
+    OPTION(${feature_name} "" ${on_off})
+ENDMACRO(WRT_OPTION)
+
+# Use Feature
+#   Use a particular optional platform service or third-party library
+#
+# Description : <text>
+#               <text>
+# Author : <text>(<email>) - <date>
+# WRT_OPTION(<REPOSITORY_NAME>_USE_<FEATURE_NAME> ON/OFF)
+WRT_OPTION(WRT_USE_WEBKIT_UPVERSION OFF)
+
+# Enable Feature
+#   Turn on a specific feature of WRT
+#
+# Description : <text>
+#               <text>
+# Author : <text>(<email>) - <date>
+# WRT_OPTION(<REPOSITORY_NAME>_ENABLE_<FEATURE_NAME> ON/OFF)
+
+# Description : Enabling background decryption for encrypted resources
+# Author : Tomasz Iwanek(t.iwanek@samsung.com) - 16.12.2013
+WRT_OPTION(WRT_ENABLE_BACKGROUND_THREAD_DECRYPTION OFF)
+
+# Description : Support pre-launching webapp mode
+# Author : Tae-Jeong Lee (taejeong.lee@samsung.com) - 12.04.2013
+WRT_OPTION(WRT_ENABLE_PRE_LAUNCH OFF)
+
+# Description : Enabling one UI process model
+#               Combine all UI process into the wrt-launchpad-daemon to enhance memory usage of web app
+# Author : Jihoon Chung (jihoon.chung@samsung.com) - 14.08.2014
+IF(PRODUCT_FEATURE_WRT_LITE)
+    WRT_OPTION(WRT_ENABLE_ONE_UI_PROCESS_MODEL OFF)
+ELSE(PRODUCT_FEATURE_WRT_LITE)
+    WRT_OPTION(WRT_ENABLE_ONE_UI_PROCESS_MODEL OFF)
+ENDIF(PRODUCT_FEATURE_WRT_LITE)
diff --git a/data/DESCRIPTION b/data/DESCRIPTION
new file mode 100644 (file)
index 0000000..daacea4
--- /dev/null
@@ -0,0 +1,8 @@
+!!!options!!! stop
+Data files (edc, icons, certificates, UAP)
+Various data files:
+    - edc layouts
+    - icons etc
+    - certificates
+    - User Agent Profile data (XML)
+
diff --git a/data/Wrt.edc b/data/Wrt.edc
new file mode 100644 (file)
index 0000000..c3a735c
--- /dev/null
@@ -0,0 +1,380 @@
+collections {
+#if defined(TIZEN_LITE)
+    base_scale: 1.8;
+#else
+    base_scale: 2.4;
+#endif
+    group {
+        name: "web-application";
+        parts {
+            part {
+                name: "base";
+                scale: 1;
+                type: RECT;
+                description {
+                    state: "default" 0.0;
+                    fixed: 1 1;
+                    rel1 { relative: 0 0; offset: 0 0; }
+                    rel2 { relative: 1 1; offset: -1 -1; }
+                    color: 255 255 255 255;
+                }
+                description {
+                    state: "transparent" 0.0;
+                    inherit: "default" 0.0;
+                    color: 0 0 0 0;
+                }
+            }
+            part {
+                name: "elm.swallow.content";
+                scale: 1;
+                type: SWALLOW;
+                description {
+                    state: "default" 0.0;
+                    fixed: 1 1;
+                    rel1 { relative: 0.0 0.0; to: base; }
+                    rel2 { relative: 1.0 1.0; to: base; }
+                    align: 0.0 0.0;
+                }
+            }
+            part {
+                name: "elm.swallow.progress";
+                scale: 1;
+                type: SWALLOW;
+                description {
+                    state: "default" 0.0;
+                    visible: 0;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 0.0; }
+                    rel2 { relative: 1.0 0.0; }
+                    align: 0.5 0.0;
+                }
+                description {
+                    state: "visible" 0.0;
+                    inherit: "default" 0.0;
+                    visible: 1;
+                }
+            }
+        }//end of parts
+        programs {
+            program { name: "show,progress";
+                signal: "show,progress,signal";
+                action: STATE_SET "visible" 0.0;
+                target: "elm.swallow.progress";
+            }
+            program { name: "hide,progress";
+                signal: "hide,progress,signal";
+                action: STATE_SET "default" 0.0;
+                target: "elm.swallow.progress";
+            }
+            program { name: "show,transparent";
+                signal: "show,transparent,signal";
+                action: STATE_SET "transparent" 0.0;
+                target: "base";
+            }
+            program { name: "hide,transparent";
+                signal: "hide,transparent,signal";
+                action: STATE_SET "default" 0.0;
+                target: "base";
+            }
+        }//end of programs
+    }//end of group
+
+    group {
+        name: "popupWithCheck";
+        parts {
+            part {
+                name: "pad_t";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.5 0.0;
+                    min: 0 32;
+                    fixed: 0 1;
+                    rel1 { relative: 1.0 0.0;to_x: "pad_l"; }
+                    rel2 { relative: 0.0 0.0;to_x: "pad_r"; }
+                }
+            }
+            part {
+                name: "pad_l";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    min: 26 0;
+                    max: 26 0;
+                    fixed: 1 0;
+                    rel1 { relative: 0.0 0.0; }
+                    rel2 { relative: 0.0 1.0; }
+                    align: 0.0 0.0;
+                }
+            }
+            part {
+                name: "pad_r";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    min: 26 0;
+                    max: 26 0;
+                    fixed: 1 0;
+                    rel1 { relative: 1.0 0.0; }
+                    rel2 { relative: 1.0 1.0; }
+                    align: 1.0 0.0;
+                }
+            }
+            part {
+                name:"elm.swallow.label";
+                type: SWALLOW;
+                scale : 1;
+                description {
+                    state: "default" 0.0;
+                    fixed: 1 0;
+                    rel1 {
+                        relative: 1.0 1.0;
+                        to_x: "pad_l";
+                        to_y: "pad_t";
+                    }
+                    rel2 {
+                        relative: 0.0 0.0;
+                        to_x: "pad_r";
+                        to_y: "pad_b";
+                    }
+                }
+            }
+            part {
+                name: "bottom_pad";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 1.0;
+                    min: 0 32;
+                    fixed: 0 1;
+                    rel1 { relative: 1.0 1.0; to_x: "pad_l"; }
+                    rel2 { relative: 0.0 1.0; to_x: "pad_r"; }
+                }
+            }
+            part {
+                name: "pad_b";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 1.0;
+                    min: 0 84;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 0.0; to: "bottom_pad"; }
+                    rel2 { relative: 1.0 0.0; to: "bottom_pad"; }
+                }
+            }
+            part {
+                name: "end_field";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 1.0;
+                    min: 0 63;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 1.0; to: "pad_b"; }
+                    rel2 { relative: 1.0 1.0; to: "pad_b"; }
+                }
+            }
+            part {
+                name: "elm.swallow.checkbox";
+                type: SWALLOW;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    fixed: 1 1;
+                    align: 0.0 0.5;
+                    rel1.to: "end_field";
+                    rel2.to: "end_field";
+                }
+            }
+        } //end of parts
+    } //end of group
+
+    group {
+        name: "authChallengePopup";
+        parts {
+            part {
+                name: "pad_t";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.5 0.0;
+                    min: 0 32;
+                    fixed: 0 1;
+                    rel1 { relative: 1.0 0.0;to_x: "pad_l"; }
+                    rel2 { relative: 0.0 0.0;to_x: "pad_r"; }
+                }
+            }
+            part {
+                name: "pad_l";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    min: 26 0;
+                    max: 26 0;
+                    fixed: 1 0;
+                    rel1 { relative: 0.0 0.0; }
+                    rel2 { relative: 0.0 1.0; }
+                    align: 0.0 0.0;
+                }
+            }
+            part {
+                name: "pad_r";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    min: 26 0;
+                    max: 26 0;
+                    fixed: 1 0;
+                    rel1 { relative: 1.0 0.0; }
+                    rel2 { relative: 1.0 1.0; }
+                    align: 1.0 0.0;
+                }
+            }
+            part {
+                name:"elm.swallow.label";
+                type: SWALLOW;
+                scale : 1;
+                description {
+                    state: "default" 0.0;
+                    fixed: 1 0;
+                    rel1 {
+                        relative: 1.0 1.0;
+                        to_x: "pad_l";
+                        to_y: "pad_t";
+                    }
+                    rel2 {
+                        relative: 0.0 0.0;
+                        to_x: "pad_r";
+                        to_y: "pad_b";
+                    }
+                }
+            }
+            part {
+                name: "bottom_pad";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 1.0;
+                    min: 0 32;
+                    fixed: 0 1;
+                    rel1 { relative: 1.0 1.0; to_x: "pad_l"; }
+                    rel2 { relative: 0.0 1.0; to_x: "pad_r"; }
+                }
+            }
+            part {
+                name: "pad_b";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 1.0;
+                    min: 0 200;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 0.1; to: "bottom_pad"; }
+                    rel2 { relative: 1.0 0.1; to: "bottom_pad"; }
+                }
+            }
+            part {
+                name: "pad_m1";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 1.0;
+                    min: 0 32;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 0.0; to: "pad_b"; }
+                    rel2 { relative: 1.0 0.0; to: "pad_b"; }
+                }
+            }
+            part{
+                name:"elm.swallow.idtext";
+                type: TEXT;
+                scale : 1;
+                description {
+                    state: "default" 0.0;
+                    color: 168 168 168 255;
+                    text {
+                        font: "Tizen:style=Medium";
+                        size: 35;
+                        align: 0.0 0.5;
+                    }
+                    align: 0.0 0.0;
+                    min: 0 40;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 1.0; to: "pad_m1"; }
+                    rel2 { relative: 1.0 1.0; to: "pad_m1"; }
+                }
+            }
+            part {
+                name: "elm.swallow.idfield";
+                type: SWALLOW;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 0.0;
+                    min: 0 63;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 1.0; to: "elm.swallow.idtext"; }
+                    rel2 { relative: 1.0 1.0; to: "elm.swallow.idtext"; }
+                }
+            }
+            part {
+                name: "pad_m2";
+                type: SPACER;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 1.0;
+                    min: 0 32;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 1.0; to: "elm.swallow.idfield"; }
+                    rel2 { relative: 1.0 1.0; to: "elm.swallow.idfield"; }
+                }
+            }
+            part{
+                name:"elm.swallow.pwtext";
+                type: TEXT;
+                scale : 1;
+                description {
+                    state: "default" 0.0;
+                    color: 168 168 168 255;
+                    text {
+                        font: "Tizen:style=Medium";
+                        size: 35;
+                        align: 0.0 0.5;
+                    }
+                    align: 0.0 0.0;
+                    min: 0 40;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 1.0; to: "pad_m2"; }
+                    rel2 { relative: 1.0 1.0; to: "pad_m2"; }
+                }
+            }
+            part {
+                name: "elm.swallow.pwfield";
+                type: SWALLOW;
+                scale: 1;
+                description {
+                    state: "default" 0.0;
+                    align: 0.0 0.0;
+                    min: 0 63;
+                    fixed: 0 1;
+                    rel1 { relative: 0.0 1.0; to: "elm.swallow.pwtext"; }
+                    rel2 { relative: 1.0 1.0; to: "elm.swallow.pwtext"; }
+                }
+            }
+        } //end of parts
+    }
+}//end of collection
diff --git a/data/generic_popup.edc b/data/generic_popup.edc
new file mode 100644 (file)
index 0000000..23d56e1
--- /dev/null
@@ -0,0 +1,181 @@
+#define MAIN_W      470
+#define MAIN_H      800
+
+#define TITLE_START_Y   72
+#define TITLE_H     90
+
+#define FULL_TRANS      0 0 0 0
+#define TXT_SIZE 14
+#define FONT_NAME "system_content"
+
+images {
+}
+
+collections
+group {
+
+    name: "popup_layout1";
+    parts {
+        part {
+            name: "pad_t";
+            scale : 1;
+            mouse_events: 0;
+            repeat_events: 1;
+
+            description {
+                state: "default" 0.0;
+                align: 0.5 0.0;
+                min: 0 2;
+                fixed: 0 1;
+                rel1 { relative: 1.0 0.0; to_x: "pad_l"; }
+                rel2 { relative: 0.0 0.0; to_x: "pad_r"; }
+            }
+        }
+        part {
+            name: "pad_l";
+            scale: 1;
+
+            description {
+                state: "default" 0.0;
+                min : 10 0;
+                fixed: 1 0;
+                rel1 { relative: 0.0 0.0; }
+                rel2 { relative: 0.0 1.0; }
+                align: 0.0 0.0;
+            }
+        }
+        part {
+            name: "pad_r";
+            scale: 1;
+
+            description {
+                state: "default" 0.0;
+                min : 10 0;
+                fixed: 1 0;
+                rel1 { relative: 1.0 0.0; }
+                rel2 { relative: 1.0 1.0; }
+                align: 1.0 0.0;
+            }
+        }
+        part {
+            name:"0";
+            type: SWALLOW;
+            scale : 1;
+
+            description {
+                state: "default" 0.0;
+                min: 380 0;
+                align: 0.5 0.5;
+                fixed: 1 0;
+                rel1 { relative: 0.5 1.0; to: "pad_t"; }
+                rel2 { relative: 0.5 0.0; to: "pad_b"; }
+            }
+        }
+        part {
+            name: "pad_b";
+            scale : 1;
+            mouse_events: 0;
+            repeat_events: 1;
+
+            description {
+                state: "default" 0.0;
+                align: 0.5 1.0;
+                min: 0 2;
+                fixed: 0 1;
+                rel1 { relative: 1.0 1.0;to_x: "pad_l"; }
+                rel2 { relative: 0.0 1.0;to_x: "pad_r"; }
+            }
+        }
+    }
+}
+
+group {
+    name: "popup_layout2";
+    parts {
+        part {
+            name: "pad_t";
+            scale : 1;
+            mouse_events: 0;
+            repeat_events: 1;
+
+            description {
+                state: "default" 0.0;
+                align: 0.5 0.0;
+                min: 0 14;
+                fixed: 0 1;
+                rel1 { relative: 1.0 0.0; to_x: "pad_l"; }
+                rel2 { relative: 0.0 0.0; to_x: "pad_r"; }
+            }
+        }
+        part {
+            name: "pad_l";
+            scale: 1;
+
+            description {
+                state: "default" 0.0;
+                min : 10 0;
+                fixed: 1 0;
+                rel1 { relative: 0.0 0.0; }
+                rel2 { relative: 0.0 1.0; }
+                align: 0.0 0.0;
+            }
+        }
+        part {
+            name: "pad_r";
+            scale: 1;
+
+            description {
+                state: "default" 0.0;
+                min : 10 0;
+                fixed: 1 0;
+                rel1 { relative: 1.0 0.0; }
+                rel2 { relative: 1.0 1.0; }
+                align: 1.0 0.0;
+            }
+        }
+        part {
+            name:"0";
+            type: SWALLOW;
+            scale : 1;
+
+            description {
+                state: "default" 0.0;
+                min: 380 0;
+                align: 0.5 0.5;
+                fixed: 1 0;
+                rel1 { relative: 0.5 1.0; to: "pad_t"; }
+                rel2 { relative: 0.5 0.0; to: "pad_b"; }
+            }
+        }
+        part {
+            name: "pad_b";
+            scale : 1;
+            mouse_events: 0;
+            repeat_events: 1;
+
+            description {
+                state: "default" 0.0;
+                align: 0.5 1.0;
+                min: 0 66;
+                fixed: 0 1;
+                rel1 { relative: 1.0 1.0; to_x: "pad_l"; }
+                rel2 { relative: 0.0 1.0; to_x: "pad_r"; }
+            }
+        }
+        part {
+            name: "1";
+            type: SWALLOW;
+            scale : 1;
+            mouse_events: 1;
+            repeat_events: 1;
+
+            description {
+                state: "default" 0.0;
+                align: 0.5 0.5;
+                fixed: 1 1;
+                rel1 { relative: 0.0 0.0; to: "pad_b"; }
+                rel2 { relative: 1.0 1.0; to: "pad_b"; }
+            }
+        }
+    } // parts
+} // group
diff --git a/data/generic_popup_horizontal.edc b/data/generic_popup_horizontal.edc
new file mode 100644 (file)
index 0000000..801eef0
--- /dev/null
@@ -0,0 +1,52 @@
+#define MAIN_W      470
+#define MAIN_H      800
+
+#define TITLE_START_Y   72
+#define TITLE_H     90
+
+#define FULL_TRANS      0 0 0 0
+#define TXT_SIZE 14
+#define FONT_NAME "system_content"
+
+images {
+}
+
+collections
+        group {
+        name: "popup_h";
+
+    #define BUTTON_WIDTH 200.0
+    #define BUTTON_HEIGHT 78.0
+    #define BUTTON_GAP 50.0
+    #define PART_MAX 5000
+    parts{
+    part {
+            name: "0";
+            type: SWALLOW;
+            scale: 1;
+
+            description {
+            state: "default" 0.0;
+
+                fixed: 1 1;
+                rel1 { relative: 0.1 0.0; }
+                rel2 { relative: 0.5 0.9; }
+            }
+        }
+
+        part {
+            name: "1";
+            type: SWALLOW;
+            scale: 1;
+
+            description {
+
+                fixed: 1 1;
+                rel1 { relative: 0.5 0.0;  }
+                rel2 { relative: 0.9 0.9;   }
+            }
+        }
+     }
+   }
+
+}
diff --git a/dir-struct.py b/dir-struct.py
new file mode 100755 (executable)
index 0000000..910f153
--- /dev/null
@@ -0,0 +1,140 @@
+#!/usr/bin/env python
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+import os
+import re
+
+
+def countLines(path):
+    with open(path) as f:
+        return len(f.readlines())
+
+# RETURNS: (
+#    short description (string or None)
+#    long decsription (array of strings or None)
+#    options: stop
+def parseDescr(lines):
+    if len(lines) == 0:
+        return (None, None, False)
+    linesRest = None
+    if re.match( r"!!!options!!!", lines[0] ):
+        optStop = True
+        linesRest = lines[1:]
+    else:
+        optStop = False
+        linesRest = lines
+    if len(linesRest) == 0:
+        return(None,None,optStop)
+    short = linesRest[0].rstrip()
+    long = []
+    for l in linesRest[1:]:
+        ll = l.rstrip()
+        if re.search( r"\S", ll ):
+            long.append( ll )
+    if len(long) == 0:
+        long = None
+
+    return (short, long, optStop)
+
+# RETURNS a tree with nodes like: (
+#    path (string)
+#    short description (string or None)
+#    long decsription (array of strings or None)
+#    LOC (integer)
+#    list of subdirs (child nodes like this one)
+def parseDir(path):
+    short = None
+    long = None
+    optStop = False
+    try:
+        with open( path+'/DESCRIPTION' ) as f:
+            short, long, optStop = parseDescr( f.readlines() )
+    except IOError:
+        pass
+    dirs = []
+    cntLines = 0
+    for fname in os.listdir(path):
+        if fname != '.git' and os.path.isdir(path+'/'+fname):
+            subdir = parseDir(path+'/'+fname)
+            if optStop == False:
+                dirs.append(subdir)
+            (dummy0, dummy1, dummy2, subLines, dummy4) = subdir
+            cntLines += subLines
+  
+        if os.path.isfile(path+'/'+fname) \
+        and not os.path.islink(path+'/'+fname):
+            cntLines += countLines(path+'/'+fname)
+
+    return path, short, long, cntLines, dirs
+
+
+###     ##### PRINT AS TEXT
+###     
+###     def printTextSub(path,indent,withLongDesc):
+###         short, long, dirs, loc = parseDir(path)
+###         if short == None: 
+###             p = re.sub(r"^\./", '', path)
+###             print '%s%s -- ' % (indent, p)
+###         else:
+###             p = re.sub(r"^\./", '', path)
+###             print '%s%s -- %s' % (indent, p, short)
+###         if withLongDesc:
+###             if long != None:
+###                 print ''
+###                 for line in long:
+###                     print '%s%s' % (indent+'    ',line)
+###                 print ''
+###         for dir in dirs:
+###             printTextSub(path+'/'+dir, indent+'    ', withLongDesc)
+###     
+###     def printText(path,withLongDesc):
+###         printTextSub(path,'',withLongDesc)
+###     
+###     def printTextWoMain(path,withLongDesc):
+###         short, long, dirs, loc = parseDir(path)
+###         for dir in dirs:
+###             printTextSub(path+'/'+dir, '', withLongDesc)
+###     
+
+##### PRINT AS a sort of CSV delimited by '|'
+
+# indent is a number (0..)
+def printTabSub(tree,indent):
+    path, short, long, loc, subdirs = tree 
+    p = re.sub(r"^\./", '', path)
+    m = re.search(r"/([^/]*$)", p)
+    if m != None: p = m.groups()[0]
+    if short == None: 
+        print '%s%s|%d|' % ("        "*indent, p, loc)
+    else:
+        print '%s%s|%d|%s' % ("        "*indent, p, loc, short)
+    for dir in subdirs:
+        printTabSub(dir, indent+1)
+
+def printTab(tree):
+    printTabSub(tree,0)
+
+def printTabWoMain(tree):
+    path, short, long, loc, dirs = tree
+    for dir in dirs:
+        printTabSub(dir, 0)
+
+
+##### MAIN
+
+tree = parseDir('.')
+printTabWoMain(tree)
+
diff --git a/doxyfile b/doxyfile
new file mode 100644 (file)
index 0000000..f7d6c5d
--- /dev/null
+++ b/doxyfile
@@ -0,0 +1,1600 @@
+# Doxyfile 1.6.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file 
+# that follow. The default is UTF-8 which is also the encoding used for all 
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
+# iconv built into libc) for the transcoding. See 
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = WRT-Engine
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 1.0
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = ./Documentation
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = YES
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, 
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like regular Qt-style comments 
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
+# interpret the first line (until the first dot) of a Qt-style 
+# comment as the brief description. If set to NO, the comments 
+# will behave just like regular Qt-style comments (thus requiring 
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Java. For instance, namespaces will be presented as packages, qualified 
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
+# sources. Doxygen will then generate output that is tailored for 
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it parses. 
+# With this tag you can assign which parser to use for a given extension. 
+# Doxygen has a built-in mapping, but you can override or extend it using this tag. 
+# The format is ext=language, where ext is a file extension, and language is one of 
+# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 
+# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 
+# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 
+# use: inc=Fortran f=C. Note that for custom extensions you also need to set
+# FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      = 
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
+# to include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to 
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
+# Doxygen will parse them like normal C++ but will assume all classes use public 
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter 
+# and setter methods for a property. Setting this option to YES (the default) 
+# will make doxygen to replace the get and set methods by a property in the 
+# documentation. This will only work if the methods are indeed getting or 
+# setting a simple type. If this is not the case, or you want to show the 
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
+# is documented as struct, union, or enum with the name of the typedef. So 
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
+# with name TypeT. When disabled the typedef will appear as a member of a file, 
+# namespace, or class. And the struct will be named TypeS. This can typically 
+# be useful for C code in case the coding convention dictates that all compound 
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 
+# determine which symbols to keep in memory and which to flush to disk. 
+# When the cache is full, less often used symbols will be written to disk. 
+# For small to medium size projects (<1000 input files) the default value is 
+# probably good enough. For larger projects a too small cache size can cause 
+# doxygen to be busy swapping symbols to and from disk most of the time 
+# causing a significant performance penality. 
+# If the system has enough physical memory increasing the cache will improve the 
+# performance by keeping more symbols in memory. Note that the value works on 
+# a logarithmic scale so increasing the size by one will rougly double the 
+# memory usage. The cache size is given by this formula: 
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be 
+# extracted and appear in the documentation as a namespace called 
+# 'anonymous_namespace{file}', where file will be replaced with the base 
+# name of the file that contains the anonymous namespace. By default 
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen 
+# will list include files with double quotes in the documentation 
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
+# hierarchy of group names into alphabetical order. If set to NO (the default) 
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
+# This will remove the Files entry from the Quick Index and from the 
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
+# Namespaces page.  This will remove the Namespaces entry from the Quick Index 
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from 
+# the version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 
+# doxygen. The layout file controls the global structure of the generated output files 
+# in an output format independent way. The create the layout file that represents 
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a 
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name 
+# of the layout file.
+
+LAYOUT_FILE            = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = ./src/
+
+# This tag can be used to specify the character encoding of the source files 
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
+# also the default input encoding. Doxygen uses libiconv (or the iconv built 
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cxx \
+                         *.cpp \
+                         *.c++ \
+                         *.d \
+                         *.java \
+                         *.ii \
+                         *.ixx \
+                         *.ipp \
+                         *.i++ \
+                         *.inl \
+                         *.h \
+                         *.hh \
+                         *.hxx \
+                         *.hpp \
+                         *.h++ \
+                         *.idl \
+                         *.odl \
+                         *.cs \
+                         *.php \
+                         *.php3 \
+                         *.inc \
+                         *.m \
+                         *.mm \
+                         *.dox \
+                         *.py \
+                         *.f90 \
+                         *.f \
+                         *.vhd \
+                         *.vhdl
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the 
+# output. The symbol name can be a fully qualified name, a word, or if the 
+# wildcard * is used, a substring. Examples: ANamespace, AClass, 
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 
+# link to the source code.  Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 
+# page will contain the date and time when the page was generated. Setting 
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = NO
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
+# documentation will contain sections that can be hidden and shown after the 
+# page has loaded. For this to work a browser that supports 
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files 
+# will be generated that can be used as input for Apple's Xcode 3 
+# integrated development environment, introduced with OSX 10.5 (Leopard). 
+# To create a documentation set, doxygen will generate a Makefile in the 
+# HTML output directory. Running make will produce the docset in that 
+# directory and running "make install" will install the docset in 
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
+# it at startup. 
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
+# feed. A documentation feed provides an umbrella under which multiple 
+# documentation sets from a single provider (such as a company or product suite) 
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
+# should uniquely identify the documentation set bundle. This should be a 
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file 
+# content.
+
+CHM_INDEX_ENCODING     = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 
+# are set, an additional index file will be generated that can be used as input for 
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 
+# HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
+# be used to specify the file name of the resulting .qch file. 
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               = 
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 
+# For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   = 
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  = 
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 
+# filter section matches. 
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  = 
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
+# be used to specify the location of Qt's qhelpgenerator. 
+# If non-empty doxygen will try to run qhelpgenerator on the generated 
+# .qhp file.
+
+QHG_LOCATION           = 
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  
+# will be generated, which together with the HTML files, form an Eclipse help  
+# plugin. To install this plugin and make it available under the help contents 
+# menu in Eclipse, the contents of the directory containing the HTML and XML 
+# files needs to be copied into the plugins directory of eclipse. The name of 
+# the directory within the plugins directory should be the same as 
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin 
+# the directory name containing the HTML and XML files should also have 
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 
+# structure should be generated to display hierarchical information. 
+# If the tag value is set to YES, a side panel will be generated 
+# containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, 
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# Use this tag to change the font size of Latex formulas included 
+# as images in the HTML documentation. The default is 10. Note that 
+# when you change the font size after a successful doxygen run you need 
+# to manually remove any form_*.png images from the HTML output directory 
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript 
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should 
+# typically be disabled. For large projects the javascript based search engine 
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index 
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvances is that it is more difficult to setup 
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name. 
+# Note that when enabling USE_PDFLATEX this option is only used for 
+# generating bitmaps for formulas in the HTML output, but not in the 
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links. 
+# Note that each tag file must have a unique name 
+# (where the name does NOT include the path) 
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see 
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
+# the mscgen tool resides. If left empty the tool is assumed to be found in the 
+# default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = YES
+
+# By default doxygen will write a font called FreeSans.ttf to the output 
+# directory and reference it in all dot files that doxygen generates. This 
+# font does not include all possible unicode characters however, so when you need 
+# these (or just want a differently looking font) you can specify the font name 
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font, 
+# which can be done by putting it in a standard location or by setting the 
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 
+# containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the output directory to look for the 
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a 
+# different font using DOT_FONTNAME you can set the path where dot 
+# can find it using this tag.
+
+DOT_FONTPATH           = 
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then 
+# doxygen will generate a call dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable call graphs 
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
+# doxygen will generate a caller dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable caller 
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include 
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif 
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen if the 
+# number of direct children of the root node in a graph is already larger than 
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that the size of a graph can be further restricted by 
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, because dot on Windows does not 
+# seem to support this out of the box. Warning: Depending on the platform used, 
+# enabling this option may lead to badly anti-aliased labels on the edges of 
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
diff --git a/packaging/wrt.spec b/packaging/wrt.spec
new file mode 100755 (executable)
index 0000000..ee87d2b
--- /dev/null
@@ -0,0 +1,185 @@
+#git:framework/web/wrt
+Name:       wrt
+Summary:    web runtime
+Version:    0.8.377
+Release:    1
+Group:      Development/Libraries
+License:    Apache-2.0 and Flora-1.1
+URL:        N/A
+Source0:    %{name}-%{version}.tar.gz
+
+BuildRequires:  boost
+BuildRequires:  cmake
+BuildRequires:  edje-tools
+BuildRequires:  gettext
+BuildRequires:  libcap-devel
+BuildRequires:  libss-client-devel
+BuildRequires:  pkgconfig(aul)
+BuildRequires:  pkgconfig(ail)
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(ewebkit2)
+BuildRequires:  pkgconfig(appcore-efl)
+BuildRequires:  pkgconfig(openssl)
+BuildRequires:  pkgconfig(dpl-efl)
+BuildRequires:  pkgconfig(libpcrecpp)
+BuildRequires:  pkgconfig(ecore)
+BuildRequires:  pkgconfig(eina)
+BuildRequires:  pkgconfig(ui-gadget-1)
+BuildRequires:  pkgconfig(utilX)
+BuildRequires:  pkgconfig(secure-storage)
+BuildRequires:  pkgconfig(pkgmgr)
+BuildRequires:  pkgconfig(libiri)
+BuildRequires:  pkgconfig(appsvc)
+BuildRequires:  pkgconfig(cert-svc)
+BuildRequires:  pkgconfig(cert-svc-vcore)
+BuildRequires:  pkgconfig(libsoup-2.4)
+BuildRequires:  pkgconfig(security-core)
+BuildRequires:  pkgconfig(security-client)
+BuildRequires:  pkgconfig(notification)
+BuildRequires:  pkgconfig(libprivilege-control)
+BuildRequires:  pkgconfig(capi-appfw-app-manager)
+BuildRequires:  pkgconfig(capi-appfw-application)
+BuildRequires:  pkgconfig(wrt-plugin-loading)
+BuildRequires:  pkgconfig(wrt-plugin-js-overlay)
+BuildRequires:  pkgconfig(wrt-plugins-ipc-message)
+BuildRequires:  pkgconfig(wrt-popup-wrt-runner)
+BuildRequires:  pkgconfig(wrt-popup-ace-runner)
+BuildRequires:  pkgconfig(deviced)
+BuildRequires:  pkgconfig(capi-system-system-settings)
+BuildRequires:  pkgconfig(libsmack)
+BuildRequires:  pkgconfig(efl-assist)
+BuildRequires:  pkgconfig(pkgmgr-info)
+BuildRequires:  pkgconfig(libcurl)
+BuildRequires:  pkgconfig(rua)
+BuildRequires:  pkgconfig(privacy-manager-client)
+Requires: boost-filesystem
+Requires: boost-system
+Requires: libss-client
+
+## wrt-launchpad-daemon #######################################################
+BuildRequires:  pkgconfig(app-checker)
+BuildRequires:  pkgconfig(bundle)
+BuildRequires:  pkgconfig(dlog)
+BuildRequires:  pkgconfig(dbus-glib-1)
+BuildRequires:  pkgconfig(libsmack)
+BuildRequires:  pkgconfig(sqlite3)
+BuildRequires:  pkgconfig(x11)
+BuildRequires:  pkgconfig(aul)
+BuildRequires:  pkgconfig(libsystemd-daemon)
+BuildRequires:  pkgconfig(xcomposite)
+%{?systemd_requires}
+
+#Use these macro to avoid hard-coded path
+#After upgrading systemd to v204 or higher macro can be deleted
+%define _unitdir /usr/lib/systemd/system
+###############################################################################
+
+%description
+web runtime
+
+%package devel
+Summary:  Wrt header files for external modules
+Group:    Development/Libraries
+Requires: %{name} = %{version}
+Requires: pkgconfig(ewebkit2)
+
+%description devel
+wrt library development headers
+
+%prep
+%setup -q
+
+%define with_tests 0
+%if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
+    %define with_tests 1
+%endif
+
+%build
+%if 0%{?sec_build_binary_debug_enable}
+export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
+export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+%endif
+
+export LDFLAGS+="-Wl,--rpath=/usr/lib"
+
+cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+        -DDPL_LOG="ON"                    \
+        -DPROJECT_VERSION=%{version} \
+        -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
+        -DPRODUCT_FEATURE_WRT_LITE="ON" \
+        %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
+make %{?jobs:-j%jobs}
+
+%install
+mkdir -p %{buildroot}/usr/share/license
+cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
+cat LICENSE.Flora >> %{buildroot}/usr/share/license/%{name}
+%make_install
+
+mkdir -p %{buildroot}%{_unitdir}/tizen-runtime.target.wants
+mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
+ln -s %{_unitdir}/wrt_launchpad_daemon@.service %{buildroot}%{_unitdir}/tizen-runtime.target.wants/wrt_launchpad_daemon@app.service
+ln -s %{_unitdir}/wrt_launchpad_daemon_1.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_1.socket
+ln -s %{_unitdir}/wrt_launchpad_daemon_2.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_2.socket
+
+%pre
+if [ $1 -eq 2 ] ; then
+    systemctl stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
+fi
+
+%preun
+if [ $1 -eq 0 ] ; then
+    systemctl stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
+fi
+
+%clean
+rm -rf %{buildroot}
+
+%post
+chmod +s /usr/bin/wrt-launcher
+
+/sbin/ldconfig
+systemctl daemon-reload
+if [ $1 -eq 2 ] ; then
+    systemctl start wrt_launchpad_daemon@app.service
+fi
+
+%postun -p /sbin/ldconfig
+systemctl daemon-reload
+
+%files
+%manifest wrt.manifest
+%{_libdir}/*.so
+%{_libdir}/*.so.*
+%attr(755,root,root) %{_bindir}/wrt-client
+%attr(755,root,root) %{_bindir}/wrt-launcher
+%attr(755,root,root) %{_bindir}/wrt_reset_all.sh
+%attr(755,root,root) %{_bindir}/wrt_reset_db.sh
+%{_datadir}/*
+%{_datadir}/license/%{name}
+%attr(644,root,root) %{_datadir}/edje/wrt/*
+%attr(644,root,root) %{_datadir}/edje/ace/*
+%if %{with_tests}
+    %attr(755,root,root) %{_bindir}/wrt-tests-general
+    /opt/share/widget/tests/general/*
+%endif
+%attr(755,root,root) %{_sysconfdir}/profile.d/wrt_env.sh
+
+## wrt-launchpad-daemon #######################################################
+%attr(755,root,root) %{_bindir}/wrt_launchpad_daemon
+/usr/share/aul/preload_list_wrt.txt
+/etc/smack/accesses.d/wrt_launchpad_daemon.rule
+#systemd
+%{_unitdir}/tizen-runtime.target.wants/wrt_launchpad_daemon@app.service
+%{_unitdir}/wrt_launchpad_daemon@.service
+%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_1.socket
+%{_unitdir}/wrt_launchpad_daemon_1.socket
+%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_2.socket
+%{_unitdir}/wrt_launchpad_daemon_2.socket
+###############################################################################
+
+%files devel
+%{_includedir}/*
+%{_libdir}/pkgconfig/*
+
diff --git a/pkgconfig/wrt-core.pc.in b/pkgconfig/wrt-core.pc.in
new file mode 100644 (file)
index 0000000..8436f7e
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=/usr
+project_name=@CMAKE_PROJECT_NAME@
+exec_prefix=${prefix}
+libdir=${prefix}/lib/
+includedir=${prefix}/include/${project_name}
+
+Name: WebRuntime wrt core module
+Description: WebRuntime core module
+Version: @CMAKE_PROJECT_VERSION@
+Requires:
+Libs: -L${libdir} -lwrt-core-module
+Cflags: -I${includedir}
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..09c3dca
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+SET(POFILES
+ar.po  ca.po  de_DE.po  en.po     es_MX.po  fi.po     ga.po  hr.po  is.po     ka.po     lt.po  nb.po     pt_BR.po  ru_RU.po  sr.po     uk.po     zh_HK.po
+az.po  cs.po  el_GR.po  en_US.po  et.po     fr_CA.po  gl.po  hu.po  it_IT.po  kk.po     lv.po  nl_NL.po  pt_PT.po  sk.po     sv.po     uz.po     zh_SG.po
+bg.po  da.po  en_PH.po  es_ES.po  eu.po     fr_FR.po  hi.po  hy.po  ja_JP.po  ko_KR.po  mk.po  pl.po     ro.po     sl.po     tr_TR.po  zh_CN.po  zh_TW.po
+bn.po  gu.po  mn_MN.po  kn.po     ml.po     mr.po     or.po  pa.po  si.po     ta.po     te.po  ur.po     id.po     es_US.po  km.po     lo.po     ms.po
+my.po  th.po  tl.po     vi.po     ne.po
+)
+
+SET(MSGFMT "/usr/bin/msgfmt")
+SET(LOCALE_DIR "/usr/share/locale/")
+
+FOREACH(pofile ${POFILES})
+       SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+       MESSAGE("PO: ${pofile}")
+       GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+       GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+       SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+        ADD_CUSTOM_COMMAND( OUTPUT ${moFile}
+            COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+            DEPENDS ${absPofile} )
+        INSTALL(FILES ${moFile}
+            DESTINATION ${LOCALE_DIR}/${lang}/LC_MESSAGES
+            RENAME  ${PROJECT_NAME}.mo)
+        SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
diff --git a/po/ar.po b/po/ar.po
new file mode 100755 (executable)
index 0000000..743e4d8
--- /dev/null
+++ b/po/ar.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "مسح"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "إلغاء"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "السماح"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "خالي"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "جاري بدء التنزيل..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "إعدادات موقع الويب"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "إعادة الضبط إلى الافتراضي"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "اسم المستخدم"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "مطلوب التوثيق"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "تذكر الأفضلية"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "تحديث تلقائي"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "كلمة المرور"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "توجد مشاكل في شهادة الأمان الخاصة بهذا الموقع"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "إخطار الويب"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "توجد محاولة من %1$s (%2$s) لتخزين كمية كبيرة من البيانات على جهازك للاستخدام عند عدم الاتصال بالإنترنت"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "يوجد طلب من ‎%1$s (%2$s)‎ للحصول على إذن من أجل تخزين بيانات على جهازك للاستخدام عند عدم الاتصال بالإنترنت"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "يوجد طلب من %1$s (%2$s) للحصول على إذن من أجل الوصول إلى موقعك"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "يوجد طلب من %1$s (%2$s) للحصول على إذن من أجل عرض الإخطارات"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "يوجد طلب من %1$s (%2$s) للحصول على إذن من أجل استخدام الكاميرا"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "الشاشة كاملة"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "الوصول لموقع المستخدم"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "إستخدام/حفظ بيانات الويب"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "إستخدام وسائط المستخدم"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "السماح لهذا الموقع بالوصول إلى معلومات موقعك"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "السماح لهذا الموقع بحفظ مجموعة كبيرة من البيانات على جهازك"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "السماح لهذا الموقع بتغيير العرض إلى ملء الشاشة"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "السماح لهذا الموقع باستخدام ملفات الوسائط المخزنة على الجهاز"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "السماح لهذا الموقع بعرض الإخطارات"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "إلغاء تحديد إعدادات التطبيق الافتراضية من خلال الانتقال إلى الضبط > عام > إدارة التطبيقات > الكل"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "رفض"
+
diff --git a/po/az.po b/po/az.po
new file mode 100755 (executable)
index 0000000..4e6454b
--- /dev/null
+++ b/po/az.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Sil"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Ləğv et"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "İcazə ver"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Boşdur"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Yükləmə başladılır..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Vebsayt parametrləri"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "İlkin parametrə təyin et"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "İstifadəçinin adı"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Kimliyin müəyyən edilməsi tələb olunur."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Secimi yadda saxla."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Avtomatik yeniləmə"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Şifrə"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Bu saytın təhlükəsizlik sertifikatı ilə bağlı problemlər var."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Veb bildiriş"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) sizin cihazınızda oflayn istifadə üçün böyük həcmdə məlumat saxlamağa cəhd edir."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) cihazınızda oflayn istifadə üçün məlumat saxlamağa icazə istəyir."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) yerinizə daxil olmaq üçün icazə istəyir."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) bildirişləri göstərmək üçün icazə istəyir."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) kameranızdan istifadə etmək üçün icazə istəyir."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Bötüv ekran"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "İstifadəçi yerinə çıxış"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "İnternet məlumatından istifadə et/yadda saxla"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "İstifadəçi mediadan istifadə et"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Bu sayta sizin məkan məlumatınıza çıxış imkanı verin."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Bu sayta çox sayda məlumatı cihazınızda saxlamaq imkanı verin."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Bu sayta displeyi tam ekrana dəyişmək imkanı verin."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Bu sayta cihazınızda saxlanan media fayllarından istifadə etmək imkanı verin."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Bu sayta bildirişləri təsvir etmək imkanı verin."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Parametrlər > Ümumi > Proqramları İdarə et > Hamısı seçməklə defolt proqram parametrlərini silin."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "İmtina et"
+
diff --git a/po/bg.po b/po/bg.po
new file mode 100755 (executable)
index 0000000..8db9b6c
--- /dev/null
+++ b/po/bg.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Изтрий"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Отмени"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Разрешаване"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Празно"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Начало на изтеглянето..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Настройки на уеб сайт"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Нулиране до стойности по подразбиране"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Потребителско име"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Изисква се удостоверяване."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Запомни предпочитанията"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Автоматично опресняване"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Парола"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Има проблеми със сертификата за защита за този сайт."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Уеб уведомяване"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) се опитва да съхранява голямо количество данни на вашето устройство за използване офлайн."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) иска разрешение за съхраняване на данни на вашето устройство за използване офлайн."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) иска разрешение за достъп до вашето местоположение."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) иска разрешение за показване на известия."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) иска разрешение за използване на вашата камера."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Цял екран"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Достъп до местоположението на потребителя"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Използване/съхраняване на уеб данни"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Използване на мултимедия на потребителя"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Позволява на този сайт достъп до информацията за вашето местоположение."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Позволява на този сайт да записва голямо количество данни на вашето устройство."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Позволява на този сайт да променя екрана на цял екран."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Позволява на този сайт да използва мултимедийните файлове, съхранени във вашето устройство."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Позволява на този сайт да показва известия."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Изчистете настройките за приложение по подразбиране, като отидете в Настройки > Общи > Управление на приложения > Всички."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Отхвърли"
+
diff --git a/po/bn.po b/po/bn.po
new file mode 100755 (executable)
index 0000000..fc86542
--- /dev/null
+++ b/po/bn.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "মুছুন"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "বাতিল"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "অনুমতি"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "খালি"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "ডাউনলোড আরম্ভ হচ্ছে..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "ওয়েবসাইট সেটিংস"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "ডিফল্টে রিসেট করুন"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ব্যবহারকারীর নাম"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "প্রামাণিকরণ দরকার।"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "অগ্রাধিকার মনে রাখা।"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "স্বতঃ রিফ্রেশ"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "পাসওয়ার্ড"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "এই সাইটের সুরক্ষা শংসাপত্র-এ কিছু সমস্যা আছে।"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "ওয়েব বিজ্ঞপ্তি"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) অফলাইনে ব্যবহারের জন্য আপনার ডিভাইসে বড় পরিমাণ তথ্য সঞ্চয় করার প্রয়াস করছে।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) অফলাইন ব্যবহারের জন্য আপনার ডিভাইসে তথ্য সঞ্চয় করার অনুমতি অনুরোধ করছে।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) আপনার অবস্থান অ্যাক্সেসের জন্য অনুমতি অনুরোধ করছে।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) বিজ্ঞপ্তি দেখানোর জন্য অনুমতি অনুরোধ করছে।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) আপনার ক্যামেরা ব্যবহারের জন্য অনুমতি অনুরোধ করছে।"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "পূর্ণ স্ক্রিন"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "ব্যবহারকারীর অবস্থান অ্যাক্সেস করুন"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "ওয়েব তথ্য ব্যবহার করুন/স্টোর করুন"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "ব্যবহারকারীর মিডিয়া ব্যবহার করুন"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "এই সাইটটিকে আপনার অবস্থানের তথ্য অ্যাক্সেসের অনুমতি দিন।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "এই সাইটটিকে আপনার ডিভাইসে প্রচুর পরিমাণে তথ্য সংরক্ষণের অনুমতি দিন।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "এই সাইটটিকে প্রদর্শনটি পূর্ণ স্ক্রিনে পরিবর্তন করার অনুমতি দিন।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "এই সাইটটিকে আপনার ডিভাইসে সঞ্চিত মিডিয়া ফাইলগুলি ব্যবহারের অনুমতি দিন।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "এই সাইটটিকে বিজ্ঞপ্তিগুলি প্রদর্শনের অনুমতি দিন।"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "এখানে গিয়ে ডিফল্ট অ্যাপ সেটিংস পরিষ্কার করুন সেটিংস > সাধারণ > অ্যাপ্লিকেশনগুলি পরিচালনা করুন > সমস্ত।"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "অস্বীকার"
+
diff --git a/po/ca.po b/po/ca.po
new file mode 100755 (executable)
index 0000000..13b650f
--- /dev/null
+++ b/po/ca.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Esborrar"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancel·lar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permetre"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Buit"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "S'està iniciant la descàrrega..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Ajustaments de lloc web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Restablir a predeterminat"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nom d'usuari"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Es requereix autenticació"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Recordar preferència"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Actualitzar automàticament"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Contrasenya"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Hi ha problemes amb el certificat de seguretat d'aquest lloc"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notificació web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) està intentant emmagatzemar una gran quantitat de dades al seu dispositiu per a ús fora de línia"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) està demanant permís per emmagatzemar dades al seu dispositiu per a ús fora de línia"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) està demanant permís per accedir a la seva ubicació"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) està demanant permís per mostrar notificacions"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) està demanant permís per utilitzar la seva càmera"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Pantalla completa"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Accedir a la ubicació de l'usuari"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Utilitzar/emmagatzemar dades web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Utilitzar multimèdia d'usuari"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Permet a aquest lloc accedir a la informació de la seva ubicació"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Permet a aquest lloc desar una gran quantitat de dades al seu dispositiu"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Permet a aquest lloc canviar la visualització a pantalla completa"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Permet a aquest lloc utilitzar els fitxers multimèdia emmagatzemats al seu dispositiu"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Permet a aquest lloc mostrar notificacions"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Esborri els ajustaments d'aplicacions predeterminades anant a Ajustaments > General > Administrar aplicacions > Totes"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Denegar"
+
diff --git a/po/cs.po b/po/cs.po
new file mode 100755 (executable)
index 0000000..d6b3ff2
--- /dev/null
+++ b/po/cs.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Odstranit"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Zrušit"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Povolit"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Prázdný"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Spouští se stahování..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Nastavení webového serveru"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Obnovit výchozí nastavení"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Uživatelské jméno"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Je vyžadováno ověření."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Zapamatovat preference."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automatická aktualizace"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Heslo"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Došlo k potížím s certifikátem zabezpečení pro tento server."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Webové oznamování"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) se pokouší uložit do zařízení velké množství dat pro použití offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) žádá o povolení uložit do zařízení data pro použití offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) žádá o povolení přístupu k informacím o vaší poloze."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) žádá o povolení zobrazit oznámení."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) žádá o povolení použít fotoaparát."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Celá obrazovka"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Přístup k poloze uživatele"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Použít/uložit webová data"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Použít uživatelská média"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Umožní stránce přístup k informacím o vaší poloze."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Umožní stránce uložit do zařízení velké množství dat."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Umožní stránce změnit zobrazení na celou obrazovku."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Umožní stránce použít multimediální soubory uložené v zařízení."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Umožní stránce zobrazovat upozornění."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Vymažte výchozí nastavení aplikací pomocí Nastavení > Obecné > Správa aplikací > Vše."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Odmítnout"
+
diff --git a/po/da.po b/po/da.po
new file mode 100755 (executable)
index 0000000..a900044
--- /dev/null
+++ b/po/da.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Slet"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annullér"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Tillad"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Tom"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Starter download..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Webside indstillinger"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Nulstil til standard"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Brugernavn"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Godkendelse påkrævet."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Husk præference."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automatisk opdatering"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Adgangskode"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Der er problemer med sikkerhedscertifikatet for dette websted."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Internetmeddelelse"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) forsøger at gemme en stor mængde data på din enhed til offline-brug."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) anmoder om tilladelse til at gemme en stor mængde data på din enhed til offline-brug."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) anmoder om tilladelse til at få adgang til din placering."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) anmoder om tilladelse til at få vist notifikationer."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) anmoder om tilladelse til at bruge dit kamera."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Fuld skærm"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Tilgå din placering"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Brug/gem webdata"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Benyt brugermedier"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Tillader, at denne side får adgang til dine placeringsoplysninger."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Tillader, at denne side gemmer et stort antal data på din enhed."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Tillader, at denne side ændrer visning til fuld skærm."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Tillader, at denne side bruger de mediefiler, der er gemt på din enhed."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Tillader, at denne side viser informationer."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Ryd standardindstillinger for program ved at gå til Indstillinger > Generelt > Administrér programmer > Alle."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Afvis"
+
diff --git a/po/de_DE.po b/po/de_DE.po
new file mode 100755 (executable)
index 0000000..5a5545b
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Löschen"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Abbrechen"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Zulassen"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Leer"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Download wird gestartet..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Website-Einstellungen"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Auf Standard zurücksetzen"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Benutzername"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Authentifizierung erforderlich"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Voreinstellung merken"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Autom. Aktualisierung"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Passwort"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Probleme mit dem Sicherheitszertifikat für diese Site"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web-Benachrichtigung"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) versucht, eine große Datenmenge für die Offline-Verwendung auf Ihrem Gerät zu speichern."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) möchte die Berechtigung erhalten, Daten für die Offline-Verwendung auf Ihrem Gerät zu speichern."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) möchte die Berechtigung erhalten, um auf Ihren Standort zuzugreifen."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) möchte die Berechtigung erhalten, Benachrichtigungen anzuzeigen."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) möchte die Berechtigung erhalten, Ihre Kamera zu benutzen."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Vollbild"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Auf Benutzerstandortdaten zugreifen"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Internetdaten verwenden/speichern"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Private Medien verwenden"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Erlaubt der Website den Zugriff auf Ihre Standortinformationen."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Erlaubt dieser Website, große Datenmengen auf Ihrem Gerät zu speichern."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Erlaubt dieser Website, die Anzeige auf Vollbild zu ändern."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Erlaubt dieser Website, die auf Ihrem Gerät gespeicherten Mediendateien zu verwenden."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Erlaubt dieser Website das Anzeigen von Benachrichtigungen."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Löschen Sie App-Standardeinstellungen unter „Einstellungen > Allgemein > Anwendungsmanager > Alle“."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Ablehnen"
+
diff --git a/po/el_GR.po b/po/el_GR.po
new file mode 100755 (executable)
index 0000000..42d738f
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Διαγραφή"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Άκυρο"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Να επιτρέπεται"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Κενό"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Ξεκινά η λήψη..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Ρυθμίσεις τοποθεσίας Web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Επαναφορά της προεπιλογής"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Όνομα χρήστη"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Απαιτείται έλεγχος ταυτότητας."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Απομνημόνευση προτίμησης."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Αυτόματη ανανέωση"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Κωδικός πρόσβασης"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Υπάρχουν προβλήματα με το πιστοποιητικό ασφαλείας αυτής της τοποθεσίας."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Ειδοποίηση Web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "Η ιστοσελίδα %1$s (%2$s) επιχειρεί να αποθηκεύσει ένα μεγάλο όγκο δεδομένων στη συσκευή σας για χρήση εκτός σύνδεσης."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "Η ιστοσελίδα %1$s (%2$s) ζητά δικαίωμα για την αποθήκευση δεδομένων στη συσκευή σας για χρήση εκτός σύνδεσης."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "Η ιστοσελίδα %1$s (%2$s) ζητά δικαίωμα πρόσβασης στα δεδομένα θέσης σας."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "Η ιστοσελίδα %1$s (%2$s) ζητά δικαίωμα για την εμφάνιση ειδοποιήσεων."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "Η ιστοσελίδα %1$s (%2$s) ζητά δικαίωμα για τη χρήση της κάμεράς σας."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Πλήρης οθόνη"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Πρόσβαση στη θέση του χρήστη"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Χρήση/αποθήκευση δεδομένων web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Χρήση πολυμέσων χρήστη"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Επιτρέπει σε αυτήν την τοποθεσία την πρόσβαση στις πληροφορίες τοποθεσίας σας."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Επιτρέπει σε αυτήν την τοποθεσία να αποθηκεύει μεγάλο όγκο δεδομένων στη συσκευή σας."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Επιτρέπει σε αυτήν την τοποθεσία να αλλάζει την προβολή σε πλήρη οθόνη."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Επιτρέπει σε αυτήν την τοποθεσία να χρησιμοποιεί τα αρχεία πολυμέσων που είναι αποθηκευμένα στη συσκευή σας."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Επιτρέπει σε αυτήν την τοποθεσία να εμφανίζει ειδοποιήσεις."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Εκκαθαρίστε τις ρυθμίσεις προεπιλεγμένης εφαρμογής μεταβαίνοντας στις Ρυθμίσεις > Γενικά > Διαχείριση εφαρμογών > Όλα."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Απόρριψη"
+
diff --git a/po/en.po b/po/en.po
new file mode 100755 (executable)
index 0000000..c494671
--- /dev/null
+++ b/po/en.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Delete"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancel"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Allow"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Empty"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Starting download..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Website settings"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Reset to default"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Username"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Authentication required."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Remember preference."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Auto refresh"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Password"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "There are problems with the security certificate for this site."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web notification"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) is attempting to store a large amount of data on your device for offline use."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) is requesting permission to store data on your device for offline use."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) is requesting permission to access your location."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) is requesting permission to show notifications."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) is requesting permission to use your camera."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Full screen"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Access user location"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Use/store web data"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Use user media"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Allows this site to access your location information."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Allows this site to save a large amount of data on your device."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Allows this site to change the display to full screen."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Allows this site to use the media files stored on your device."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Allows this site to display notifications."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Clear default app settings by going to Settings > General > Manage applications > All."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Deny"
+
diff --git a/po/en_PH.po b/po/en_PH.po
new file mode 100755 (executable)
index 0000000..c494671
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Delete"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancel"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Allow"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Empty"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Starting download..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Website settings"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Reset to default"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Username"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Authentication required."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Remember preference."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Auto refresh"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Password"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "There are problems with the security certificate for this site."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web notification"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) is attempting to store a large amount of data on your device for offline use."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) is requesting permission to store data on your device for offline use."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) is requesting permission to access your location."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) is requesting permission to show notifications."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) is requesting permission to use your camera."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Full screen"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Access user location"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Use/store web data"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Use user media"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Allows this site to access your location information."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Allows this site to save a large amount of data on your device."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Allows this site to change the display to full screen."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Allows this site to use the media files stored on your device."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Allows this site to display notifications."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Clear default app settings by going to Settings > General > Manage applications > All."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Deny"
+
diff --git a/po/en_US.po b/po/en_US.po
new file mode 100755 (executable)
index 0000000..200f658
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Delete"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancel"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Allow"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Empty"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Starting download..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Website settings"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Reset to default"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Username"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Authentication required."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Remember preference."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Auto refresh"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Password"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "There are problems with the security certificate for this site."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web notification"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) is attempting to store a large amount of data on your device for offline use."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) is requesting permission to store data on your device for offline use."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) is requesting permission to access your location."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) is requesting permission to show notifications."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) is requesting permission to use your camera."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Full screen"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Access user location"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Use/store Web data"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Use user media"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Allows this website to access your location information."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Allows this website to save a large amount of data on your device."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Allows this website to change the display to full screen."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Allows this website to use the media files stored on your device."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Allows this website to show notifications."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Clear default app settings by going to Settings > General > Manage applications > All."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Deny"
+
diff --git a/po/es_ES.po b/po/es_ES.po
new file mode 100755 (executable)
index 0000000..6dfbd14
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Eliminar"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Vacío"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Iniciando descarga..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Ajustes del sitio web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Restablecer valores"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nombre de usuario"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autenticación necesaria"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Recordar preferencias"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Actualizar automáticamente"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Contraseña"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Hay problemas con el certificado de seguridad de este sitio"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notificación web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está intentando almacenar una gran cantidad de datos en su dispositivo para su uso fuera de línea"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está solicitando permiso para almacenar datos en su dispositivo para su uso fuera de línea"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) está solicitando permiso para acceder a su ubicación"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) está solicitando permiso para mostrar notificaciones"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) está solicitando permiso para usar su cámara"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Pantalla completa"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Acceder a ubicación de usuario"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Usar/almacenar datos web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Usar archivos multimedia del usuario"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Permite a este sitio acceder a su información de ubicación"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Permite a este sitio guardar una gran cantidad de datos en su dispositivo"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Permite a este sitio cambiar a pantalla completa"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Permite a este sitio utilizar los archivos multimedia almacenados en su dispositivo"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Permite a este sitio mostrar notificaciones"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Borre ajustes de aplicaciones predeterminados en Ajustes > General > Gestionar aplicaciones > Todas"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Rechazar"
+
diff --git a/po/es_MX.po b/po/es_MX.po
new file mode 100755 (executable)
index 0000000..7b7ac59
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Eliminar"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Vacío"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Iniciando descarga..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Configuración del sitio Web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Restablecer valores predeterminados"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nombre de usuario"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autenticación necesaria."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Preferencias de recordatorio."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Actualizar automáticamente"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Contraseña"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Hay problemas con el certificado de seguridad de este sitio."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notificación web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está intentado almacenar grandes cantidades de datos en su dispositivo para el uso sin conexión."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está solicitando permiso para almacenar grandes cantidades de datos en su dispositivo para el uso sin conexión."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) está solicitando permiso para acceder a su ubicación."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) está solicitando permiso para mostrar notificaciones."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) está solicitando permiso para usar su cámara."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Pantalla completa"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Acceder a ubicación de usuario"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Usar/almacenar datos web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Usar archivos multimedia del usuario"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Permite que este sitio acceda a su información de ubicación."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Permite que este sitio guarde grandes cantidades de datos en su dispositivo."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Permite que este sitio cambie la pantalla a pantalla completa."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Permite que este sitio utilice archivos multimedia almacenados en su dispositivo."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Permite que este sitio muestre notificaciones."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Elimine la configuración predeterminada de la aplicación en Configuración > General > Administrar aplicaciones > Todo."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Rechazar"
+
diff --git a/po/es_US.po b/po/es_US.po
new file mode 100755 (executable)
index 0000000..2d966af
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Eliminar"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Vacío"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Iniciando descarga..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Configuración del sitio Web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Restablecer valores predeterminados"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nombre de usuario"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autenticación necesaria."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Preferencias de recordatorio."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Actualizar automáticamente"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Contraseña"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Hay problemas con el certificado de seguridad de este sitio."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notificación web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está intentado almacenar una gran cantidad de datos en su dispositivo para el uso sin conexión."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está solicitando permiso para almacenar datos en su dispositivo para el uso sin conexión."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) está solicitando permiso para acceder a su ubicación."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) está solicitando permiso para mostrar notificaciones."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) está solicitando permiso para usar Cámara."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Pantalla completa"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Acceder a ubicación de usuario"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Usar/almacenar datos web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Usar archivos multimedia del usuario"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Permite que este sitio acceda a su información de ubicación."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Permite que este sitio guarde grandes cantidades de datos en su dispositivo."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Permite que este sitio cambie la pantalla a pantalla completa."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Permite que este sitio utilice archivos multimedia almacenados en su dispositivo."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Permite que este sitio muestre notificaciones."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Elimine la configuración predeterminada de la aplicación en Configuración > General > Administrar aplicaciones > Todo."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Rechazar"
+
diff --git a/po/et.po b/po/et.po
new file mode 100755 (executable)
index 0000000..196c6fd
--- /dev/null
+++ b/po/et.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Kustuta"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Tühista"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Luba"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Tühi"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Allalaadimise alustamine..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Veebisaidi seaded"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Lähtesta vaikeväärtusele"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Kasutajanimi"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autentimine on kohustuslik."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Maleta eelistusi."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automaatne värskendamine"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Parool"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Selle saidi turvasertifikaadiga tekkis probleeme."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Veebiteavitus"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) proovib teie seadmesse salvestada suurt hulka andmeid, et kasutada neid vorguuhenduseta."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) taotleb luba salvestada teie seadmesse andmeid, et kasutada neid vorguuhenduseta."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) taotleb luba juurdepaasuks teie asukohale."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) taotleb luba naidata teavitusi."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) taotleb luba kasutada teie kaamerat."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Täisekraan"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Juurdepääs kasutaja asukohale"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Kasuta/salvesta veebiandmeid"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Kasuta kasutaja meediumi"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Lubab sellele saidile juurdepääsu teie asukoha teabele."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Lubab sellel saidil salvestada teie seadmesse suures koguses andmeid."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Lubab sellel saidil muuta kuva täisekraanile."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Lubab sellel saidil kasutada teie seadmesse salvestatud meediumifaile."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Lubab sellel saidil kuvada teavitusi."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Tuhistage vaikerakenduse seaded menuus Seaded > Uldine > Halda rakendusi > Koik."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Keeldu"
+
diff --git a/po/eu.po b/po/eu.po
new file mode 100755 (executable)
index 0000000..efdb568
--- /dev/null
+++ b/po/eu.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Ezabatu"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Ezeztatu"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Onartu"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Hutsik"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Deskarga hasten..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Webgunearen ezarpenak"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Lehenetsira berrezarri"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Erabiltzaile izena"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autentikazioa beharrezkoa"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Gogoratu hobespenak"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Freskatu automatikoki"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Pasahitza"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Arazoak daude gune honen segurtasun ziurtagiriarekin"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web jakinarazpena"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) datu kopuru handia gordetzen saiatzen ari da zure gailua lineaz kanpo erabiltzeko"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) baimena eskatzen ari zaizu datu kopuru handia gordetzeko zure gailuan lineaz kanpoko erabilerarako"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) baimena eskatzen ari zaizu zure kokapenera sartzeko"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) baimena eskatzen ari zaizu jakinarazpenak erakusteko"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) baimena eskatzen ari zaizu zure kamera erabiltzeko"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Pantaila osoa"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Sartu erabiltzaile kokapenera"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Erabili/gorde web datuak"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Erabili erabiltzaile multimedia"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Gune honi zure kokapen informaziora sartzen uzten dio"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Gune honi datu kopuru handia zure gailuan gordetzen uzten dio"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Gune honi pantaila osoa aldatzen uzten dio"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Gune honi datu zure gailuan gordetako multimedia fitxategiak erabiltzen uzten dio"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Gune honi jakinarazpenak erakusten uzten dio"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Garbitu lehenetsitako aplikazio ezarpenak Ezarpenak > Orokorra > Kudeatu aplikazioak > Denak aukerara joanda"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Ukatu"
+
diff --git a/po/fi.po b/po/fi.po
new file mode 100755 (executable)
index 0000000..0d443d1
--- /dev/null
+++ b/po/fi.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Poista"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Peruuta"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Salli"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Tyhjä"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Lataus käynnistetään..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Sivuston asetukset"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Palauta oletukset"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Käyttäjän nimi"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Todennus vaaditaan."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Muista ensisijainen asetus."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automaattinen päivitys"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Salasana"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Sivuston suojausvarmenteen kanssa on ongelmia."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Verkkoilmoitus"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) yrittää tallentaa suuren määrän tietoja laitteeseen offline-tilassa tapahtuvaa käyttöä varten."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) pyytää lupaa tietojen tallentamiseen laitteeseen offline-tilassa tapahtuvaa käyttöä varten."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) pyytää lupaa sijaintisi käyttämiseen."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) pyytää lupaa ilmoitusten näyttämiseen."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) pyytää lupaa kamerasi käyttämiseen."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Koko näyttö"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Käytä käyttäjän sijaintia"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Käytä/tallenna verkossa olevia tietoja"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Käytä käyttäjän mediaa"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Antaa sivuston käyttää sijaintitietoja."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Antaa sivuston tallentaa suuren määrän tietoja laitteeseen."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Antaa sivuston siirtää näytön koko näytön tilaan."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Antaa sivuston käyttää laitteeseen tallennettuja mediatiedostoja."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Antaa sivuston näyttää ilmoituksia."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Poista sovelluksen oletusasetukset käytöstä valitsemalla Asetukset > Yleistä > Sovellusten hallinta > Kaikki."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Kieltäydy"
+
diff --git a/po/fr_CA.po b/po/fr_CA.po
new file mode 100755 (executable)
index 0000000..9850fa4
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Supprimer"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annuler"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Autoriser"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Vide"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Début du téléchargement..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Paramètres des sites Web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Restaurer valeurs par défaut"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nom d'utilisateur"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Authentification requise"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Mémoriser la préférence."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Actualisation automatique"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Mot de passe"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Problèmes avec le certificat de sécurité de ce site"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notification Web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) tente d'enregistrer une grande quantité de données sur votre appareil pour une utilisation hors-ligne."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) demande l'autorisation d'enregistrer des données sur votre appareil pour une utilisation hors-ligne."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) demande l'autorisation de se connecter pour connaitre votre position."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) demande l'autorisation de consulter les notifications."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) demande l'autorisation d'utiliser votre appareil photo."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Plein écran"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Accéder à la position de l'utilisateur"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Utiliser/stocker les données Web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Utiliser les réseaux sociaux de l'utilisateur"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Autorise ce site à accéder à vos informations de localisation."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Autorise ce site à enregistrer une grande quantité de données sur votre appareil."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Autorise ce site à afficher le mode plein écran."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Autorise ce site à utiliser les fichiers multimédias stockés sur votre appareil."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Autorise ce site à afficher les notifications."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Effacez les paramètres par défaut des applications en accédant à Paramètres > Général > Gérer les applications > Toutes."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Refuser"
+
diff --git a/po/fr_FR.po b/po/fr_FR.po
new file mode 100755 (executable)
index 0000000..251b647
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Supprimer"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annuler"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Autoriser"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Vide"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Début du téléchargement..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Paramètres des sites Web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Restaurer valeurs par défaut"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nom d'utilisateur"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Authentification obligatoire"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Mémoriser la préférence."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Actualisation automatique"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Mot de passe"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Problèmes avec le certificat de sécurité de ce site"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notification Web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) tente d'enregistrer une grande quantité de données sur votre appareil pour une utilisation hors-ligne."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) demande l'autorisation d'enregistrer des données sur votre appareil pour une utilisation hors-ligne."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) demande l'autorisation de se connecter pour connaître votre position."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) demande l'autorisation de consulter les notifications."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) demande l'autorisation d'utiliser votre appareil photo."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Plein écran"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Accéder à la position de l'utilisateur"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Utiliser/stocker les données Web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Utiliser les réseaux sociaux de l'utilisateur"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Autorise ce site à accéder à vos informations de localisation."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Autorise ce site à enregistrer une grande quantité de données sur votre appareil."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Autorise ce site à afficher le mode plein écran."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Autorise ce site à utiliser les fichiers multimédia stockés sur votre appareil."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Autorise ce site à afficher les notifications."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Effacez les paramètres par défaut des applications en accédant à Paramètres > Général > Gérer les applications > Toutes."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Refuser"
+
diff --git a/po/ga.po b/po/ga.po
new file mode 100755 (executable)
index 0000000..54aba6a
--- /dev/null
+++ b/po/ga.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Scrios"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cuir ar ceal"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Ceadaigh"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Folamh"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Ag tosú ar íoslódáil..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Socruithe láithreán Gréasáin"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Athshocraigh go réamhshocraithe"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Ainm úsáideora"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Fíordheimhniú de dhíth."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Cuimhnigh ar mo shainrogha"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Uath-athnuaigh"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Pasfhocal"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Tá fadhbanna leis an deimhniú slándála don láithreán seo"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Fógra Gréasáin"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "Tá %1$s (%2$s) ag iarraidh líon mór sonraí a stóráil ar do ghléas le húsáid as líne"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "Tá %1$s (%2$s) ag iarraidh ceada le sonraí a stóráil ar do ghléas le húsáid as líne"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "Tá %1$s (%2$s) ag iarraidh ceada le do shuíomh a rochtain"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "Tá %1$s (%2$s) ag iarraidh ceada le fógraí a thaispeáint"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "Tá %1$s (%2$s) ag iarraidh ceada le do cheamara a úsáid"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Lánscáileán"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Faigh rochtain ar shuíomh úsáideora"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Úsáid/stóráil sonraí gréasáin"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Úsáid meáin úsáideora"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Ceadaítear don láithreán seo faisnéis faoi do shuíomh a rochtain."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Ceadaítear don láithreán seo líon mór sonraí a stóráil ar do ghléas."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Ceadaítear don láithreán seo an taispeáint a athrú go lánscáileán."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Ceadaítear don láithreán seo na comhaid meán atá á stóráil ar do ghléas a úsáid."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Ceadaítear don láithreán seo fógraí a thaispeáint."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Glan réamhshocruithe feidhmchláir trí ghabháil chuig Socruithe > Ginearálta > Bainistigh feidhmchláir > Gach"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Séan air"
+
diff --git a/po/gl.po b/po/gl.po
new file mode 100755 (executable)
index 0000000..631a6e8
--- /dev/null
+++ b/po/gl.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Eliminar"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Baleiro"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Iniciando descarga..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Axustes do sitio Web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Restablecer como predeterminado"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nome de usuario"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autenticación requirida"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Lembrar preferencia"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Actualización automática"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Contrasinal"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Existen problemas co certificado de seguridade deste sitio"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notificación web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está tentando almacenar unha grande cantidade de datos no teu dispositivo para utilizalos fóra de liña"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está solicitando permiso para almacenar datos no teu dispositivo para utilizalos fóra de liña"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) está solicitando permiso para ter acceso á túa situación"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) está solicitando permiso para amosar notificacións"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) está solicitando permiso para usar a túa cámara"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Pantalla completa"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Acceder á localización do usuario"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Usar/almacenar datos da Internet"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Usar arquivos multimedia de usuario"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Permite a este sitio acceder á túa información de localización"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Permite a este sitio gardar unha grande cantidade de datos no teu dispositivo"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Permite a este sitio cambiar a pantalla completa"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Permite a este sitio usar os arquivos multimedia almacenados no teu dispositivo"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Permite a este sitio amosar notificacións"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Borra os axustes predeterminados das aplicacións en Axustes > Xeral > Xestionar aplicacións > Todo"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Denegar"
+
diff --git a/po/gu.po b/po/gu.po
new file mode 100755 (executable)
index 0000000..9a22a2b
--- /dev/null
+++ b/po/gu.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "કાઢી નાખો"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "રદ"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "છૂટ આપો"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ખાલી"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "ડાઉનલોડ પ્રારંભ કરે છે..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "વેબસાઇટ સેટિંગ્સ"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "મૂળભૂત પર ફરીથી ગોઠવો"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ઉપયોગકર્તાનું નામ"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "પ્રમાણીકરણ જરૂરી."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "પ્રાથમિકતા યાદ રાખો."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "સ્વત: તાજું કરો"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "પાસવર્ડ"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "આ સાઇટ માટેનાં સુરક્ષા પ્રમાણપત્રમાં સમસ્યાઓ છે."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "વેબ સૂચના"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ઑફલાઇન ઉપયોગ માટે તમારા ઉપકરણ પર વધુ પ્રમાણમાં ડેટાનો સંગ્રહ કરવાનો પ્રયાસ કરી રહ્યાં છો."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) એ ઑફલાઇન ઉપયોગ માટે તમારા ઉપકરણ પર ડેટા સંગ્રહિત કરવા માટેની પરવાનગીની વિનંતી કરી રહ્યાં છે."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) તમારા સ્થાનને પ્રવેશ કરવાની પરવાનગીની વિનંતી કરી રહ્યાં છે."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) એ સૂચનાઓ બતાવવાની પરવાનગીની વિનંતી કરી રહ્યાં છે."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) તમારા સ્થાનનો ઉપયોગ કરવાની પરવાનગીની વિનંતી કરી રહ્યાં છે."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "પૂર્ણ પડદો"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "ઉપયોગકર્તા સ્થળમાં પ્રવેશ કરો"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "વેબ ડેટાનો ઉપયોગ/સંગ્રહ કરો"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "ઉપયોગકર્તા મીડિયાનો ઉપયોગ કરો"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "આ સાઇટને તમારી સ્થાન માહિતીમાં પ્રવેશ કરવાની પરવાનગી આપે છે."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "આ સાઇટને તમારા ઉપકરણ પર મોટા પ્રમાણમાં ડેટા સાચવવાની પરવાનગી આપે છે."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "આ સાઇટના પ્રદર્શનને સંપૂર્ણ સ્ક્રીન પર બદલવાની પરવાનગી આપે છે."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "આ સાઇટને તમારા ઉપકરણ પર સંગ્રહિત મીડિયા ફાઇલ્સનો ઉપયોગ કરવાની પરવાનગી આપે છે."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "આ સાઇટને સૂચનાઓ પ્રદર્શિત કરવાની પરવાનગી આપે છે."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "સેટિંગ્સ > સામાન્ય > એપ્લિકેશનોનું સંચાલન કરો > બધું પર જઈને મૂળભૂત એપ્લિકેશનો સેટિંગ્સને સાફ કરો."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "નકારો"
+
diff --git a/po/hi.po b/po/hi.po
new file mode 100755 (executable)
index 0000000..abb02a5
--- /dev/null
+++ b/po/hi.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "हटाएँ"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "रद्द"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "अनुमति दें"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "खाली"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "डाउनलोड शुरू कर रहे है..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "वेबसाइट सेटिंग्स"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "डिफॉल्‍ट में रीसेट करें"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "उपभोक्ता का नाम"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "प्रमाणीकरण आवश्यक है।"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "प्राथमिकता याद रखें"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "स्वतः रीफ्रेश करना"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "पासवर्ड"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "इस साइट के सुरक्षा प्रमाणपत्र के साथ समस्‍याएँ है"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "वेब सूचना"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) आपके डिवाइस पर ऑफ़लाइन उपयोग करने के लिए बड़ी मात्रा में डाटा स्टोर करने का प्रयास कर रहा है"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) आपके डिवाइस पर ऑफ़लाइन उपयोग करने के लिए डाटा स्टोर करने हेतु अनुरोध कर रहा है"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) आपके स्थान को ऐक्सेस करने की अनुमति का अनुरोध कर रहा है"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) अधिसूचना दिखाने की अनुमति का अनुरोध कर रहा है"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) आपके कैमरा उपयोग करने की अनुमति का अनुरोध कर रहा है"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "पूर्ण स्क्रीन"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "उपयोगकर्ता का स्थान ऍक्सेस करें"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "वेब डाटा उपयोग/स्टोर करें"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "उपयोगकर्ता मीडिया का उपयोग करें"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "इस साइट को आपके स्थान जानकारी तक पहुँच की अनुमति देता है।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "इस साइट को आपके डिवाइस पर बड़ी मात्रा में डाटा सुरक्षित करने की अनुमति देता है।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "इस साइट को प्रदर्शन को पूर्ण स्क्रीन में बदलने की अनुमति देता है।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "इस साइट को आपके डिवाइस पर संग्रहीत मीडिया फ़ाइलों का उपयोग करने की अनुमति देता है।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "इस साइट को अधिसूचनाएँ प्रदर्शित करने की अनुमति देता है।"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "सेटिंग्स > सामान्य > ऐप्लिकेशंस प्रबंधित करें > सभी पर जाकर डिफ़ॉल्ट ऐप सेटिंग्स साफ करें"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "अस्वीकृत करें"
+
diff --git a/po/hr.po b/po/hr.po
new file mode 100755 (executable)
index 0000000..f0565f1
--- /dev/null
+++ b/po/hr.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Obriši"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Prekid"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Dopusti"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Prazno"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Pokretanje skidanja..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Postavke web stranice"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Vrati na zadano"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Korisničko ime"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Provjera potrebna."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Spremi postavke."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automatsko aktualiziranje"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Šifra"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Greška sigurnosne potvrde za ovu stranicu."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web obavijest"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) pokušava pohraniti veću količinu podataka na vaš uređaj za korištenje izvan mreže."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) traži dopuštenje da pohrani veću količinu podataka na vaš uređaj za korištenje izvan mreže."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) traži dopuštenje da pristupi vašoj lokaciji."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) traži dopuštenje da prikaže obavijesti."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) traži dopuštenje da koristi vašu kameru."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Cijeli zaslon"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Otvori lokaciju korisnika"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Koristite/spremite web-podatke"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Koristite korisnikove medije"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Dopušta ovoj stranici pristup informacijama o vašoj lokaciji."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Dopušta ovoj stranici da spremi veliku količinu podataka na vaš uređaj."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Dopušta ovoj stranici da promjeni prikaz na puni zaslon."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Dopušta ovoj stranici da koristi medijske datoteke spremljene na uređaju."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Dopušta ovoj stranici da prikaže obavijesti."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Obrišite zadane postavke aplikacija tako da odete na Postavke > Općenito > Upravljanje aplikacijama > Sve."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Odbijeno"
+
diff --git a/po/hu.po b/po/hu.po
new file mode 100755 (executable)
index 0000000..d2d774e
--- /dev/null
+++ b/po/hu.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Töröl"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Mégse"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Engedélyezés"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Üres"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Letöltés indítása..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Webhelybeállítások"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Alapbeállítás visszaállítása"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Felhasználónév"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Hitelesítés szükséges."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Beállítások megjegyzése"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automatikus frissítés"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Jelszó"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Probléma merült fel a webhely biztonsági tanúsítványával kapcsolatban."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Webes értesítés"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) nagymennyiségű adatot próbál az eszközön tárolni offline használatra."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) engedélyt kér nagymennyiségű adat tárolására az eszközön offline használatra."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) engedélyt kér az Ön helyadataihoz való hozzáféréshez."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) engedélyt kér értesítések megjelenítésére."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) engedélyt kér a fényképező használatára."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Teljes képernyő"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Felhasználó helyadatainak hozzáférése"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Webes adatok használata, tárolása"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Felhasználói média használata"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Adatai hozzáférhetővé tétele a webhely számára"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Nagymennyiségű adat eszközre mentésének engedélyezése a webhely számára"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Teljes képernyős megjelenítésre kapcsolás engedélyezése a webhely számára"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Az eszközre mentett médiafájlok használatának engedélyezése a webhely számára"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Értesítések megjelenítésének engedélyezése a webhely számára"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "A Beállítások > Általános > Alkalmazások kezelése > Összes pontban törölheti az alapértelmezett alkalmazásbeállításokat."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Elutasítás"
+
diff --git a/po/hy.po b/po/hy.po
new file mode 100755 (executable)
index 0000000..13b7f42
--- /dev/null
+++ b/po/hy.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Ջնջել"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Չեղարկել"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Թույլատրել"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Դատարկ է"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Ներբեռնման մեկնարկում..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Կայքի դրվածքներ"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Զրոյացնել լռելյայնի"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Օգտվողի անուն"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Պահանջվում է վավերականացում:"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Հիշել նախապատվությունը:"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Ինքնանորացում"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Գաղտնաբառ"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Այս կայքն ունի անվտանգության վկայագրերի խնդիր:"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Համացանցային ծանուցում"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) փորձում է ցանցից դուրս օգտագործման համար մեծ քանակությամբ տվյալներ պահել Ձեր սարքում:"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) հարցնում է ցանցից դուրս օգտագործման համար Ձեր սարքում տվյալներ պահելու թույլտվություն:"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) հարցնում է Ձեր գտնվելու տեղը մուտք գործելու թույլտվություն:"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) հարցնում է ծանուցումները ցույց տալու թույլտվություն:"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) հարցնում է Ձեր խցիկն օգտագործելու թույլտվություն:"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Ամբողջ էկրանով"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Մուտք գործել դեպի օգտվողի տեղը"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Օգտագործել կամ պահել համացանցային տվյալները"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Օգտագործել օգտվողի միջոցները"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Թույլ է տալիս, որ այս կայքը մուտք գործի դեպի Ձեր տեղի մասին տեղեկատվությունը:"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Թույլ է տալիս, որ այս կայքը Ձեր սարքում պահպանի մեծ քանակությամբ տվյալներ:"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Թույլ է տալիս, որ այս կայքը ցուցադրումը փոխի լրիվ էկրանի:"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Թույլ է տալիս, որ այս կայքն օգտագործի Ձեր սարքում պահված մեդիա ֆայլերը:"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Թույլ է տալիս, որ այս կայքը ցուցադրի ծանուցումներ:"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Մաքրեք կանխադրված ծրագրի դրվածքները՝ գնալով Դրվածքներ > Ընդհանուր > Կառավարել ծրագրերը > Բոլոր:"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Մերժել"
+
diff --git a/po/id.po b/po/id.po
new file mode 100755 (executable)
index 0000000..bfcef78
--- /dev/null
+++ b/po/id.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Hapus"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Batal"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Bolehkan"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Kosong"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Mulai mendownload..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Pengaturan situs web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Reset ke default"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nama pemakai"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autentikasi diperlukan."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Ingat preferensi."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Segarkan Otomatis"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Kata sandi"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Sertifikat keamanan situs ini bermasalah."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notifikasi web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) mencoba menyimpan jumlah data yang besar di perangkat untuk penggunaan offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) meminta izin menyimpan data di perangkat Anda untuk penggunaan offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) meminta izin untuk mengakses lokasi Anda."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) meminta izin memperlihatkan notifikasi."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) meminta izin untuk menggunakan kamera Anda."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Layar penuh"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Akses lokasi pengguna"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Gunakan/simpan data web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Gunakan media pengguna"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Izinkan situs ini untuk mengakses informasi lokasi Anda."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Izinkan situs ini untuk menyimpan data dalam jumlah besar di perangkat Anda."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Izinkan situs ini untuk mengubah tampilan ke layar penuh."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Izinkan situs ini untuk menggunakan file media yang disimpan di perangkat Anda."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Izinkan situs ini untuk menampilkan notifikasi."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Hapus pengaturan aplikasi default dengan masuk ke Pengaturan > Umum > Kelola aplikasi > Semua."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Deny"
+
diff --git a/po/is.po b/po/is.po
new file mode 100755 (executable)
index 0000000..9bb2872
--- /dev/null
+++ b/po/is.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Eyða"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Hætta við"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Leyfa"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Tómt"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Ræsi niðurhal..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Vefsíðustillingar"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Endurstilla á sjálfgildi"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Notandanafn"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Sannprófun er nauðsynleg."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Muna stillingu."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Sjálfvirk uppfærsla"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Aðgangsorð"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Það komu upp vandamál með öryggisvottorðið fyrir þetta svæði."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Veftilkynning"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) er að reyna að geyma mikið magn gagna í tækinu til notkunar án nettengingar."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) biður um leyfi til að geyma mikið magn gagna í tækinu til notkunar án nettengingar."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) biður um leyfi til að fá aðgang að staðsetningunni þinni."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) biður um leyfi til að sýna tilkynningar."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) biður um leyfi til að nota myndavélina þína."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Allur skjárinn"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Fá staðsetninguna notanda"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Nota/geyma vefgögn"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Nota efni notanda"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Leyfir þessu vefsvæði að fá aðgang að staðsetningarupplýsingum þínum."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Leyfir þessu vefsvæði að vista mikið magn gagna í tækinu."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Leyfir þessu vefsvæði að skipta yfir í birtingu á öllum skjánum."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Leyfir þessu vefsvæði að nota margmiðlunarskrár sem vistaðar eru í tækinu."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Leyfir þessu vefsvæði að birta tilkynningar."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Hreinsaðu sjálfgefnar forritastillingar með því að fara í Stillingar > Almennt > Stjórna forritum > Allt."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Hafna"
+
diff --git a/po/it_IT.po b/po/it_IT.po
new file mode 100755 (executable)
index 0000000..bcb8da5
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Elimina"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annulla"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Consenti"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Vuoto"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Inizio download..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Impostazioni sito web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Ripristina impostazioni predefinite"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nome utente"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autenticazione richiesta."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Ricorda preferenza."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Aggiornamento automatico"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Password"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Problemi con il certificato di sicurezza di questo sito."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notifica Web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) sta tentando di archiviare una grande quantità di dati sul dispositivo in uso per l'utilizzo offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) sta chiedendo il permesso di archiviare i dati sul dispositivo in uso per l'utilizzo offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) sta chiedendo il permesso di accedere alla posizione dell'utente."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) sta chiedendo il permesso di mostrare le notifiche."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) sta chiedendo il permesso di utilizzare la fotocamera."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Schermo intero"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Accedi alla posizione utente"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Utilizza/memorizza dati Web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Utilizza elementi multimediali utente"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Consente al sito di accedere alle informazioni sulla posizione dell'utente."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Consente al sito di salvare una grande quantità di dati sul dispositivo in uso."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Consente al sito di passare alla modalità a schermo intero."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Consente al sito di utilizzare i file multimediali memorizzati sul dispositivo in uso."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Consente al sito di visualizzare le notifiche."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Cancellate le impostazioni predefinite delle applicazioni andando in Impostazioni > Generali > Gestisci applicazioni > Tutte."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Rifiuta"
+
diff --git a/po/ja_JP.po b/po/ja_JP.po
new file mode 100755 (executable)
index 0000000..4bfc6f5
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "削除"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "キャンセル"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "許可する"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "空き"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "ダウンロード開始..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Webサイト設定"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "初期値にリセット"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ユーザー名"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "認証が必要です。"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "設定を保存"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "自動更新"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "パスワード"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "このサイトのセキュリティ証明書に問題があります。"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web通知"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s(%2$s)がオフラインで使用するために、端末に容量の大きなデータを保存しようとしています。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s(%2$s)がオフラインで使用するために、端末にデータを保存する権限を要求しています。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s(%2$s)が現在地情報にアクセスする権限を要求しています。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s(%2$s)が通知を表示する権限を要求しています。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s(%2$s)がカメラを使用する権限を要求しています。"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "全画面表示"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "ユーザの位置情報にアクセス"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Webデータを使用/保存"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "ユーザーメディアを使用"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "このサイトが位置情報にアクセスすることを許可"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "このサイトから端末に大容量のデータを保存することを許可"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "このサイトを全画面表示に変更することを許可"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "このサイトが端末に保存されたメディアファイルを使用することを許可"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "このサイトから通知を表示することを許可"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "標準アプリ設定を解除するには、[設定] > [一般] > [アプリケーション管理] > [全て]に移動してください。"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "拒否"
+
diff --git a/po/ka.po b/po/ka.po
new file mode 100755 (executable)
index 0000000..e2defb3
--- /dev/null
+++ b/po/ka.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "წაშლა"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "გაუქმება"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "დართე ნება"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ცარიელია"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "იწყება ჩამოტვირთვა..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "ვებსაიტის პარამეტრები"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "ავტო. პარამეტრის დაბრუნება"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "მომხმარებლის სახელი"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "ავტორიზაცია აუცილებელია."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "უპირატესობის დამახსოვრება."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "ავტომატური განახლება"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "პაროლი"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "ამ საიტს აქვს უსაფრთხოების სერთიფიკატთან დაკავშირებული პრობლემა."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "ვებ-შეტყობინება"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ცდილობს შეინახოს დიდი მოცულობის მონაცემები თქვენს მოწყობილობაში, ინტერნეტში გამოსაყენებლად."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ითხოვს მონაცემების თქვენს მოწყობილობაში შენახვის ნებართვას, ინტერნეტში მათ გამოსაყენებლად."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) ითხოვს თქვენს ლოკაციაზე წვდომის ნებართვას."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) ითხოვს შეტყობინებების ჩვენების ნებართვას."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) ითხოვს თქვენი კამერის გამოყენების ნებართვას."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "მთლიანი ეკრანი"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "მომხმარებლის ლოკაციაზე წვდომა"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "ინტერნეტის მონაცემების გამოყენება/შენახვა"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "მომხმარებლის მედიის გამოყენება"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "საშუალებას აძლევს ამ საიტს გახსნას თქვენი ლოკაციის ინფორმაცია."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "საშუალებას აძლევს ამ საიტს თქვენს მოწყობილობაში შეინახოს მონაცემთა დიდი რაოდენობა."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "საშუალებას აძლევს ამ საიტს გაიხსნას მთელ ეკრანზე."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "საშუალებას აძლევს ამ საიტს გამოიყენოს თქვენს მოწყობილობაში შენახული მედია ფაილები."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "საშუალებას აძლევს ამ საიტს აჩვენოს შეტყობინებები."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "პროგრამის ნაგულისხმევი პარამეტრების წასაშლელად, გახსენით პარამეტრები > ზოგადი > პროგრამების მართვა > ყველა."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "უარყოფა"
+
diff --git a/po/kk.po b/po/kk.po
new file mode 100755 (executable)
index 0000000..d6a9456
--- /dev/null
+++ b/po/kk.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Жою"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Тоқтату"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Рұқсат"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Бос"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Жүктеу басталуда..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Веб-сайт параметрлері"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Стандартты бапстапқы мәндеріне баптау"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Тұтынушы аты"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Түпнұсқаны тексеру қажет."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Басымдығын еске сақтау."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Авто жаңарту"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Кілтсөз"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Осы сайтқа арналған қауіпсіздік куәлігінде қателер пайда болады."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Веб-хабарландыру"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) үлкен көлемдегі деректерді құрылғыңызда желіден тыс пайдалану үшін сақтауда."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) желіден тыс пайдалану үшін деректерді құрылғыда сақтау рұқсатын сұрауда."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) орналасқан орныңызға кіру рұқсатын сұрауда."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) хабарландыруларды көрсетуге рұқсат сұрауда."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) камераңызды пайдалану рұқсатын сұрауда."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Толық экран"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Пайдаланушы орнына қатынас"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Веб деректерін пайдалану/сақтау"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Пайдаланушы мультимедиасын қолдану"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Бұл сайтқа орын ақпаратына кіру мүмкіндігін береді."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Бұл сайтқа құрылғыңызда үлкен көлемдегі деректерді сақтау мүмкіндігін береді."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Бұл сайтқа дислейді толық экран режиміне ауыстыру мүмкіндігін береді."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Бұл сайтқа құрылғыңызда сақталған медиа файлдарды пайдалану мүмкіндігін береді."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Бұл сайтқа хабарландыруларды көрсету мүмкіндігін береді."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Әдепкі бағдарлама параметрлерін Параметрлер > Жалпы > Бағдарламаларды басқару > Барлығы мәзіріне өту арқылы өшіріңіз."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Бас тарту"
+
diff --git a/po/km.po b/po/km.po
new file mode 100755 (executable)
index 0000000..a026f24
--- /dev/null
+++ b/po/km.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "លុប"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "ចោល"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "អនុញ្ញាត"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ទទេ"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "កំពុង​ចាប់​ផ្ដើម​ទាញ​យក..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "ការកំណត់​វិបសៃ"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "កំណត់​ទៅ​លំនាំដើម"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ឈ្មោះ​អ្នកប្រើ"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "ត្រូវការ​ការផ្ទៀងផ្ទាត់​ភាពពិត។"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "ចងចាំ​ចំណូលចិត្ត។"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "ស្វ័យ​ធ្វើ​ឲ្យ​ស្រស់"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "ពាក្យ​សម្ងាត់"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "មាន​បញ្ហា​ជាមួយ​វិញ្ញាបនបត្រ​សន្តិសុខ​សម្រាប់​វិបសៃ​នេះ។"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "ការ​ជូន​ដំណឹង​វិប"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) កំពុង​ព្យាយាម​រក្សាទុក​បរិមាណ​ទិន្នន័យ​ជាច្រើន​លើ​ឧបករណ៍​របស់​អ្នក​សម្រាប់​ការប្រើ​ក្រៅ​បណ្ដាញ។"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) កំពុង​ស្នើ​ការអនុញ្ញាត​រក្សាទុក​ទិន្នន័យ​លើ​ឧបករណ៍​របស់​អ្នក​សម្រាប់​ការប្រើ​ក្រៅ​បណ្ដាញ។"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) កំពុង​ស្នើ​ការអនុញ្ញាត​ចូលប្រើ​ទីកន្លែង​របស់​អ្នក។"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) កំពុង​ស្នើ​ការអនុញ្ញាត​បង្ហាញ​ការជូនដំណឹង។"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) កំពុង​ស្នើ​ការអនុញ្ញាត​ប្រើ​កាមេរ៉ា​របស់​អ្នក។"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "ពេញ​អេក្រង់"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "ចូលប្រើ​ទីកន្លែង​អ្នកប្រើប្រាស់"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "ប្រើ/រក្សាទុក​ទិន្នន័យ​វិប"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "ប្រើ​មេឌៀ​អ្នកប្រើប្រាស់"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "អនុញ្ញាត​ឲ្យ​វិបសៃ​នេះ​ចូលប្រើ​ព័ត៌មាន​ទីកន្លែង​របស់​អ្នក។"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "អនុញ្ញាត​ឲ្យ​វិបសៃ​នេះ​រក្សាទុក​បរិមាណ​ទិន្នន័យ​ច្រើន​លើ​ឧបករណ៍​របស់​អ្នក។"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "អនុញ្ញាត​ឲ្យ​វិបសៃ​នេះ​ប្ដូរ​ការបង្ហាញ​ទៅ​ពេញអេក្រង់។"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "អនុញ្ញាត​ឲ្យ​វិបសៃ​នេះ​ប្រើ​ឯកសារ​មេឌៀ​ដែល​បាន​រក្សាទុក​លើ​ឧបករណ៍​របស់​អ្នក។"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "អនុញ្ញាត​ឲ្យ​វិបសៃ​នេះ​បង្ហាញ​ការជូនដំណឹង។"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "ជម្រះ​ការកំណត់​កម្មវិធី​លំនាំដើម ដោយ​ការចូលទៅ ការកំណត់ > ទូទៅ > គ្រប់គ្រង​កម្មវិធី > ទាំងអស់។"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Deny"
+
diff --git a/po/kn.po b/po/kn.po
new file mode 100755 (executable)
index 0000000..afbbc5e
--- /dev/null
+++ b/po/kn.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "ಅಳಿಸು"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "ರದ್ದು"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "ಅನುಮತಿಸು"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ಖಾಲಿ"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "ಡೌನ್‌ಲೋಡ್ ಆರಂಭಿಸುತ್ತಿದೆ..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "ವೆಬ್‌ಸೈಟ್ ಸಂಯೋಜನೆಗಳು"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "ಡೀಫಾಲ್ಟ್‌ಗೆ ರೀಸೆಟ್ ಮಾಡು"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ಬಳಕೆದಾರರಹೆಸರು"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "ಪ್ರಮಾಣೀಕರಣ ಅಗತ್ಯವಿದೆ."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "ಇಚ್ಛೆ ನೆನಪಿಡಿ."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "ಸ್ವಯಂ ರಿಫ್ರೆಶ್"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "ಪಾಸ್‌ವರ್ಡ್"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "ಈ ಸೈಟಿನ ಸುರಕ್ಷತಾ ಪ್ರಮಾಣಪತ್ರದ ಜೊತೆ ಸಮಸ್ಯೆಗಳಿವೆ."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "ವೆಬ್ ಪ್ರಕಟಣೆಗಳು"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "ಆಫ್‌ಲೈನ್ ಬಳಕೆಗಾಗಿ ನಿಮ್ಮ ಸಾಧನದಲ್ಲಿ ದೊಡ್ಡ ಪ್ರಮಾಣದ ಡೇಟಾವನ್ನು ಸಂಗ್ರಹಿಸಲು %1$s (%2$s) ಪ್ರಯತ್ನಿಸುತ್ತಿದೆ."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "ಆಫ್‌ಲೈನ್ ಬಳಕೆಗಾಗಿ ನಿಮ್ಮ ಸಾಧನದಲ್ಲಿ ಡೇಟಾ ಸಂಗ್ರಹಿಸಲು ಅನುಮತಿಯನ್ನು %1$s (%2$s) ವಿನಂತಿಸುತ್ತಿದೆ."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "ನಿಮ್ಮ ಸ್ಥಳವನ್ನು ಪ್ರವೇಶಿಸಲು %1$s (%2$s) ವಿನಂತಿಸುತ್ತಿದೆ."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "ಪ್ರಕಟಣೆಗಳನ್ನು ತೋರಿಸಲು ಅನುಮತಿಯನ್ನು %1$s (%2$s) ವಿನಂತಿಸುತ್ತಿದೆ."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "ನಿಮ್ಮ ಕ್ಯಾಮರಾ ಬಳಸಲು ಅನುಮತಿಯನ್ನು %1$s (%2$s) ವಿನಂತಿಸುತ್ತಿದೆ."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "ಪೂರ್ಣ ಪರದೆ"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "ಬಳಕೆದಾರ ಸ್ಥಳ ಪ್ರವೇಶಿಸಿ"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "ವೆಬ್ ಡೇಟಾ ಬಳಸಿ/ಸಂಗ್ರಹಿಸಿ"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "ಬಳಕೆದಾರ ಮೀಡಿಯಾ ಬಳಸಿ"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "ನಿಮ್ಮ ಸ್ಥಳೀಯ ಮಾಹಿತಿಯನ್ನು ಪ್ರವೇಶಿಸಲು ಈ ಸೈಟ್‌ಗೆ ಅನುಮತಿಸುತ್ತದೆ."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "ನಿಮ್ಮ ಸಾಧನದಲ್ಲಿ ದೊಡ್ಡ ಮೊತ್ತದ ಡೇಟಾ ಉಳಿಸಲು ಈ ಸೈಟ್‌ಗೆ ಅನುಮತಿಸುತ್ತದೆ."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "ಪೂರ್ಣ ಸ್ಕ್ರೀನ್‌ಗೆ ಪ್ರದರ್ಶನವನ್ನು ಬದಲಾಯಿಸಲು ಈ ಸೈಟ್‌ಗೆ ಅನುಮತಿಸುತ್ತದೆ."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "ನಿಮ್ಮ ಸಾಧನದಲ್ಲಿ ಸಂಗ್ರಹಿಸಲಾಗಿರುವ ಮೀಡಿಯಾ ಫೈಲ್‌ಗಳನ್ನು ಬಳಸಲು ಈ ಸೈಟ್‌ಗೆ ಅನುಮತಿಸುತ್ತದೆ."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "ಪ್ರಕಟಣೆಗಳನ್ನು ಪ್ರದರ್ಶಿಸಲು ಈ ಸೈಟ್‌ಗೆ ಅನುಮತಿಸುತ್ತದೆ."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "ಸಂಯೋಜನೆ‌ಗಳು > ಸಾಮಾನ್ಯ > ಅನ್ವಹಿಸುವಿಕೆಗಳನ್ನು ನಿರ್ವಹಿಸು > ಎಲ್ಲಾ ಇಲ್ಲಿಗೆ ಹೋಗುವ ಮೂಲಕ ಡೀಫಾಲ್ಟ್ ಅನ್ವಹಿಸುವಿಕೆ ಸಂಯೋಜನೆಗಳನ್ನು ತೆರವುಗೊಳಿಸಿ."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "ನಿರಾಕರಿಸು"
+
diff --git a/po/ko_KR.po b/po/ko_KR.po
new file mode 100755 (executable)
index 0000000..2dcf84e
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "삭제"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "취소"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "허용"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "비어 있음"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "다운로드를 시작하는 중..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "웹사이트 설정"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "기본으로 초기화"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "사용자 이름"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "인증이 필요합니다."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "설정을 기억합니다."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "자동 새로고침"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "비밀번호"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "URL을 검색하거나 입력하세요"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "웹 알림"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s(%2$s)에서 오프라인에서 사용하기 위해 용량이 큰 데이터를 내 디바이스에 저장하려고 합니다."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s(%2$s)에서 오프라인 사용을 위해 내 디바이스에 데이터를 저장할 권한을 요청합니다."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s(%2$s)에서 내 위치정보 접근 권한을 요청합니다."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s(%2$s)에서 알림 표시 권한을 요청합니다."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s(%2$s)에서 카메라 사용 권한을 요청합니다."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "전체 화면"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "사용자 위치정보 접근"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "웹 데이터 사용 및 저장"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "사용자 미디어 사용"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "사이트가 내 위치정보를 수집할 수 있도록 허용합니다."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "사이트가 디바이스에 용량이 큰 데이터를 저장할 수 있도록 허용합니다."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "사이트에서 화면을 전체 화면으로 변경할 수 있도록 허용합니다."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "사이트가 디바이스에 저장된 멀티미디어 파일을 사용할 수 있도록 허용합니다."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "사이트가 알림을 표시할 수 있도록 허용합니다."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "[설정] > [일반] > [애플리케이션 관리] > [전체]에서 기본 애플리케이션 설정을 삭제하세요."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "거부"
+
diff --git a/po/lo.po b/po/lo.po
new file mode 100755 (executable)
index 0000000..e80b795
--- /dev/null
+++ b/po/lo.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "ລຶບ"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "ຍົກເລີກ"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "ອະນຸຍາດ"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ຫວ່າງ​ເປົ່າ"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "ເລີ່ມການດາວໂຫຼດ..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "ການຕັ້ງຄ່າເວັບໄຊທ໌"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "ຕັ້ງໃໝ່ໄປເປັນຄ່າມາດຕະຖານ"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ຊື່ຜູ້ໃຊ້"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Authentication required."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "ຈື່ສິ່ງທີ່ມັກໄວ້."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "ລີເຟຣຊ໌ອັດຕະໂນມັດ"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "ລະຫັດຜ່ານ"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "ມີບັນຫາກັບໃບຢັ້ງຢືນຄວາມປອດໄພສໍາລັບເວັບໄຊທ໌ນີ້."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "ການແຈ້ງບອກເວັບ"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ກໍາລັງພະຍາຍາມບັນທຶກປະລິມານຂໍ້ມູນຂະໜາດໃຫຍ່ຢູ່ໃນເຄື່ອງຂອງທ່ານ ເພື່ອໄວ້ໃຊ້ເວລາອອບໄລນ໌."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ກໍາລັງຂໍອະນຸຍາດເກັບຮັກສາຂໍ້ມູນໄວ້ຢູ່ໃນເຄື່ອງຂອງທ່ານ ເພື່ອໄວ້ໃຊ້ເວລາອອບໄລນ໌."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) ກໍາລັງຂໍການອະນຸຍາດເຂົ້າຫາທີ່ຕັ້ງຂອງທ່ານ."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) ກໍາລັງຂໍການອະນຸຍາດສະແດງການແຈ້ງເຕືອນ."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) ກໍາລັງຂໍການອະນຸຍາດໃຊ້ກ້ອງຂອງທ່ານ."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "​ເຕັມໜ້າ​ຈໍ"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "ເຂົ້າໃຊ້ທີ່ຕັ້ງຂອງຜູ້ໃຊ້"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "ໃຊ້/ເກັບຮັກສາຂໍ້ມູນເວັບ"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "ໃຊ້ມີເດຍຂອງຜູ້ໃຊ້"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "ອະນຸຍາດໃຫ້ເວັບໄຊທ໌ນີ້ເຂົ້າໃຊ້ຂໍ້ມູນທີ່ຕັ້ງຂອງທ່ານ."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "ອະນຸຍາດໃຫ້ເວັບໄຊທ໌ນີ້ບັນທຶກຂໍ້ມູນຈໍານວນຫຼາຍຢູ່ໃນເຄື່ອງຂອງທ່ານ."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "ອະນຸຍາດໃຫ້ເວັບໄຊທ໌ນີ້ປ່ຽນແປງການສະແດງຂຶ້ນເຕັມໜ້າຈໍ."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "ອະນຸຍາດໃຫ້ເວັບໄຊທ໌ນີ້ໃຊ້ໄຟລ໌ມີເດຍທີ່ເກັບໄວ້ຢູ່ໃນເຄື່ອງຂອງທ່ານ."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "ອະນຸຍາດໃຫ້ເວັບໄຊທ໌ນີ້ສະແດງການແຈ້ງເຕືອນ."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "ລຶບການຕັ້ງຄ່າແອັບມາດຕະຖານໂດຍໄປທີ່ ການຕັ້ງຄ່າ > ທົ່ວໄປ > ຈັດການແອພພລິເຄຊັນ > ທັງໝົດ."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "ປະຕິເສດ"
+
diff --git a/po/lt.po b/po/lt.po
new file mode 100755 (executable)
index 0000000..3c71862
--- /dev/null
+++ b/po/lt.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Trinti"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Atšaukti"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Leisti"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Tuščia"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Pradeda siųsti..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Svetainės nustatymai"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Nustatyti į numatytąjį"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Naudotojo vardas"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Reikalinga patvirtinti autentiškumą."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Įsiminti nuostatą."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automatinis atnaujinimas"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Slaptažodis"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Iškilo problemų dėl šios svetainės apsaugos sertifikato."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web pranešimas"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) bando išsaugoti didelį duomenų kiekį jūsų įrenginyje, kad galėtų jais naudotis atsijungus."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) prašo leidimo išsaugoti duomenis jūsų įrenginyje ir naudotis jais atsijungus."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) prašo leidimo nustatyti jūsų vietą."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) prašo leidimo parodyti pranešimus."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) prašo leidimo naudoti jūsų fotoaparatą."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Visas ekranas"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Pasiekti naudotojo vietą"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Naudoti / saugoti žiniatinklio duomenis"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Naudoti naudotojo mediją"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Leidžia šiai svetainei gauti prieigą prie jūsų buvimo vietos informacijos."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Leidžia šiai svetainei išsaugoti didelį duomenų kiekį jūsų įrenginyje."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Leidžia šiai svetainei pakeisti rodymą į visą ekraną."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Leidžia šiai svetainei naudoti jūsų įrenginyje saugomus medijos failus."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Leidžia šiai svetainei atvaizduoti pranešimus."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Eidami į Nustatymai > Bendrieji nustatymai > Tvarkyti programas > Visos, išvalykite numatytuosius programos nustatymus."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Atmesti"
+
diff --git a/po/lv.po b/po/lv.po
new file mode 100755 (executable)
index 0000000..67d8356
--- /dev/null
+++ b/po/lv.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Dzēst"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Atcelt"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Atļaut"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Tukšs"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Sāk lejupielādi..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Tīmekļa vietnes iestatījumi"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Atjaunot noklusējumu"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Lietotājvārds"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Nepieciešama autentifikācija."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Atcerēties preferenci."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automātiskā atsvaidzināšana"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Parole"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Šai vietnei ir radušās problēmas ar drošības sertifikātu."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Tīmekļa paziņojums"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) mēģina jūsu ierīcē saglabāt lielu datu apjomu lietošanai bezsaistē."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) pieprasa atļauju jūsu ierīcē saglabāt datus lietošanai bezsaistē."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) pieprasa atļauju piekļūt jūsu atrašanās vietai."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) pieprasa atļauju rādīt paziņojumus."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) pieprasa atļauju izmantot jūsu kameru."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Pilnekrāns"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Piekļuve informācijai par lietotāja atrašanās vietu"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Izmantot/saglabāt tīmekļa datus"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Izmantot lietotāja datu nesēja ierīci"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Ļauj šai vietnei piekļūt jūsu atrašanās vietas informācijai."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Ļauj šai vietnei jūsu ierīcē saglabāt lielu daudzumu datu."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Ļauj šai vietnei mainīt displeju uz pilnekrāna režīmu."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Ļauj šai vietnei izmantot jūsu ierīcē saglabātos multivides failus."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Ļauj šai vietnei parādīt paziņojumus."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Lai notīrītu noklusējuma programmu iestatījumus, izvēlieties Iestatījumi > Vispārīgi > Pārvaldīt programmas > Visas."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Atteikt"
+
diff --git a/po/mk.po b/po/mk.po
new file mode 100755 (executable)
index 0000000..e0971d1
--- /dev/null
+++ b/po/mk.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Избриши"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Откажи"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Дозволи"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Празно"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Почнува преземање..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Опции за сајт"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Ресетирај на основните вредности"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Корисничко име"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Се бара препознавање."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Запомни преференци."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Автоматско обновување"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Лозинка"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Има проблеми со безбедносниот сертификат на сајтот."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Мрежно известување"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) се обидува да сочува големо количество податоци на уредот за користење без интернет."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) бара дозвола да зачувува податоци на уредот за користење без интернет."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) бара дозвола да пристапи кон Вашата локација."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) бара дозвола да покажува известувања."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) бара дозвола да ја користи Вашата камера."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "На цел екран"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Пристап кон корисничка локација"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Користи/зачувај податоци од интернет"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Користи кориснички медиуми"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Дозволува интернет-страницата да пристапува до Вашите информации за локацијата."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Овозможува интернет-страницата да сочувува големи количества податоци на уредот."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Овозможува интернет-страницата да го менува приказот на цел екран."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Овозможува интернет-страницата да ги користи медиумските фајлови зачувани на уредот."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Овозможува интернет-страницата да прикажува известувања."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Избришете ги основните опции за апликациите во Опции > Општо > Управување со апликации > Сите."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Отфрли"
+
diff --git a/po/ml.po b/po/ml.po
new file mode 100755 (executable)
index 0000000..1ff8a28
--- /dev/null
+++ b/po/ml.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "ഇല്ലാതാ."
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "റദ്ദാക്കു."
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "അനുവദിക്കൂ"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ശൂന്യം"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "ഡൌണ്‍ലോഡ് ആരംഭിക്കുന്നു..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "വെബ്സൈറ്റ് ക്രമീകരണങ്ങള്‍"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "സ്ഥിരസ്ഥിതികളിലേക്ക് പുനസജ്ജമാക്കുക"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ഉപയോക്തൃ നാമം"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "ആധാരീകരിക്കല്‍ ആവശ്യമാണ്."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "മുന്‍ഗണന ഓര്‍ക്കുക."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "യാന്ത്രികമായി പുതുക്കല്‍"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "പാസ്‌വേഡ്"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "ഈ സൈറ്റിനായുള്ള സുരക്ഷാ സര്‍ട്ടിഫിക്കറ്റില്‍ പ്രശ്നങ്ങളുണ്ട്."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "വെബ് അറിയിപ്പ്"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "ഓഫ്‌ലൈന്‍ ഉപയോഗത്തിനായി വലിയ തോതിലുള്ള ഡാറ്റ നിങ്ങളുടെ സാമഗ്രിയില്‍ സംഭരിക്കുന്നതിനായി %1$s (%2$s) ശ്രമിക്കുന്നു."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "ഓഫ്‌ലൈന്‍ ഉപയോഗത്തിനായി നിങ്ങളുടെ സാമഗ്രിയില്‍ ഡാറ്റ സംഭരിക്കുന്നതിനുള്ള അനുമതി %1$s (%2$s) അഭ്യര്‍ത്ഥിക്കുന്നു."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "നിങ്ങളുടെ ലൊക്കേഷന്‍ ആക്സസ്സ് ചെയ്യുന്നതിനുള്ള അനുമതി %1$s (%2$s) അഭ്യര്‍ത്ഥിക്കുന്നു."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "അറിയിപ്പുകള്‍ കാണിക്കുന്നതിനുള്ള അനുമതി %1$s (%2$s) അഭ്യര്‍ത്ഥിക്കുന്നു."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "നിങ്ങളുടെ ക്യാമറ ആക്സസ്സ് ചെയ്യുന്നതിനുള്ള അനുമതി %1$s (%2$s) അഭ്യര്‍ത്ഥിക്കുന്നു."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "പൂര്‍‌ണ്ണ സ്‌ക്രീന്‍‌"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "ഉപയോക്തൃ സ്ഥാനം ആക്സസ് ചെയ്യുക"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "വെബ് ഡാറ്റ ഉപയോഗിക്കുക/സംഭരിക്കുക"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "നിങ്ങളുടെ മീഡിയ ഉപയോഗിക്കുക"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "നിങ്ങളുടെ സ്ഥാന വിവരങ്ങൾ ആക്സസ് ചെയ്യാൻ ഈ സൈറ്റിനെ അനുവദിക്കുന്നു."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "വലിയ തോതിലുള്ള ഡാറ്റ നിങ്ങളുടെ ഉപകരണത്തിൽ സംരക്ഷിക്കാൻ ഈ സൈറ്റിനെ അനുവദിക്കുന്നു."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "ഡിസ്പ്ലേ പൂർണ്ണ സ്ക്രീനാക്കി മാറ്റാൻ ഈ സൈറ്റിനെ അനുവദിക്കുന്നു."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "നിങ്ങളുടെ ഉപകരണത്തിൽ സംഭരിച്ചിട്ടുള്ള മീഡിയ ഫയലുകൾ ഉപയോഗിക്കാൻ ഈ സൈറ്റിനെ അനുവദിക്കുന്നു."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "അറിയിപ്പുകൾ പ്രദർശിപ്പിക്കാൻ ഈ സൈറ്റിനെ അനുവദിക്കുന്നു."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "ക്രമീകരണങ്ങൾ > പൊതുവായവ > ആപ്ലിക്കേഷനുകൾ മാനേജ് ചെയ്യുക > എല്ലാം തുടങ്ങിയവയിലേക്ക് പോയി ഡിഫോൾട്ട് ആപ്ലിക്കേഷൻ ക്രമീകരണങ്ങൾ മായ്ക്കുക."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "നിരസിക്കുക"
+
diff --git a/po/mn_MN.po b/po/mn_MN.po
new file mode 100755 (executable)
index 0000000..24e5502
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Устгах"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Цуцлах"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Зөвшөөрөх"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Хоосон"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Татан авалтыг эхлүүлж байна..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Вэбсайтын тохиргоо"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Өгөгдмөл утгыг сэргээх"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Хэрэглэгчийн нэр"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Authentication required."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Сонголт санах"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Автоматаар сэргээх"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Нууц үг"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Энэ сайтын хамгаалалтын гэрчилгээ асуудалтай байна"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Вэб мэдэгдэл"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) сүлжээнд холбоогүй ашиглах их хэмжээний өгөгдөл таны төхөөрөмж дээр хадгалахыг оролдож байна"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) сүлжээнд холбоогүй ашиглах өгөгдөл таны төхөөрөмж дээр хадгалах зөвшөөрөл хүсэж байна"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) таны байрлалд хандах зөвшөөрөл хүсэж байна"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) мэдэгдлүүд харуулах зөвшөөрөл хүсэж байна"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) таны камерыг ашиглах зөвшөөрөл хүсэж байна"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Бүтэн дэлгэц"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Хэрэглэгчийн байрлалд хандах"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Вэб өгөгдөл ашиглах/хадгалах"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Хэрэглэгчийн медиа ашиглах"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Энэ сайтад таны байрлалын мэдээлэлд нэвтрэхийг зөвшөөрнө"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Энэ сайтад таны төхөөрөмж дээр их хэмжээний өгөгдөл хадгалахыг зөвшөөрнө"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Энэ сайтад дэлгэцийг дүүрэн болгож өөрчлөхийг зөвшөөрнө"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Энэ сайтад таны төхөөрөмж дээр хадгалсан медиа файлууд ашиглахыг зөвшөөрнө"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Энэ сайтад мэдэгдлүүд харуулахыг зөвшөөрнө"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Тохиргоо > Ерөнхий > Програмууд удирдах > Бүгд рүү очиж өгөгдмөл програмын тохиргоог арилга"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Татгалзах"
+
diff --git a/po/mr.po b/po/mr.po
new file mode 100755 (executable)
index 0000000..5e348eb
--- /dev/null
+++ b/po/mr.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "हटवा"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "रद्द"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "अनुमती द्या"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "रिकामा"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "डाऊनलोड सुरू करीत आहे..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "वेबसाईट सेटिंग्स"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "डिफॉल्टमध्ये पुन्हा मांडणी करा."
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "वापरकर्त्याचे नाव"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "प्रमाणीकरण आवश्यक."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "प्राधान्य लक्षात ठेवा."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "स्‍वयं रिफ्रेश"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "पासवर्ड"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "या संकेतस्थळाच्या सुरक्षा प्रमाणपत्रा बाबत समस्या आहेत."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "वेब अधिसूचना"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ऑफलाइन वापरासाठी आपल्‍या उपकरणवर डेटाची मोठी राशी संग्रहित करण्‍याचा प्रयत्‍न करत आहे."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ऑफलाइन वापरासाठी आपल्‍या उपकरणवर डेटा संग्रहित करण्‍याकरिता परवानगीची विनंती करत आहे."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) आपले स्‍थान ऍक्‍सेस करण्‍याकरिता परवानगीसाठी विनंती करत आहे."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) अधिसूचना दर्शविण्‍याकरिता परवानगीची विनंती करत आहे."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) आपला कॅमेरा वापरण्‍याकरिता परवानगीसाठी विनंती करत आहे."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "पूर्ण स्क्रीन"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "प्रयोक्ता स्‍थान ऍक्‍सेस करा"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "वेब डेटा वापरा/संग्रहित करा"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "प्रयोक्‍ता मीडिया वापरा"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "आपली स्‍थान माहिती ऍक्‍सेस करण्‍यासाठी ह्या साइटला अनुमती देते."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "आपल्‍या उपकरणावर डेटाची अधिक मात्रा जतन करण्‍यासाठी ह्या साइटला अनुमती देते."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "ह्या साइटला संपूर्ण स्‍क्रीनवर प्रदर्शन बदलण्‍याची अनुमती देते."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "आपल्‍या उपकरणावर जतन केलेल्‍या मिडिया फाइल्‍स वापरण्‍यासाठी ह्या साइटला अनुमती देते."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "ह्या साइटला अधिसूचना प्रदर्शित करण्‍याची अनुमती देते."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "सेटिंग्स > सामान्‍य > अनुप्रयोग व्यवस्थापित करा > सर्व वर जाऊन डीफॉल्ट अनुप्रयोग सेटिंग्स साफ करा."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "नकार द्या"
+
diff --git a/po/ms.po b/po/ms.po
new file mode 100755 (executable)
index 0000000..993c6f0
--- /dev/null
+++ b/po/ms.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Padam"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Batal"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Benarkan"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Kosong"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Memulakan muat turun..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Aturan laman web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Tetap semula ke lalai"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nama pengguna"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Pengesahan Diperlukan."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Ingat keutamaan."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Auto muat semula"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Kata laluan"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Terdapat masalah dengan sijil keselamatan untuk tapak ini."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Pemberitahuan web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) cuba menyimpan sejumlah besar data pada peranti anda untuk kegunaan luar talian."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) meminta kebenaran menyimpan data pada peranti anda untuk kegunaan luar talian."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) meminta kebenaran mencapai lokasi anda."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) meminta kebenaran menunjukkan pemberitahuan."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) meminta kebenaran menggunakan kamera anda."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Skrin penuh"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Mencapai lokasi pengguna"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Guna/simpan data web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Guna media pengguna"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Membenarkan tapak ini untuk mencapai maklumat lokasi."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Membenarkan tapak ini menjimatkan jumlah data yang banyak pada peranti anda."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Membenarkan tapak ini untuk mengubah paparan ke skrin penuh."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Membenarkan tapak ini untuk menggunakan fail media yang disimpan dalam peranti anda."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Membenarkan tapak ini untuk memaparkan pemberitahuan."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Kosongkan aturan aplikasi lalai dengan pergi ke Aturan > Am > Uruskan aplikasi > Semua."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Nafi"
+
diff --git a/po/my.po b/po/my.po
new file mode 100755 (executable)
index 0000000..d1d781d
--- /dev/null
+++ b/po/my.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "ဖ်က္"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "ပယ္ဖ်က္"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "ခြင့္ျပဳပါ"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "အားလုံးရွင္းထုတ္ပစ္ၿပီး"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "လႊဲေျပာင္းကူးယူမႈစတင္ေနပါသည္.."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "ဝက္ဆိုက္ သတ္မွတ္ခ်က္မ်ား"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "ႀကိဳတင္စီစဥ္ထားမႈသုိ႔ ျပန္လည္သတ္မွတ္ပါ"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "သုံးစြဲသူ အမည္"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Authentication required."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "ပိုမိုႏွစ္သက္မႈမ်ားကို မွတ္ထားပါ"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "အလိုလို လန္းဆန္းျခင္း"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "စကား၀ွက္"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "ဤဆိုက္အတြက္ လံုျခံဳေရး ေအာင္လက္မွတ္ႏွင့္ပတ္သက္၍ ျပသာနာမ်ား ရွိေနပါသည္။"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "ဝဘ္ အေၾကာင္းၾကားစာ"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "အြန္လိုင္းသံုးရန္ သင့္ကိရိယာေပၚတြင္ %1$s (%2$s) က ေဒတာ အေျမာက္အမ်ား သိုေလွာင္ရန္ ၾကိဳးပမ္းေနသည္။"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "ေအာ့ဖ္လိုင္း သံုးရန္ သင့္ကိရိယာေပၚ ေဒတာသိုေလွာင္ရန္ %1$s (%2$s) က အခြင့္ေတာင္းခံေနသည္။"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "သင့္တည္ေနရာကို ဝင္ေရာက္ရန္ %1$s (%2$s) က အခြင့္ေတာင္းခံေနသည္။"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "အသိေပးခ်က္မ်ား ျပရန္ %1$s (%2$s) က အခြင့္ေတာင္းခံေနသည္။"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "သင့္ ကင္မရာသံုးရန္ %1$s (%2$s) က အခြင့္ေတာင္းခံေနသည္။"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "ဖန္သားျပင္ အျပည့္"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "သံုးသူ တည္ေနရာ ဝင္ေရာက္ပါ"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "ဝဘ္ေဒတာ သံုးပါ/သိမ္းပါ"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "သင့္မီဒီယာ သံုးပါ"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "ဤဆိုက္အား သင့္တည္ေနရာ အခ်က္အလက္သို႔ ဝင္ေရာက္ရန္ ခြင့္ျပဳပါ။"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "ဤဆိုက္အား သင့္ကိရိယာေပၚမွာ ၾကီးမားသည့္ေဒတာ သိမ္းထားရန္ ခြင့္ျပဳပါ။"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "ဤဆိုက္အား ျပသခ်က္ကို ဖန္သားျပင္အျပည့္သို ႔ေျပာင္းရန္ ခြင့္ျပဳပါ။"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "ဤဆိုက္အား သင့္ကိရိယာေပၚမွာ မီဒီယာဖိုင္မ်ား သိမ္းထားရန္ ခြင့္ျပဳပါ။"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "ဤဆိုက္အား အသိေပးခ်က္မ်ား ျပသရန္ ခြင့္ျပဳပါ။"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "ဆက္တင္မ်ား > အေထြေထြ > အပလီေကးရွင္းမ်ား စီမံပါ > အားလံုး သို႔သြားျပီး အသင့္သြင္းထားသည့္ အက္ပ္ဆက္တင္မ်ား ရွင္းပါ။"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "ျငင္းဆိုပါ"
+
diff --git a/po/nb.po b/po/nb.po
new file mode 100755 (executable)
index 0000000..c2df359
--- /dev/null
+++ b/po/nb.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Slett"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Avbryt"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Tillat"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Tom"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Starter nedlasting..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Innstillinger for webområde"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Tilbakestill til standard"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Brukernavn"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Krever godkjenning."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Husk preferanse."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automatisk oppdatering"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Passord"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Det er problemer med sikkerhetssertifikatet for dette området."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Webvarsel"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) forsøker å lagre store mengder data på enheten din for bruk i frakoblet modus."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ber om tillatelse til å lagre data på enheten din for bruk i frakoblet modus."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) ber om tillatelse til å få tilgang til plasseringen din."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) ber om tillatelse til å vise varsler."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) ber om tillatelse til å bruke kameraet ditt."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Fullskjerm"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Tilgang til brukerens plassering"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Bruk/lagre nettdata"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Bruk brukermedier"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Gir dette området tilgang til plasseringsinformasjonen din."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Gir dette området tillatelse til å lagre en stor mengde data på enheten din."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Gir dette området tillatelse til å endre visningen til fullskjermsvisning."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Gir dette området tillatelse til å bruke mediefilene som er lagret på enheten din."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Gir dette området tillatelse til å vise varsler."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Fjern standard appinnstillinger ved å gå til Innstillinger > Generelt > Administrer apper > Alle."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Avslå"
+
diff --git a/po/ne.po b/po/ne.po
new file mode 100755 (executable)
index 0000000..415573f
--- /dev/null
+++ b/po/ne.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "मेटाउनु"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "रद्द"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "अनुमति दिनुहोस्"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "खाली"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "डाउनलोड सुरू भयो..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "वेबसाइट सेटिङहरु"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "पूर्वनिर्धारितमा रिसेट गर"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "प्रयोगकर्ता नाम"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "प्रमाणीकरण आवश्यक हुन्छ।"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "प्राथमिकता सम्झनुहोस्।"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "स्वत: रिफ्रेश गर्नुहोस्"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "पासवर्ड"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "यस साइटका लागि सुरक्षा प्रमाणपत्रसंग केही समस्याहरू छन्।"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "वेब सूचना"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) अफलाइन प्रयोगको लागि तपाईको यन्त्रमा डाटाको ठूलो मात्रामा भण्डार गर्ने प्रयास गर्दैछ।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) अफलाइन प्रयोगको लागि तपाईंको यन्त्रमा डाटा भण्डार गर्न अनुमति को अनुरोध गर्दैछ।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) तपाईको स्थान एक्सेस गर्नको लागि अनुमति को अनुरोध गर्दैछ।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) सूचनाहरू देखाउन अनुमतिको लागि अनुरोध गर्दैछ।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) तपाईको क्यामराको प्रयोग गर्न अनुमतिको लागि अनुरोध गर्दैछ।"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "पूर्ण स्क्रीन"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "प्रयोगकर्ता स्थान एक्सेस गर्नुहोस्"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "प्रयोग/वेब डाटा भण्‍डारण गर्नुहोस्"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "प्रयोगकर्ता मिडिया प्रयोग गर्नुहोस्"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "यो साइटलाई तपाईको स्थान जानकारी एक्सेस गर्न अनुमति दिन्छ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "यो साइटलाई तपाईको यन्त्रमा डाटाको ठूलो मात्रा सुरक्षित गर्न अनुमति दिन्छ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "यो साइटलाई पूरा स्क्रीनमा प्रर्दशन गर्न परिवर्तन गर्न अनुमति दिन्छ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "यो साइटलाई तपाईको यन्त्रमा भण्डारण गरिएका मिडिया फाइलहरू प्रयोग गर्न अनुमति दिन्छ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "यो साइटलाई सूचनाहरू प्रर्दशन गर्न अनुमति दिन्छ।"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "सेटिङ्हरू > सामान्य > अनुप्रयोगहरू व्यवस्थापन गर्नुहोस् > सबै मा गएर पूर्वनिर्धारित एप सेटिङहरू खाली गर्नुहोस्।"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "नकार"
+
diff --git a/po/nl_NL.po b/po/nl_NL.po
new file mode 100755 (executable)
index 0000000..b8e643f
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Wissen"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annuleren"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Toestaan"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Leeg"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Downloaden starten..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Website-instellingen"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Standaardinstellingen"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Gebruikersnaam"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Verificatie vereist."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Voorkeur onthouden"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Autom. vernieuwen"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Wachtwoord"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Er zijn problemen met het beveiligingscertificaat voor deze site."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Webmelding"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) probeert een grote hoeveelheid gegevens op uw apparaat op te slaan voor offline gebruik."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) vraagt toestemming om gegevens op uw apparaat op te slaan voor offline gebruik."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) vraagt toestemming voor toegang tot uw locatie."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) vraagt toestemming voor het weergeven van meldingen."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) vraagt toestemming om uw camera te gebruiken."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Volledig scherm"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Toegang tot gebruikerslocatie"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Webgegevens gebruiken/opslaan"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Media van gebruiker toepassen"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Deze site heeft toegang tot uw locatiegegevens."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Deze site mag een grote hoeveelheid gegevens op uw apparaat opslaan."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Deze site mag de weergave naar volledig scherm wijzigen."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Deze site mag de mediabestanden gebruiken die op uw apparaat zijn opgeslagen."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Deze site mag meldingen weergeven."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Wis standaard app-instellingen via Instellingen > Algemeen > Applicaties beheren > Alle."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Afwijzen"
+
diff --git a/po/or.po b/po/or.po
new file mode 100755 (executable)
index 0000000..91d43bf
--- /dev/null
+++ b/po/or.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "ବିଲୋପ"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "ବାତିଲ୍"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "ଅନୁମତି"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ଖାଲି"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "ଡାଉନ୍‌ଲୋଡ୍‌ ଆରମ୍ଭ କରୁଛି..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "ୱେବସାଇଟ୍ ସେଟିଂଗୁଡିକ"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "ଡିଫଲ୍ଟକୁ ପୁନଃସେଟ୍ କରନ୍ତୁ"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ଉପଭୋକ୍ତାନାମ"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "ପ୍ରାମାଣିକରଣ ଆବଶ୍ୟକ।"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "ଅଗ୍ରାଧିକାର ମନେ ରଖନ୍ତୁ।"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "ସ୍ଵତଃ ସତେଜ"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "ପାସ୍‌ୱାର୍ଡ୍"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "ଏହି ସାଇଟ୍ ପାଇଁ ସୁରକ୍ଷା ସାର୍ଟିଫିକେଟ୍ ସହିତ ଅସୁବିଧା ଅଛି।"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "ୱେବ୍ ସୂଚନା"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "ଅଫ୍‌ଲାଇନ୍ ବ୍ୟବହାର ପାଇଁ %1$s (%2$s) ଆପଣଙ୍କ ଡିଭାଇସ୍‌ରେ ଏକ ବୃହତ୍ ପରିମାଣର ଡାଟା ଷ୍ଟୋର୍ କରିବାକୁ ଉଦ୍ୟମ କରୁଛି।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "ଅଫ୍‌ଲାଇନ୍ ବ୍ୟବହାର ପାଇଁ %1$s (%2$s) ଆପଣଙ୍କ ଡିଭାଇସ୍‌ରେ ଡାଟା ଷ୍ଟୋର୍ କରିବାକୁ ଅନୁରୋଧ କରୁଛି।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "ଆପଣଙ୍କ ଅବସ୍ଥାନ ପ୍ରବେଶ କରିବାକୁ %1$s (%2$s) ଅନୁମତି ଅନୁରୋଧ କରୁଛି।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "ବିଜ୍ଞପ୍ତି ଦେଖାଇବାକୁ %1$s (%2$s) ଅନୁମତି ଅନୁରୋଧ କରୁଛି।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "ଆପଣଙ୍କ କ୍ୟାମେରା ବ୍ୟବହାର କରିବାକୁ %1$s (%2$s) ଅନୁମତି ଅନୁରୋଧ କରୁଛି।"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "ପୂର୍ଣ୍ଣ ପରଦା"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "ଉପଭୋକ୍ତାଙ୍କ ଅବସ୍ଥାନ ଆକସେସ୍ କରନ୍ତୁ"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "ୱେବ୍ ଡାଟା ବ୍ୟବହାର/ଷ୍ଟୋର୍ କରନ୍ତୁ"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "ଉପଭୋକ୍ତା ମିଡିଆ ବ୍ୟବହାର କରନ୍ତୁ"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "ଆପଣଙ୍କ ଅବସ୍ଥାନ ସୂଚନା ଆକସେସ୍ କରିବାକୁ ଏହି ସାଇ‌ଟ୍‌କୁ ଅନୁମତି ଦିଏ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "ଆପଣଙ୍କ ଡିଭାଇସ୍‌ରେ ବହୁତ ପରିମାଣର ଡାଟା ସଞ୍ଚୟ କରିବାକୁ ଏହି ସାଇଟ୍‌କୁ ଅନୁମତି ଦିଏ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "ପ୍ରଦର୍ଶନ ପୂର୍ଣ୍ଣ ସ୍କ୍ରିନ୍‌କୁ ପରିବର୍ତ୍ତନ କରିବାକୁ ଏହି ସାଇଟ୍‌କୁ ଅନୁମତି ଦିଏ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "ଆପଣଙ୍କ ଡିଭାଇସ୍‌ରେ ସଞ୍ଚିତ ଥିବା ମିଡିଆ ଫାଇଲ୍‌‌ଗୁଡିକ ବ୍ୟବହାର କରିବାକୁ ଏହି ସାଇଟ୍‌କୁ ଅନୁମତି ଦିଏ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "ବିଜ୍ଞପ୍ତି ପ୍ରଦର୍ଶନ କରିବାକୁ ଏହି ସାଇଟ୍‌କୁ ଅନୁମତି ଦିଏ।"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "ସେଟିଂ > ସାଧାରଣ > ଆପ୍ଲିକେସନ୍‌ଗୁଡିକ ପରିଚାଳନା > ସମସ୍ତକୁ ଯାଇ ଡିଫଲ୍ଟ୍ ଆପ୍ଲିକେସନ୍ ସେଟିଂ ଖାଲି କରନ୍ତୁ।"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "ଅଗ୍ରାହ୍ୟ"
+
diff --git a/po/pa.po b/po/pa.po
new file mode 100755 (executable)
index 0000000..18c89f1
--- /dev/null
+++ b/po/pa.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "ਮਿਟਾਓ"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "ਰੱਦ ਕਰੋ"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "ਆਗਿਆ ਦਿਉ"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ਖਾਲੀ"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "ਡਾਉਨਲੋਡ ਸ਼ੁਰੂ ਹੋ ਰਿਹਾ ਹੈ..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "ਵੈੱਬਸਾਈਟ ਸੈੱਟਿੰਗਸ"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "ਡਿਫਾੱਲਟ ਤੇ ਰੀਸੈੱਟ ਕਰੋ"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ਉਪਯੋਗਕਰਤਾ ਦਾ ਨਾਂ"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "ਪ੍ਰਮਾਣੀਕਰਨ ਦੀ ਲੋੜ ਹੈ।"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "ਤਰਜੀਹ ਨੂੰ ਯਾਦ ਰੱਖੋ।"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "ਸਵੈ ਰਿਫ੍ਰੈਸ਼ ਕਰੋ"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "ਪਾਸਵਰਡ"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "ਇਸ ਸਾਈਟ ਦੇ ਲਈ ਸੁਰੱਖਿਆ ਸਰਟੀਫੀਕੇਟ ਵਿੱਚ ਸਮੱਸਿਆਵਾਂ ਹਨ।"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "ਵੈੱਬ ਸੂਚਨਾ"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ਔਫਲਾਈਨ ਉਪਯੋਗ ਲਈ ਤੁਹਾਡੇ ਡਿਵਾਈਸ 'ਤੇ ਵੱਡੀ ਮਾਤਰਾ ਵਿੱਚ ਡੈਟਾ ਸੰਭਾਲਣ ਦਾ ਯਤਨ ਕਰ ਰਿਹਾ ਹੈ।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ਔਫਲਾਈਨ ਉਪਯੋਗ ਵਾਸਤੇ ਤੁਹਾਡੇ ਡਿਵਾਈਸ 'ਤੇ ਡੈਟਾ ਸੰਭਾਲਣ ਦੀ ਆਗਿਆ ਲੈਣ ਲਈ ਬੇਨਤੀ ਕਰ ਰਿਹਾ ਹੈ।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) ਤੁਹਾਡੀ ਸਥਿਤੀ 'ਤੇ ਐਕਸੈੱਸ ਕਰਨ ਦੀ ਆਗਿਆ ਲੈਣ ਲਈ ਬੇਨਤੀ ਕਰ ਰਿਹਾ ਹੈ।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) ਸੂਚਨਾਵਾਂ ਦਿਖਾਉਣ ਦੀ ਆਗਿਆ ਲੈਣ ਲਈ ਬੇਨਤੀ ਕਰ ਰਿਹਾ ਹੈ।"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) ਤੁਹਾਡੇ ਕੈਮਰੇ ਦਾ ਉਪਯੋਗ ਕਰਨ ਦੀ ਆਗਿਆ ਲੈਣ ਲਈ ਬੇਨਤੀ ਕਰ ਰਿਹਾ ਹੈ।"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "ਪੂਰਨ ਸਕ੍ਰੀਨ"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "ਉਪਯੋਗਕਰਤਾ ਦਾ ਸਥਾਨ ਐਕਸੈੱਸ ਕਰੋ"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "ਵੈੱਬ ਡੈਟਾ ਉਪਯੋਗ/ਸਟੋਰ ਕਰੋ"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "ਉਪਯੋਗਕਰਤਾ ਮੀਡੀਆ ਉਪਯੋਗ ਕਰੋ"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "ਇਸ ਸਾਈਟ ਨੂੰ ਤੁਹਾਡੀ ਸਥਾਨ ਦੀ ਜਾਣਕਾਰੀ ਐਕਸੈੱਸ ਕਰਨ ਦੀ ਆਗਿਆ ਦਿਉ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "ਇਸ ਸਾਈਟ ਨੂੰ ਤੁਹਾਡੇ ਡਿਵਾਈਸ ਤੇ ਵੱਡੀ ਮਾਤਰਾ ਵਿੱਚ ਡੈਟਾ ਸੁਰੱਖਿਅਤ ਕਰਨ ਦੀ ਆਗਿਆ ਦਿਉ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "ਇਸ ਸਾਈਟ ਨੂੰ ਪ੍ਰਦਰਸ਼ਨ ਨੂੰ ਪੂਰੀ ਸਕ੍ਰੀਨ ਵਿੱਚ ਬਦਲਣ ਦੀ ਆਗਿਆ ਦਿਉ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "ਇਸ ਸਾਈਟ ਨੂੰ ਤੁਹਾਡੇ ਡਿਵਾਈਸ ਤੇ ਸਟੋਰ ਕੀਤੀ ਮੀਡੀਆ ਫਾਈਲਾਂ ਨੂੰ ਉਪਯੋਗ ਕਰਨ ਦਈ ਆਗਿਆ ਦਿਉ।"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "ਇਸ ਸਾਈਟ ਨੂੰ ਸੂਚਨਾਵਾਂ ਪ੍ਰਦਰਸ਼ਿਤ ਕਰਨ ਦੀ ਆਗਿਆ ਦਿਉ।"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "ਸੈੱਟਿੰਗਸ > ਸਧਾਰਨ > ਅਨੁਪ੍ਰਯੋਗ ਪ੍ਰਬੰਧਕ > ਸਾਰੇ ਤੇ ਜਾ ਕੇ ਡਿਫਾੱਲਟ ਅਨੁਪ੍ਰਯੋਗ ਸੈੱਟਿੰਗਸ ਨੂੰ ਹਟਾਓ।"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "ਅਸਵੀਕਾਰ"
+
diff --git a/po/pl.po b/po/pl.po
new file mode 100755 (executable)
index 0000000..37a263d
--- /dev/null
+++ b/po/pl.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Usuń"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Anuluj"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Zezwalaj"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Puste"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Rozpoczynanie pobierania..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Ustawienia witryn internetowych"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Przywróć domyślne"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nazwa użytkownika"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Wymagane uwierzytelnianie."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Zapamiętaj preferencje."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automatyczne odświeżanie"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Hasło"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Wystąpiły problemy z certyfikatem zabezpieczeń dla tej witryny."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Powiadomienie internetowe"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) próbuje zapisać dużą ilość danych na Twoim urządzeniu do korzystania offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) żąda zezwolenia na zapisanie danych na Twoim urządzeniu do korzystania offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) żąda zezwolenia na dostęp do Twojej lokalizacji."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) żąda zezwolenia na pokazanie powiadomień."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) żąda zezwolenia na korzystanie z Twojego aparatu."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Pełny ekran"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Dostęp do lokalizacji użytkownika"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Użyj danych internetowych/zapisz dane internetowe"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Użyj plików multimedialnych użytkownika"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Umożliwia tej stronie dostęp do informacji o lokalizacji."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Umożliwia tej stronie zapisywanie dużej ilość danych na urządzeniu."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Umożliwia tej stronie zmianę trybu wyświetlania na pełnoekranowy."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Umożliwia tej stronie wykorzystywanie plików multimedialnych zapisanych w urządzeniu."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Umożliwia tej stronie wyświetlanie powiadomień."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Wyczyść domyślne ustawienia aplikacji, przechodząc do opcji Ustawienia > Ogólne > Zarządzaj aplikacjami > Wszystkie."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Odrzuć"
+
diff --git a/po/pt_BR.po b/po/pt_BR.po
new file mode 100755 (executable)
index 0000000..5e2692e
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Apagar"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Vazio"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Iniciando download..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Configurações de site da Internet"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Restaurar padrão"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Usuário"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autenticação solicitada."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Lembrar preferência."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Atualizar automaticamente"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Senha"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Existem problemas com o certificado de segurança para este site."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Aviso da web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está tentando armazenar uma grande quantidade de dados no seu dispositivo para uso offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está solicitando permissão para armazenar dados no seu dispositivo para uso offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) está solicitando permissão para acessar sua localização."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) está solicitando permissão para exibir notificações."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) está solicitando permissão para usar a câmera."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Tela cheia"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Acesso à localização do usuário"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Usar/armazenar dados da web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Usar mídia do usuário"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Permite que este site acesse informações da sua localização."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Permite que este site salve uma grande quantidade de dados no seu dispositivo."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Permite que este site altere a exibição para tela cheia."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Permite que este site use os arquivos de mídia armazenados no seu dispositivo."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Permite que este site exiba notificações."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Apagar as configurações padrão do aplicativo indo para Configurações > Gerais > Gerenciar aplicativos > Todos."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Declinar"
+
diff --git a/po/pt_PT.po b/po/pt_PT.po
new file mode 100755 (executable)
index 0000000..4a76396
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Eliminar"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Vazio"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "A iniciar transferência..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Definições de site da Web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Repor padrão"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nome de utilizador"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Autenticação requerida."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Lembrar preferência."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Actualização auto"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Palavra-passe"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Existem problemas com o certificado de segurança para este site."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notificação Web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está a tentar guardar uma grande quantidade de dados no seu dispositivo para utilização offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) está a pedir permissão para guardar uma grande quantidade de dados no seu dispositivo para utilização offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) está a pedir permissão para aceder à sua localização."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) está a pedir permissão para mostrar notificações."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) está a pedir permissão para utilizar a sua câmara."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Ecrã inteiro"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Aceder à localização do utilizador"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Utilizar/guardar dados da Web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Utilizar multimédia de utilizador"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Permite a este site aceder às suas informações de localização."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Permite a este site guardar uma grande quantidade de dados no seu dispositivo."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Permite a este site alterar a apresentação para ecrã inteiro."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Permite a este site utilizar ficheiros multimédia guardados no seu dispositivo."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Permite a este site apresentar notificações."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Limpe as predefinições das aplicações acedendo a Definições > Geral > Gestor de aplicações > Tudo."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Declinar"
+
diff --git a/po/ro.po b/po/ro.po
new file mode 100755 (executable)
index 0000000..d2c0917
--- /dev/null
+++ b/po/ro.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Ştergere"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Anulare"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Se permite"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Liber"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Se începe descărcarea..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Setări pentru site-uri web"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Reiniţializare la valori implicite"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Nume utilizator"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Se solicită autentificare."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Reţinere preferinţe"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Reîmprospătare automată"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Parolă"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Au apărut probleme privind certificatul de securitate pentru acest site."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notificare Web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) încearcă să salveze un volum mare de date pe dispozitivul dvs. pentru utilizarea offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) solicită permisiunea de a salva date pe dispozitivul dvs. pentru utilizarea offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) solicită permisiunea de a vă accesa locaţia."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) solicită permisiunea de a afişa notificări."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) solicită permisiunea de a vă utiliza camera foto."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Ecran complet"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Accesarea locaţiei utilizatorului"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Utilizarea/stocarea datelor web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Utilizarea conţinutului media al utilizatorului"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Permite acestui site să acceseze informaţiile privind locaţia dvs."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Permite acestui site să salveze un volum mare de date pe dispozitivul dvs."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Permite acestui site să treacă la afişarea pe ecran complet."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Permite acestui site să utilizeze fişierele media stocate pe dispozitivul dvs."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Permite acestui site să afişeze notificări."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Ştergeţi setările implicite ale aplicaţiei accesând Setări > General >Gestionare aplicaţii > Toate."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Refuzare"
+
diff --git a/po/ru_RU.po b/po/ru_RU.po
new file mode 100755 (executable)
index 0000000..8060d06
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Удалить"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Отмена"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Разрешить"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Пусто"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Начало загрузки..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Настройки веб-сайтов"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Восстановить настройки по умолчанию"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Имя пользователя"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Требуется проверка подлинности."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Запомнить настройки."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Автообновление"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Пароль"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Проблемы с сертификатом безопасности этого сайта."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Веб-уведомление"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) пытается сохранить большой объем данных на устройстве для использования в автономном режиме."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) запрашивает разрешение на хранение данных на устройстве для использования в автономном режиме."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) запрашивает разрешение на доступ к местоположению."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) запрашивает разрешение на отображение уведомлений."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) запрашивает разрешение на использование камеры."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Во весь экран"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Доступ к данным о местонахождении пользователя"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Использование/хранение веб-данных"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Использовать пользовательское мультимедиа"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Позволяет сайту получать доступ к данным о вашем местонахождении."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Позволяет сайту сохранять большой объем данных на устройстве."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Позволяет сайту переключаться в полноэкранный режим."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Позволяет приложению использовать файлы мультимедиа, хранящиеся на устройстве."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Позволяет сайту выводить уведомления."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Чтобы больше не использовать приложение по умолчанию, удалите его назначение в меню “Параметры” > “Общие” > “Управление приложениями” > “Все”."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Запретить"
+
diff --git a/po/si.po b/po/si.po
new file mode 100755 (executable)
index 0000000..90b03a3
--- /dev/null
+++ b/po/si.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "මකන්න"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "අව. කර"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "ඉඩ දෙන්න"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "හිස්"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "බාගැනුම අරඹමින්..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "වෙබ්අඩවි සැකසුම්"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "පෙරනිමියට නැවත සකසන්න"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "භාවිතා කරනනාගේ නම"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "සත්‍යාපනය අවශ්‍යයයි."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "කැමැත්ත මතක තබා ගන්න."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "ස්වයංව නැවුම් කරන්න"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "මුරපදය"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "මෙම අඩවිය සඳහා ආරක්ෂණ සහතිකයේ ප්‍රශ්න පවතී."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "වෙබ් දැනුම්දීම"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) නොබැඳි භාවිතය සඳහා ඔබගේ උපාංගය මත විශාල දත්ත ප්‍රමාණයක් ගබඩා කිරීමට උත්සාහ කරමින් සිටී."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) නොබැඳි භාවිතය සඳහා ඔබගේ උපාංගය මත දත්ත ගබඩා කිරීමට අවසරය ඉල්ලමින් සිටී."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) ඔබගේ පිහිටීම වෙත ප්‍රවේශ වීමට අවසර ඉල්ලමින් සිටී."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) දැනුම්දීම් පෙන්වීමට අවසර ඉල්ලමින් සිටී."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) ඔබගේ කැමරාව භාවිතා කිරීමට අවසරය ඉල්ලමින් සිටී."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "සම්පූර්ණ තිරය"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "පරිශීලක පිහිටීම ප්‍රවේශ වන්න"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "වෙබ දත්ත භාවිතා කරන්න/ගබඩා කරන්න"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "පරිශීලක මාධ්‍යය භාවිතා කරන්න"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "ඔබගේ පිහිටීම් තොරතුරු ප්‍රවේශ වීමට මෙම අඩවියට ඉඩ දෙයි."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "ඔබගේ උපාංගය මත විශාල දත්ත ප්‍රමාණයක් සුරැකීමට මෙම අඩවියට ඉඩ දෙයි."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "පුන් තිරය වෙත සංදර්ශනය වෙනස් කිරීමට මෙම අඩවියට ඉඩ දෙයි."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "ඔබගේ උපාංගය මත ගබඩා කර ඇති මාධ්‍ය ගොනු භාවිතා කිරීමට මෙම අඩවියට ඉඩ දෙයි."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "දැනුම්දීම් සංදර්ශනය කිරීමට මෙම අඩවියට ඉඩ දෙයි."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "සැකසුම් > සාමාන්‍ය > යෙදුම් කළමනාකරණය කරන්න > සියලු වෙත යාමෙන් පෙරනිමි යෙදුම් සැකසුම් හිස් කරන්න."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "ප්‍රතික්ෂේප කරන්න"
+
diff --git a/po/sk.po b/po/sk.po
new file mode 100755 (executable)
index 0000000..8fd9e46
--- /dev/null
+++ b/po/sk.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Odstrániť"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Zrušiť"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Povoliť"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Prázdny"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Spúšťa sa sťahovanie..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Nastavenia webovej lokality"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Obnoviť predvolené"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Užívateľské meno"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Vyžaduje sa overenie."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Zapamätať predvoľbu"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automatické obnovenie"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Heslo"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Vyskytli sa problémy s bezpečnostným certifikátom pre túto lokalitu."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Webové oznámenie"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) sa pokúša uložiť veľké množstvo údajov do vášho zariadenia na používanie v režime offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) žiada o povolenie uložiť údaje do vášho zariadenia na používanie v režime offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) žiada o povolenie na prístup k vášmu umiestneniu."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) žiada o povolenie zobrazovať oznámenia."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) žiada o povolenie používať váš fotoaparát."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Celá obrazovka"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Prístup k lokalizačným informáciám používateľa"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Používanie/ukladanie webových údajov"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Používanie používateľských médií"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Umožňuje tejto lokalite prístup k vašim lokalizačným informáciám."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Umožňuje tejto lokalite ukladať veľké objemy údajov do zariadenia."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Umožňuje tejto lokalite prepnúť zobrazenie na celú obrazovku."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Umožňuje tejto lokalite používať mediálne súbory uložené v zariadení."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Umožňuje tejto lokalite zobrazovať oznámenia."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Vymažte predvolené nastavenia aplikácie v menu Nastavenia > Všeobecné > Spravovať aplikácie > Všetky."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Odmietnuť"
+
diff --git a/po/sl.po b/po/sl.po
new file mode 100755 (executable)
index 0000000..d4f0db1
--- /dev/null
+++ b/po/sl.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Izbriši"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Prekliči"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Dovoli"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Prazno"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Začenjam prenos ..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Nastavitve spletnega mesta"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Ponastavi na privzeto"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Uporabniško ime"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Potrebno je overjanje."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Zapomni si prednostne nastavitve."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Samodejno osveževanje"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Geslo"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Za to spletno mesto obstajajo težave z varnostnim certifikatom."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Spletno obvestilo"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) poskuša shraniti veliko količino podatkov v vašo napravo za uporabo brez povezave."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) zahteva dovoljenje za shranjevanje podatkov v vašo napravo za uporabo brez povezave."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) zahteva dovoljenje za dostop do vaše lokacije."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) zahteva dovoljenje za prikaz obvestil."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) zahteva dovoljenje za uporabo kamere."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Celotni zaslon"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Dostop do lokacije uporabnika"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Uporaba/shranjevanje spletnih podatkov"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Uporaba uporabniških medijev"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Temu spletnemu mestu omogoča dostop do lokacijskih podatkov."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Temu spletnemu mestu omogoča shranjevanje velikih količin podatkov v napravo."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Temu spletnemu mestu omogoča spreminjanje v celozaslonski način prikaza."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Temu spletnemu mestu omogoča uporabo predstavnostnih datotek, shranjenih v napravi."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Temu spletnemu mestu omogoča prikaz obvestil."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Izbrišite privzete nastavitve aplikacije v meniju Nastavitve > Splošno > Upravljanje aplikacij > Vse."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Zavrnjeno"
+
diff --git a/po/sr.po b/po/sr.po
new file mode 100755 (executable)
index 0000000..1f26f69
--- /dev/null
+++ b/po/sr.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Obriši"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Poništi"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Dozvoli"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Prazno"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Počinje preuzimanje..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Podešavanja sajta"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Resetuj na podrazumevano"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Korisničko ime"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Potrebna je autentikacija."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Zapamti željenu vrednost."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Automatsko osvežavanje"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Šifra"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Postoje problemi sa bezbednosnim sertifikatom za ovaj sajt."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web obaveštenje"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) pokušava da sačuva veliku količinu podataka na tvoj uređaj za offline korišćenje."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) traži dozvolu da sačuva podatke na tvoj uređaj za offline korišćenje."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) traži dozvolu za pristup tvojoj lokaciji."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) traži dozvolu za prikazivanje obaveštenja."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) traži dozvolu za korišćenje tvoje kamere."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Celi ekran"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Pristup lokaciji korisnika"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Korišćenje/čuvanje web podataka"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Koristi korisničke medije"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Dozvoljava ovom sajtu da pristupi informacijama o tvojoj lokaciji."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Dozvoljava ovom sajtu da sačuva veliku količinu podataka na tvoj uređaj."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Dozvoljava ovom sajtu da promeni prikaz na pun ekran."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Dozvoljava ovom sajtu da koristi medijske fajlove koji se čuvaju na tvom uređaju."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Dozvoljava ovom sajtu da prikaže obaveštenja."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Obriši podrazumevana podešavanja aplikacije u okviru Podešavanja > Opšte > Upravljanje aplikacijama > Sve."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Odbijeno"
+
diff --git a/po/sv.po b/po/sv.po
new file mode 100755 (executable)
index 0000000..5ce5937
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Radera"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Avbryt"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Tillåt"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Tom"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Startar hämtning..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Webbplatsinställningar"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Återställ till standard"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Användarnamn"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Verifiering krävs."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Kom ihåg preferens."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Uppdatera automatiskt"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Lösenord"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Det är problem med säkerhetscertifikatet för denna plats."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Webbmeddelande"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) försöker att lagra en stor mängd data på din enhet för användning offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) begär tillstånd för att lagra en stor mängd data på din enhet för användning offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) begär tillstånd om åtkomst till din plats."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) begär tillstånd för att visa meddelanden."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) begär tillstånd för att använda kameran."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Helskärm"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Åtkomst till användarens plats"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Använd/lagra webbdata"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Använd användarmedia"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Gör det möjligt för den här webbplatsen att få åtkomst till din platsinformation."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Gö det möjligt för den här webbplatsen att spara en stor mängd data på din enhet."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Gör det möjligt den här webbplatsen att byta till helskärmsvisning."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Gör det möjligt för den här ewbbplatsen att använda mediefiler som sparats på din enhet."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Gör det möjligt den här webbplatsen att visa meddelanden."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Rensa standardprograminställningarna genom att gå till Inställningar > Allmänt > Hantera program > Alla."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Avvisa"
+
diff --git a/po/ta.po b/po/ta.po
new file mode 100755 (executable)
index 0000000..956c3c2
--- /dev/null
+++ b/po/ta.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "நீக்கு"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "ரத்து"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "அனுமதி"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "காலி"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "பதிவிறக்கம் துவங்குகிறது..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "இணைய அமைவுகள்"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "டீஃபால்ட்டிற்கு ரீசெட் செய்க"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "பயனர் பெயர்"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "அங்கீகரிப்பு தேவை."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "முன்னுரிமையை நினைவுகொள்."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "தானியங்கு புதுப்பிப்பு"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "கடவுச்சொல்"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "இந்த இணையதளத்திற்கான பாதுகாப்பு சான்றிதழில் சில சிக்கல்கள் உள்ளன."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "இணைய அறிவிப்பு"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ஆஃப்லைன் உபயோகத்திற்காக உங்கள் சாதனத்தில் அதிகளவு தரவுகளைச் சேமிக்க முயற்சிக்கிறது."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) ஆஃப்லைன் உபயோகத்திற்காக உங்கள் சாதனத்தில் தரவுகளைச் சேமிக்க அனுமதி கோருகிறது."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) உங்கள் இருப்பிடத்தை அணுக அனுமதி கோருகிறது."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) அறிவிக்கைகளைக் காட்டுவதற்கு அனுமதி கோருகிறது."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) உங்கள் கேமராவை உபயோகிக்க அனுமதி கோருகிறது."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "முழு திரை"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "பயனர் இருப்பிடத்தை அணுகுதல்"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "வலை தரவைப் பயன்படுத்தவும்/சேமிக்கவும்"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "பயனர் ஊடகம் பயன்படுத்துக"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "உங்கள் இருப்பிட விபரம் அணுக இந்தத் தளத்தை அனுமதிக்கிறது."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "உங்கள் சாதனத்தில் பெரிய அளவிலான தரவைச் சேமிக்கவென இந்தத் தளத்தை அனுமதிக்கிறது."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "காட்சியை முழுத் திரைக்கு மாற்ற இந்தத் தளத்தை அனுமதிக்கிறது."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "உங்கள் சாதனத்தில் சேமிக்கப்பட்டுள்ள ஊடக கோப்புகளைப் பயன்படுத்த இந்தத் தளத்தை அனுமதிக்கிறது."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "அறிவிப்புகளைக் காண்பிக்க இந்தத் தளத்தை அனுமதிக்கிறது."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "அமைவுகள் > பொது > பயன்பாடுகளை நிர்வகி > அனைத்துக்குச் சென்று இயல்புநிலை பயன்பாடு அமைவுகளை அழிக்கவும்."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "மறுக்கவும்"
+
diff --git a/po/te.po b/po/te.po
new file mode 100755 (executable)
index 0000000..84ec023
--- /dev/null
+++ b/po/te.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "తొలగించు"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "రద్దు"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "అనుమతించు"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ఖాళీ"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "డౌన్లోడ్ ప్రారంభమవుతోంది..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "వెబ్‌సైట్‌ సెట్టింగులు"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "డిఫాల్ట్‌ కు రీసెట్ చేయి"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "యూజర్ పేరు"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "ప్రమాణీకరణ అవసరం."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "ప్రాధాన్యతను గుర్తుపెట్టుకోండి."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "స్వయంచాలక రీఫ్రెష్"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "పాస్వర్డ్"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "ఈ సైట్ కు సెక్యూరిటీ సర్టిఫికెట్లనుండి సమస్యలు ఉన్నాయి."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "వెబ్ నోటిఫికేషన్"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) మీ పరికరంలో ఆఫ్‌లైన్ ఉపయోగం కోసం అధిక మొత్తంలో డేటాని నిల్వ చేయడానికి ప్రయత్నిస్తోంది."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) మీ పరికరంలో ఆఫ్‌లైన్ ఉపయోగం కోసం డేటాని నిల్వ చేయడానికి అనుమతిని అభ్యర్థిస్తోంది."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) మీ స్థానాన్ని యాక్సెస్ చేయడానికి అనుమతిని అభ్యర్థిస్తోంది."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) నోటిఫికేషన్‌లను చూపడానికి అనుమతిని అభ్యర్థిస్తోంది."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) మీ కెమెరాని ఉపయోగించడానికి అనుమతిని అభ్యర్థిస్తోంది."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "ఫుల్ స్క్రీన్"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "వినియోగదారు స్థానాన్ని యాక్సెస్ చేయి"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "వెబ్ డేటాని ఉపయోగించండి/నిల్వ చేయండి"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "వినియోగదారు మీడియాని ఉపయోగించు"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "మీ స్థానం సమాచారాన్ని యాక్సెస్ చేయడానికి ఈ సైట్‌ని అనుమతిస్తుంది."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "మీ పరికరంలో అధిక మొత్తంలో డేటాని సేవ్ చేయడానికి ఈ సైట్‌ని అనుమతిస్తుంది."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "ప్రదర్శనని పూర్తి స్క్రీన్‌కి మార్చడానికి ఈ సైట్‌ని అనుమతిస్తుంది."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "మీ పరికరంలో నిల్వ చేసిన మీడియా ఫైల్‌లను ఉపయోగించడానికి ఈ సైట్‌ని అనుమతిస్తుంది."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "నోటిఫికేషన్‌లను ప్రదర్శించడానికి ఈ సైట్‌ని అనుమతిస్తుంది."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "సెట్టింగ్‌లు > సాధారణం > అప్లికేషన్‌లను నిర్వహించు > అన్నీకి వెళ్లడం ద్వారా డిఫాల్ట్ అప్లికేషన్ సెట్టింగ్‌లను క్లియర్ చేయండి."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "నిరాకరించు"
+
diff --git a/po/th.po b/po/th.po
new file mode 100755 (executable)
index 0000000..cab8310
--- /dev/null
+++ b/po/th.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "ลบ"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "ยกเลิก"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "อนุญาต"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "ว่าง"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "กำลัง​เริ่ม​ดาวน์​โหลด..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "การ​ตั้ง​ค่า​เว็บ​ไซ​ต์"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "รี​เซ็ท​เป็น​ค่า​พื้น​ฐาน"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "ชื่อ​ผู้​ใช้"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "ต้อง​การ​การ​รับรอง"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "จดจำค่าที่เตรียมไว้"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "รีเฟรชอัตโนมัติ"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "รหัสผ่าน"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "มี​ปัญหา​การ​รับรอง​ความ​ปลอดภัย​สำ​หรับ​ไซ​ต์​นี้"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "การแจ้งเตือนเว็บ"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) กำลังพยายามจัดเก็บข้อมูลจำนวนมาก ลงในอุปกรณ์ของคุณสำหรับใช้งานแบบออฟไลน์"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) กำลังขออนุญาตให้จัดเก็บข้อมูล ลงบนอุปกรณ์ของคุณ สำหรับใช้งานแบบออฟไลน์"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) กำลังขออนุญาต เพื่อเข้าถึงตำแหน่งของคุณ"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) กำลังขออนุญาตให้แสดง การแจ้งเตือน"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) กำลังขออนุญาต เพื่อใช้กล้องของคุณ"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "เต็ม​หน้า​จอ"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "เข้าถึงตำแหน่งของผู้ใช้"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "ใช้/เก็บข้อมูลเว็บ"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "ใช้มีเดียผู้ใช้"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "อนุญาตให้ไซต์นี้เข้าถึง ข้อมูลตำแหน่งของคุณได้"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "อนุญาตให้ไซต์นี้บันทึกข้อมูลจำนวนมาก บนอุปกรณ์ของคุณได้"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "อนุญาตให้ไซต์นี้เปลี่ยนข้อมูล ที่แสดงเป็นเต็มหน้าจอได้"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "อนุญาตให้ไซต์นี้ใช้ไฟล์มีเดีย ที่เก็บอยู่บนอุปกรณ์ของคุณได้"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "อนุญาตให้ไซต์นี้แสดงการแจ้งเตือนได้"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "ล้างการตั้งค่าแอพพื้น​ฐาน​โดยไปที่ การตั้งค่า > ทั่วไป > จัดการแอพพลิเคชั่น > ทั้งหมด"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "ปฏิเสธ"
+
diff --git a/po/tl.po b/po/tl.po
new file mode 100755 (executable)
index 0000000..62c7e9e
--- /dev/null
+++ b/po/tl.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "I-delete"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Ikansela"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Payagan"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Walang laman"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Sinisimulan ang pag-download..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Mga setting ng website"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "I-reset sa default"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Username"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Kailangan ng pagpapatunay"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Tandaan ang preferences."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Auto refresh"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Password"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Mayroong mga problema sa katibayan sa seguridad para sa site na ito."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Notification sa web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "Sinusubukan ni %1$s (%2$s) na mag-store ng malaking halaga ng data sa iyong device para sa paggamit offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "Si %1$s (%2$s) ay humihiling ng pahintulot na mag-store ng data sa iyong device para sa paggamit offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "Si %1$s (%2$s) ay humihiling ng pahintulot na ma-access ang iyong lokasyon."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "Si %1$s (%2$s) ay humihiling ng pahintulot na magpakita ng mga notification."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "Si %1$s (%2$s) ay humihiling ng pahintulot na gamitin ang iyong camera."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Buong screen"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "I-access ang lokasyon ng user"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Gamitin/i-store ang data sa web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Gamitin ang media ng user"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Pinapayagan ang site na ito na ma-access ang impormasyon ng iyong lokasyon."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Pinapayagan ang site na ito na mag-save ng maraming data sa iyong device."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Pinapayagan ang site na ito na gawing buong screen ang display."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Pinapayagan ang site na ito na gamitin ang mga media file na naka-store sa iyong device."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Pinapayagan ang site na ito na magpakita ng mga abiso."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "I-clear ang default na mga setting ng app sa pamamagitan ng pagpunta sa Mga Setting > Pangkalahatan > Pamahalaan ang mga application > Lahat."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Tanggihan"
+
diff --git a/po/tr_TR.po b/po/tr_TR.po
new file mode 100755 (executable)
index 0000000..a1438f2
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Sil"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "İptal"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "İzin ver"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Boş"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "İndirme başlıyor..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Websitesi ayarları"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Varsayılan olarak sıfırla"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Kullanıcı adı"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Kimlik denetimi gerekli"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Tercihi hatırla"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Otomatik yenileme"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Şifre"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Bu siteyle ilgili güvenlik sertifikasında sorunlar var"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Web bildirimi"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) çevrim dışı kullanım için cihazınıza büyük miktarda veri saklamayı deniyor"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) çevrim dışı kullanım için cihazınıza veri depolamak üzere izin istiyor"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) konumunuza erişmek için izin istiyor"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) bildirimleri göstermek için izin istiyor"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) kameranızı kullanmak için izin istiyor"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Tam ekran"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Kullanıcı konumuna eriş"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Web verilerini kullan/kaydet"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Kullanıcı ortamını kullan"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Bu sitenin konum bilgilerinize ulaşmasına izin verir"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Bu sitenin cihazınıza büyük miktarda veri kaydetmesine izin verir"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Bu sitenin ekranı tam ekrana değiştirmesine izin verir"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Bu sitenin cihazınıza yüklü ortam dosyalarını kullanmasına izin verir"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Bu sitenin bildirimleri görüntülemesine izin verir"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Ayarlar > Genel > Uygulamaları yönet > Tümü seçeneğine giderek varsayılan uygulama ayarlarını silin"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Geri çevir"
+
diff --git a/po/uk.po b/po/uk.po
new file mode 100755 (executable)
index 0000000..541c026
--- /dev/null
+++ b/po/uk.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Видалити"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Скасувати"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Дозволити"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Пусто"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Початок завантаження..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Установки веб-сайта"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Скинути на стандартні"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Ім'я користувача"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Потрібна аутентифікація."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Запам’ятати параметр."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Автоматичне оновлення"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Пароль"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Проблеми із сертифікатом безпеки для цього сайту."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Веб-сповіщення"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) намагається зберегти великий об'єм даних на пристрої для автономного використання."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) запитує дозвіл на збереження даних на пристрої для автономного використання."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) запитує дозвіл на отримання доступу до вашого розташування."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) запитує дозвіл на відображення сповіщень."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) запитує дозвіл на використання камери."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Повноекранний режим"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Доступ до даних щодо розташування користувача"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Використання/збереження веб-даних"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Використання медіафайлів користувача"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Дозволяє цьому сайту отримувати доступ до відомостей про розташування."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Дозволяє цьому сайту зберігати великий об'єм даних на пристрої."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Дозволяє цьому сайту змінювати режим дисплею на повноекранний."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Дозволяє цьому сайту використовувати медіафайли, збережені на пристрої."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Дозволяє цьому сайту відображати сповіщення."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Щоб очистити стандартні установки програм, перейдіть до розділу «Установки» > «Загальні» > «Керування програмами» > «Усі»."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Відмовити"
+
diff --git a/po/ur.po b/po/ur.po
new file mode 100755 (executable)
index 0000000..8355aff
--- /dev/null
+++ b/po/ur.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "مٹانا"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "منسوخ"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "اجازت دیں"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "خالی"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "ڈاؤن لوڈ شروع کررہا ہے..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "ویب سائٹ سیٹنگز"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "فطری پر پھر سیٹ کریں"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "استمعال کنندہ کا نام"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "اتھینٹیکیشن ضروری۔"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "ترجیح یاد رکھیں"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "خودکار تازہ کریں"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "پاس ورڈ"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "اس سائٹ کے لئے سلامتی کی سند میں مسائل ہیں"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "ویب اعلامیہ"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) آف لائن استعمال کے لئے آپ کے آلہ پر ڈیٹا کی ایک بڑی مقدار ذخیرہ کرنے کی کوشش کررہا ہے"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) آف لائن استعمال کے لئے آپ کے آلہ پر ڈیٹا ذخیرہ کرنے کی اجازت کی درخواست کررہا ہے"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) آپ کے محل وقوع پر رسائی کرنے کی اجازت کی درخواست کررہا ہے"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) اعلانات دکھانے کی اجازت کی درخواست کررہا ہے"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) آپ کا کیمرہ استعمال کرنے کی اجازت کی درخواست کررہا ہے"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "فل سکرین"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "صارف محل وقوع رسائی کریں"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "استعمال/ویب ڈیٹا ذخیرہ کریں"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "صارف میڈیا استعمال کریں"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "اس سائٹ کو اپنی محل وقوع معلومات پر رسائی کرنے کی اجازت دیتا ہے۔"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "اس سائٹ کو آپ کے آلہ پر ڈیٹا کی ایک بڑی مقدار محفوظ کرنے کی اجازت دیتا ہے۔"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "اس سائٹ کو ڈسپلے کو پوری اسکرین پر تبدیل کرنے کی اجازت دیتا ہے۔"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "اس سائٹ کو آپ کے آلہ پر ذخیرہ کردہ میڈیا فائلیں استعمال کرنے کی اجازت دیتا ہے۔"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "اس سائٹ کو اعلانات ڈسپلے کرنے کی اجازت دیتا ہے۔"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "طے شدہ ایپلیکیشن سیٹنگز کو یہاں جا کر صاف کریں سیٹنگز > عمومی > ایپلیکیشنز بندوبست کریں > تمام"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "انکار کریں"
+
diff --git a/po/uz.po b/po/uz.po
new file mode 100755 (executable)
index 0000000..e9ff4a0
--- /dev/null
+++ b/po/uz.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "O'chirish"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Bekor q."
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Ruxsat"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Bo‘sh"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Yuklab olish boshlanmoqda..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Veb-sayt parametrlari"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Birlamchi o'rnatilgan holatiga tiklash"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Foydalanuvchi nomi"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Haqiqiylik tekshiruvi talab qilinadi."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Eslab qolish afzalligi."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Avtomatik yangilash"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Parol"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Ushbu sayt sertifikati bilan bog‘liq muammolar mavjud."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Veb-bildirishnoma"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) qurilmangizga offlayn foydalanish uchun katta hajmdagi ma’lumotni saqlashga urinmoqda."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) qurilmangizga offlayn foydalanish uchun ma’lumotni saqlashga ruxsat so‘ramoqda."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) joylashuvingizga kirish uchun ruxsat so‘ramoqda."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) bildirishnomalarni ko‘rsatish uchun ruxsat so‘ramoqda."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) kamerangizdan foydalanish uchun ruxsat so‘ramoqda."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "To‘liq ekran"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Foydalanuvchi joylashuviga kirish"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Veb-ma’lumotni ishlatish/saqlash"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Foydalanuvchi mediasidan foydalanish"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Ushbu saytga joylashuvingiz ma’lumotlariga kirish uchun ruxsat beradi."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Ushbu saytga qurilmangizda ko‘p miqdordagi ma’lumotlarni saqlash uchun ruxsat beradi."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Ushbu saytga displeyni to‘liq ekranga o‘zgartirish uchun ruxsat beradi."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Ushbu saytga qurilmangizda saqlangan media fayllardan foydalanish uchun ruxsat beradi."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Ushbu saytga bildirishnomalarni aks ettirish uchun ruxsat beradi."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Parametrlar > Umumiy > Ilovalarni boshqarish > Barchasiga o‘tish orqali birlamchi ilova parametrlarini tozalang."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Rad etish"
+
diff --git a/po/vi.po b/po/vi.po
new file mode 100755 (executable)
index 0000000..565a502
--- /dev/null
+++ b/po/vi.po
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "Xóa"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Hủy"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Cho phép"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "Trống"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "Đang bắt đầu tải về..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "Cài đặt website"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Đặt lại về mặc định"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "Tên người dùng"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "Yêu cầu xác thực."
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "Nhớ Cài đặt sở thích."
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "Tự động làm mới"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "Mật mã"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "Có vấn đề về chứng chỉ bảo mật cho site này."
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "Thông báo web"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) đang cố gắng lưu trữ một lượng lớn dữ liệu vào thiết bị để sử dụng offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) đang yêu cầu lưu trữ dữ liệu trên thiết bị của bạn để dùng offline."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) đang yêu cầu quyền truy cập vị trí của bạn."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) đang yêu cầu quyền hiển thị thông báo."
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) đang yêu cầu quyền sử dụng máy ảnh của bạn."
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "Toàn màn hình"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "Truy cập vị trí người dùng"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "Sử dụng/lưu trữ dữ liệu web"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "Sử dụng media của người dùng"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "Cho phép trang này truy cập thông tin vị trí của bạn."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "Cho phép trang này lưu số lượng lớn dữ liệu trên thiết bị."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "Cho phép trang này chuyển sang hiển thị toàn màn hình."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "Cho phép trang này sử dụng file media lưu trên thiết bị."
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "Cho phép trang này hiển thị thông báo."
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "Xóa cài đặt ứng dụng mặc định bằng cách vào Cài đặt > Cài đặt chung > Quản lý ứng dụng > Tất cả."
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "Từ chối"
+
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100755 (executable)
index 0000000..53cecc7
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "删除"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "取消"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "允许"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "空白"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "正在开始下载..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "网站设置"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "重置为默认值"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "用户名"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "需要认证"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "记住首选项。"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "自动刷新"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "密码"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "此站点的安全证书存在问题。"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "网络通知"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) 正在尝试在您的设备上存储大量数据用于离线使用。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) 正在请求许可在您的设备上存储数据用于离线使用。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) 正在请求许可访问您的位置。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) 正在请求许可显示通知。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) 正在请求许可使用您的相机。"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "全屏显示"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "访问用户位置"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "使用/存储网络数据"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "使用用户媒体"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "请允许此站点访问您的位置数据。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "请允许此站点保存您设备上的大量数据。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "请允许此站点更改为全屏显示。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "请允许此站点使用储存在您设备上的媒体文件。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "请允许此站点显示通知。"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "通过进入设定 > 一般 > 管理应用程序 > 全部清除默认应用程序设置。"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "拒绝"
+
diff --git a/po/zh_HK.po b/po/zh_HK.po
new file mode 100755 (executable)
index 0000000..854a82d
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "刪除"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "取消"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "允許"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "空白"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "正在開始下載..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "網址設定"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "重設為預設"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "用戶名稱"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "需要認證"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "記住偏好。"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "自動重新整理"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "密碼"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "此網站的安全性證書存在問題。"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "網絡通知"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) 正嘗試在您的裝置上儲存大容量數據作為離線使用。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) 正在請求權限以於您的裝置上儲存數據作為離線使用。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) 正在請求授權以存取您的位置。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) 正在請求授權以顯示通知。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) 正在請求授權以使用您的相機。"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "全螢幕"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "存取用戶位置"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "使用/儲存網頁數據"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "使用用戶媒體"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "允許該網站存取您的位置資訊。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "允許該網站在您的裝置上儲存大量數據。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "允許該網站將顯示畫面變更為全螢幕。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "允許該網站使用儲存在您裝置上的媒體檔案。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "允許該網站顯示通知。"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "通過前往設定 > 一般 > 管理應用程式 > 全部,清除預設的應用程式設定。"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "拒絕"
+
diff --git a/po/zh_SG.po b/po/zh_SG.po
new file mode 100755 (executable)
index 0000000..95e5f7b
--- /dev/null
@@ -0,0 +1,87 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "删除"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "取消"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "允许"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "空白"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "正在开始下载..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "网络设置"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "Reset to default"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "用户名称"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "需要认证"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "记住首选项"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "密码"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "此站点的安全证书存在问题"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "网络通知"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) 正在尝试在您的设备上存储大量数据用于离线使用"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) 正在请求许可在您的设备上存储数据用于离线使用"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) 正在请求许可访问您的位置"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) 正在请求许可显示通知"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) 正在请求许可使用您的相机"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "全屏显示"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "访问用户位置"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "使用/存储网络数据"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "使用用户媒体"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "请允许此站点访问您的位置数据"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "请允许此站点保存您设备上的大量数据"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "请允许此站点更改为全屏显示"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "请允许此站点使用储存在您设备上的媒体文件"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "请允许此站点显示通知"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "通过进入设定 > 一般 > 管理应用程序 > 全部清除默认应用程序设置"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "否定"
+
diff --git a/po/zh_TW.po b/po/zh_TW.po
new file mode 100755 (executable)
index 0000000..c079103
--- /dev/null
@@ -0,0 +1,90 @@
+msgid "IDS_BR_SK_DELETE"
+msgstr "刪除"
+
+msgid "IDS_BR_SK_CANCEL"
+msgstr "取消"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "允許"
+
+msgid "IDS_BR_BODY_EMPTY"
+msgstr "空白"
+
+msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
+msgstr "正在開始下載..."
+
+msgid "IDS_BR_BODY_WEBSITE_SETTINGS"
+msgstr "網站設定"
+
+msgid "IDS_BR_BODY_RESET_TO_DEFAULT"
+msgstr "重設為預設值"
+
+msgid "IDS_BR_BODY_AUTHUSERNAME"
+msgstr "使用者名稱"
+
+msgid "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+msgstr "需要驗證"
+
+msgid "IDS_BR_BODY_REMEMBER_PREFERENCE"
+msgstr "記住偏好。"
+
+msgid "IDS_BR_HEADER_AUTO_REFRESH"
+msgstr "自動重新整理"
+
+msgid "IDS_BR_BODY_PASSWORD"
+msgstr "密碼"
+
+msgid "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"
+msgstr "此網站的安全憑證有問題。"
+
+msgid "IDS_BR_HEADER_WEB_NOTIFICATION"
+msgstr "網路通知"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) 正嘗試在您的裝置上儲存大容量資料作為離線使用。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE"
+msgstr "%1$s (%2$s) 正在請求權限以於您的裝置上儲存資料作為離線使用。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION"
+msgstr "%1$s (%2$s) 正在請求授權以存取您的位置。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS"
+msgstr "%1$s (%2$s) 正在請求授權以顯示通知。"
+
+msgid "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA"
+msgstr "%1$s (%2$s) 正在請求授權以使用您的相機。"
+
+msgid "IDS_BR_BODY_FULL_SCREEN"
+msgstr "全螢幕"
+
+msgid "IDS_WRT_OPT_ACCESS_USER_LOCATION"
+msgstr "存取使用者位置"
+
+msgid "IDS_WRT_OPT_USE_STORE_WEB_DATA"
+msgstr "使用/儲存網頁資料"
+
+msgid "IDS_WRT_OPT_USE_USER_MEDIA"
+msgstr "使用使用者媒體"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_ACCESS_YOUR_LOCATION_INFORMATION"
+msgstr "允許該網站存取您的位置資訊。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_SAVE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE"
+msgstr "允許該網站在您的裝置上儲存大量數據。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_CHANGE_THE_DISPLAY_TO_FULL_SCREEN"
+msgstr "允許該網站將顯示畫面變更為全螢幕。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_USE_THE_MEDIA_FILES_STORED_ON_YOUR_DEVICE"
+msgstr "允許該網站使用儲存在您裝置上的媒體檔案。"
+
+msgid "IDS_WRT_BODY_ALLOWS_THIS_SITE_TO_DISPLAY_NOTIFICATIONS"
+msgstr "允許該網站顯示通知。"
+
+msgid "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+msgstr "前往設定 > 一般  > 管理應用程式來清除預設的應用程式設定。"
+
+msgid "IDS_COM_BODY_DENY"
+msgstr "拒絕"
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8f3e851
--- /dev/null
@@ -0,0 +1,253 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+# @file     CMakeLists.txt
+# @author   Lukasz Wrzosek (l.wrzosek@samsung.com)
+# @version     1.0
+#
+
+GROUP_DEPS (WRT_BASIC_DEP DEPS
+    dpl-efl
+    dpl-dbus-efl
+    dpl-event-efl
+    dpl-utils-efl
+    wrt-popup-ace-runner
+    )
+
+GROUP_DEPS(SYS_WRT_BASIC_DEP DEPS
+    openssl
+    libpcrecpp
+    glib
+    libsoup
+    libiri
+    appsvc
+    cert-svc-vcore
+    edje
+    ecore
+    ecore-x
+    evas
+    eina
+    ewebkit2
+    elementary
+    vconf
+    cert-svc
+    ui-gadget-1
+    secure-storage
+    capi-appfw-app-manager
+    security-core
+    security-client
+    )
+# "smack-labeling-support-static" static library -------------------------------
+SET(SMACK_LABELING_SUPPORT_SOURCES
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/process_pool/smack_labeling_support.cpp
+    )
+SET(SMACK_LABELING_SUPPORT_INCLUDES
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/process_pool/
+   )
+INCLUDE_DIRECTORIES(
+    ${SMACK_LABELING_SUPPORT_INCLUDES}
+    ${libsmack_INCLUDE_DIRS}
+    )
+ADD_LIBRARY(${TARGET_SMACK_LABELING_SUPPORT_STATIC} STATIC
+    ${SMACK_LABELING_SUPPORT_SOURCES}
+    )
+TARGET_LINK_LIBRARIES(${TARGET_SMACK_LABELING_SUPPORT_STATIC}
+    ${libsmack_LIBRARIES}
+    )
+
+SET_TARGET_PROPERTIES(${TARGET_SMACK_LABELING_SUPPORT_STATIC} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+# "pre-launching-support-static" static library -------------------------------
+IF(WRT_ENABLE_PRE_LAUNCH)
+  SET(PRE_LAUNCHING_SUPPORT_SOURCES
+      ${PROJECT_SOURCE_DIR}/src/pre-launching/pre_launching_support.cpp
+      )
+  SET(PRE_LAUNCHING_SUPPORT_INCLUDES
+      ${PROJECT_SOURCE_DIR}/src/pre-launching
+    )
+  INCLUDE_DIRECTORIES(
+      ${PRE_LAUNCHING_SUPPORT_INCLUDES}
+      ${aul_INCLUDE_DIRS}
+      ${appcore-efl_INCLUDE_DIRS}
+      ${bundle_INCLUDE_DIRS}
+      ${aul_INCLUDE_DIRS}
+      )
+  ADD_LIBRARY(${TARGET_LAUNCHING_SUPPORT_STATIC} STATIC
+      ${PRE_LAUNCHING_SUPPORT_SOURCES}
+      )
+  TARGET_LINK_LIBRARIES(${PRE_LAUNCHING_SUPPORT_STATIC}
+      ${aul_LIBRARIES}
+      ${elementary_LIBRARIES}
+      ${appcore-efl_LIBRARIES}
+      )
+ENDIF(WRT_ENABLE_PRE_LAUNCH)
+
+# "client-support-static" static library -------------------------------
+SET(CLIENT_SUPPORT_SOURCES
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/client_command_line_parser.cpp
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/client_ide_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/client_orientation_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/client_submode_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/splash_screen_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/window_data.cpp
+    )
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+LIST(APPEND CLIENT_SUPPORT_SOURCES
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/web_app_manager.cpp
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/wrt-client-lite.cpp
+    )
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+SET(CLIENT_SUPPORT_INCLUDES
+    ${PROJECT_SOURCE_DIR}/src/api_new
+    ${PROJECT_SOURCE_DIR}/src/domain
+    ${PROJECT_SOURCE_DIR}/src/profiling
+    ${PROJECT_SOURCE_DIR}/src/wrt-client
+    )
+INCLUDE_DIRECTORIES(
+    ${CLIENT_SUPPORT_INCLUDES}
+    ${bundle_INCLUDE_DIRS}
+    ${efl-assist_INCLUDE_DIRS}
+    ${elementary_INCLUDE_DIRS}
+    )
+ADD_LIBRARY(${TARGET_CLIENT_SUPPORT_STATIC} STATIC
+    ${CLIENT_SUPPORT_SOURCES}
+    )
+TARGET_LINK_LIBRARIES(${TARGET_CLIENT_SUPPORT_STATIC}
+    ${bundle_LIBRARIES}
+    ${efl-assist_LIBRARIES}
+    ${elementary_LIBRARIES}
+    )
+
+SET_TARGET_PROPERTIES(${TARGET_CLIENT_SUPPORT_STATIC} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}" COMPILE_FLAGS "-include profiling_util.h")
+# ------------------------------------------------------------------------------
+
+#it is here, so no INCLUDE_DIRS and DEFINITIONS are passed there
+
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+# "wrt-event-loop" shared library ---------------------------------------
+SET(WRT_EVENT_LOOP_SOURCES
+    ${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/src/web_internal_eventloop.cpp
+)
+
+SET(WRT_EVENT_LOOP_INCLUDES
+    ${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/include
+)
+
+INCLUDE_DIRECTORIES(
+${WRT_EVENT_LOOP_INCLUDES}
+${elementary_INCLUDE_DIRS}
+)
+
+ADD_LIBRARY(${TARGET_WRT_EVENT_LOOP_LIB} SHARED
+    ${WRT_EVENT_LOOP_SOURCES}
+)
+
+TARGET_LINK_LIBRARIES(${TARGET_WRT_EVENT_LOOP_LIB}
+    ${elementary_LIBRARIES}
+)
+
+INSTALL(TARGETS ${TARGET_WRT_EVENT_LOOP_LIB}
+    DESTINATION lib/
+    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+    GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+)
+#---------------------------------------------------------------
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+SET(WRT_SRC_DIR
+   ${PROJECT_SOURCE_DIR}/src
+   )
+SET(WRT_CORE_BASE_SOURCES
+    ${WRT_SRC_DIR}/domain/application_data.cpp
+    ${WRT_SRC_DIR}/domain/localization_setting.cpp
+    ${WRT_SRC_DIR}/domain/main_thread.cpp
+    ${WRT_SRC_DIR}/domain/permission_popup_manager.cpp
+    ${WRT_SRC_DIR}/domain/widget_data_types.cpp
+    ${WRT_SRC_DIR}/domain/widget_deserialize_model.cpp
+    ${WRT_SRC_DIR}/domain/widget_model.cpp
+    )
+SET(WRT_CORE_INCLUDES
+    ${WRT_SRC_DIR}/domain
+    ${WRT_SRC_DIR}/profiling
+    ${WRT_SRC_DIR}/view
+    )
+
+IF(SMACK_ENABLED)
+  LIST(APPEND SYS_WRT_BASIC_DEP libprivilege-control)
+ENDIF(SMACK_ENABLED)
+
+#wrt-engine-static
+ADD_DEFINITIONS(
+    ${WRT_BASIC_DEP_CFLAGS}
+    ${SYS_WRT_BASIC_DEP_CFLAGS}
+    )
+ADD_DEFINITIONS(
+    ${WRT_BASIC_DEP_CFLAGS_OTHER}
+    ${SYS_WRT_BASIC_DEP_CFLAGS_OTHER}
+    )
+
+SET (PRE_LAUNCHING_SUPPORT_DEPS_LIBRARIES
+    ${aul_LIBRARIES}
+    ${appcore-efl_LIBRARIES}
+    ${bundle_LIBRARIES}
+    )
+
+INCLUDE_DIRECTORIES (
+    SYSTEM
+    ${SYS_WRT_BASIC_DEP_INCLUDE_DIRS}
+    )
+INCLUDE_DIRECTORIES (
+    ${WRT_BASIC_DEP_INCLUDE_DIRS}
+    ${WRT_CORE_INCLUDES}
+    )
+
+ADD_LIBRARY(${TARGET_WRT_ENGINE_STATIC} STATIC
+    ${WRT_CORE_BASE_SOURCES}
+    )
+
+SET_TARGET_PROPERTIES(${TARGET_WRT_ENGINE_STATIC} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_WRT_ENGINE_STATIC} PROPERTIES
+    SOVERSION ${PROJECT_API_VERSION}
+    VERSION ${PROJECT_VERSION})
+
+SET_TARGET_PROPERTIES(${TARGET_WRT_ENGINE_STATIC} PROPERTIES
+    COMPILE_FLAGS -fPIC)
+
+SET_TARGET_PROPERTIES(${TARGET_WRT_ENGINE_STATIC} PROPERTIES
+    COMPILE_FLAGS "-include profiling_util.h")
+
+INSTALL(FILES
+    ${WRT_SRC_DIR}/domain/widget_model.h
+    DESTINATION include/${PROJECT_NAME}
+)
+
+INSTALL(FILES
+    ${WRT_SRC_DIR}/domain/widget_data_types.h
+    DESTINATION include/${PROJECT_NAME}
+)
+
+ADD_SUBDIRECTORY(view)
+ADD_SUBDIRECTORY(api_new)
+ADD_SUBDIRECTORY(wrt-client)
+ADD_SUBDIRECTORY(wrt-launcher)
+IF(PROFILING)
+    ADD_SUBDIRECTORY(profiling)
+ENDIF(PROFILING)
+ADD_SUBDIRECTORY(wrt-launchpad-daemon)
diff --git a/src/DESCRIPTION b/src/DESCRIPTION
new file mode 100644 (file)
index 0000000..bc2b1d7
--- /dev/null
@@ -0,0 +1 @@
+Main source folder
diff --git a/src/api_new/CMakeLists.txt b/src/api_new/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0341a2d
--- /dev/null
@@ -0,0 +1,99 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+GROUP_DEPS(CORE_MODULE_DEP DEPS
+    dpl-efl
+    wrt-popup-wrt-runner
+    ail
+    )
+
+GROUP_DEPS(SYS_CORE_MODULE_DEP DEPS
+    libprivilege-control
+    )
+
+ADD_LIBRARY(${TARGET_CORE_MODULE_LIB} SHARED
+    ${PROJECT_SOURCE_DIR}/src/api_new/core_module.cpp
+    ${PROJECT_SOURCE_DIR}/src/api_new/runnable_widget_object.cpp
+    ${PROJECT_SOURCE_DIR}/src/api_new/runnable_widget_object_state.cpp
+    ${PROJECT_SOURCE_DIR}/src/api_new/security_support.cpp
+)
+
+SET_TARGET_PROPERTIES(${TARGET_CORE_MODULE_LIB} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_CORE_MODULE_LIB} PROPERTIES
+#    COMPILE_FLAGS "-include profiling_util.h"
+    OUTPUT_NAME ${TARGET_CORE_MODULE_LIB}
+)
+
+INCLUDE_DIRECTORIES(
+    ${CORE_MODULE_DEP_INCLUDE_DIRS}
+    ${CMAKE_CURRENT_SOURCE_DIR}
+)
+INCLUDE_DIRECTORIES(
+    SYSTEM
+    ${SYS_CORE_MODULE_DEP_INCLUDE_DIRS}
+)
+
+#
+#Set libraries that should be linked to the file that is linking wrt-core-module
+#Do not set any static libraries as it will be included in wrt-core-module
+#
+SET(WRT_CORE_MODULE_INTERFACE_LIBRARIES
+    ${CORE_MODULE_DEP_LIBRARIES}
+    ${SYS_CORE_MODULE_DEP_LIBRARIES}
+    ${WRT_BASIC_DEP_LIBRARIES}
+    ${SYS_WRT_BASIC_DEP_LIBRARIES}
+    ${Boost_LIBRARIES}
+)
+
+SET(WHOLE_ARCHIVE_LIBS
+    "-Wl,--whole-archive"
+    ${TARGET_WRT_ENGINE_STATIC}
+    ${TARGET_VIEW_COMMON_LIB_STATIC}
+)
+
+IF(WRT_ENABLE_PRE_LAUNCH)
+  LIST(APPEND WHOLE_ARCHIVE_LIBS ${TARGET_PRE_LAUNCHING_SUPPORT_STATIC})
+ENDIF(WRT_ENABLE_PRE_LAUNCH)
+
+SET(NO_WHOLE_ARCHIVE_LIBS
+    "-Wl,--no-whole-archive"
+    ${TARGET_VIEW_MODULE_LIB}
+    ${WRT_CORE_MODULE_INTERFACE_LIBRARIES}
+)
+
+TARGET_LINK_LIBRARIES(${TARGET_CORE_MODULE_LIB}
+    ${WHOLE_ARCHIVE_LIBS}
+    ${NO_WHOLE_ARCHIVE_LIBS}
+)
+
+SET_TARGET_PROPERTIES(${TARGET_CORE_MODULE_LIB}
+    PROPERTIES
+    LINK_INTERFACE_LIBRARIES "${WRT_CORE_MODULE_INTERFACE_LIBRARIES}"
+)
+
+INSTALL(TARGETS ${TARGET_CORE_MODULE_LIB}
+    DESTINATION lib/
+    PERMISSIONS OWNER_READ OWNER_WRITE
+    GROUP_READ GROUP_EXECUTE WORLD_READ
+)
+
+INSTALL(FILES
+    ${PROJECT_SOURCE_DIR}/src/api_new/core_module.h
+    ${PROJECT_SOURCE_DIR}/src/api_new/i_runnable_widget_object.h
+    ${PROJECT_SOURCE_DIR}/src/api_new/security_support.h
+    ${PROJECT_SOURCE_DIR}/src/api_new/user_delegates.h
+    DESTINATION include/${PROJECT_NAME}
+)
diff --git a/src/api_new/core_module.cpp b/src/api_new/core_module.cpp
new file mode 100644 (file)
index 0000000..862e991
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    core_module.cpp
+ * @author  Przemyslaw Ciezkowski (p.ciezkowski@samsung.com)
+ * @author  Andrzej Surdej (a.surdej@samsung.com)
+ * @version 1.0
+ * @brief   File contains definitions of wrt core module.
+ */
+
+#include "core_module.h"
+#include "runnable_widget_object.h"
+#include <string>
+#include <main_thread.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/assert.h>
+#include <dpl/exception.h>
+#include <dpl/singleton_impl.h>
+#include <dpl/optional_typedefs.h>
+#include "localization_setting.h"
+#include <dpl/wrt-dao-ro/global_config.h>
+#include <profiling_util.h>
+#include <widget_deserialize_model.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+
+IMPLEMENT_SINGLETON(WRT::CoreModule)
+
+namespace {
+const char* const TEXT_DOMAIN = "wrt";
+const char* const TEXT_LOCALE_PATH = "/usr/share/locale";
+
+std::string cutOffFileName(const std::string& path)
+{
+    size_t found = path.find_last_of("/");
+    if (found == std::string::npos) {
+        return path;
+    } else {
+        return path.substr(0, found);
+    }
+}
+
+bool isDir(const std::string& path)
+{
+    struct stat st;
+    if (0 == stat(path.c_str(), &st) && S_ISDIR(st.st_mode)) {
+        return true;
+    }
+    WrtLogE("Cannot access directory [ %s ]", path.c_str());
+    return false;
+}
+
+bool checkPaths()
+{
+    using namespace WrtDB;
+    using namespace WrtDB::GlobalConfig;
+
+    bool if_ok = true;
+    if_ok &= (isDir(cutOffFileName(GetWrtDatabaseFilePath())));
+    if_ok &= (isDir(GetDevicePluginPath()));
+    if_ok &= (isDir(GetUserInstalledWidgetPath()));
+    return if_ok;
+}
+} // namespace anonymous
+
+namespace WRT {
+class CoreModuleImpl
+{
+  public:
+
+    CoreModuleImpl() : m_initialized(false)
+    {
+        WrtLogD("enter");
+    }
+
+    ~CoreModuleImpl()
+    {
+        WrtLogD("Core module implementation destroyed");
+    }
+
+    bool Init()
+    {
+        if (!m_initialized) {
+            ADD_PROFILING_POINT("CoreModule::Init", "point");
+            WrtLogD("Initialize");
+            if (!checkPaths()) {
+                WrtLogE("Required path does not exist");
+                return false;
+            }
+            Try
+            {
+                ADD_PROFILING_POINT("attach databases", "start");
+                MainThreadSingleton::Instance().AttachDatabases();
+                ADD_PROFILING_POINT("attach databases", "stop");
+                WrtLogD("Initialize finished");
+            } catch (const DPL::Exception& ex) {
+                WrtLogE("Internal Error during screen preparation:");
+                DPL::Exception::DisplayKnownException(ex);
+                /* TODO:
+                 * Do deinitialization: check on which step exception occured
+                 * and deinitialize only initialized parts.
+                 */
+                return false;
+            }
+            bindtextdomain(TEXT_DOMAIN, TEXT_LOCALE_PATH);
+            m_initialized = true;
+        }
+        return true;
+    }
+
+    void Terminate()
+    {
+        MainThreadSingleton::Instance().DetachDatabases();
+        m_initialized = false;
+    }
+
+    RunnableWidgetObjectPtr getRunnableWidgetObject(
+        const std::string& tizenId)
+    {
+        try {
+            RunnableWidgetObjectPtr runnable;
+            WidgetModelPtr model =
+                Domain::deserializeWidgetModel(tizenId);
+            if (!!model) {
+                runnable.reset(new RunnableWidgetObject(model));
+            }
+            return runnable;
+        } catch (WrtDB::WidgetDAOReadOnly::Exception::WidgetNotExist) {
+            WrtLogE("Widget not found.");
+            return NULL;
+        } catch (DPL::Exception) {
+            WrtLogE("Error creating runnable object");
+            return NULL;
+        }
+    }
+
+  private:
+    bool m_initialized;
+};
+
+CoreModule::CoreModule() : m_impl(new CoreModuleImpl())
+{}
+
+CoreModule::~CoreModule()
+{}
+
+bool CoreModule::Init()
+{
+    return m_impl->Init();
+}
+
+void CoreModule::Terminate()
+{
+    return m_impl->Terminate();
+}
+
+RunnableWidgetObjectPtr CoreModule::getRunnableWidgetObject(
+    const std::string& tizenId)
+{
+    return m_impl->getRunnableWidgetObject(tizenId);
+}
+
+} /* namespace WRT */
diff --git a/src/api_new/core_module.h b/src/api_new/core_module.h
new file mode 100644 (file)
index 0000000..ba884dd
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    core_module.cpp
+ * @author  Przemyslaw Ciezkowski (p.ciezkowski@samsung.com)
+ * @authir  Andrzej Surdej (a.surdej@gmail.com)
+ * @version 1.0
+ * @brief   File contains declarations of wrt core module.
+ */
+
+#ifndef CORE_MODULE_H_
+#define CORE_MODULE_H_
+
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
+#include "i_runnable_widget_object.h"
+#include <dpl/singleton.h>
+#include <dpl/optional_typedefs.h>
+#include <memory>
+
+namespace WRT {
+class CoreModuleImpl; // forward declaration
+
+class CoreModule
+{
+  public:
+    /**
+     * Initialize needed by WRT components (database etc).
+     * Will not throw exception. elm_init() is NOT called in this function.
+     * You MUST call it before running widget.
+     * @return true on success, false when it fails
+     */
+    bool Init();
+    /**
+     * Deinitialize CoreModule. If it called without Init() some internal
+     * asserts will fail.
+     */
+    void Terminate();
+    /**
+     * Create model with given package name.
+     * Init must be called earlier. You MUST destroy all
+     * RunnableWidgetObjectPtr before calling Terminate.
+     * @param packageName
+     * @return NULL on fail
+     */
+    RunnableWidgetObjectPtr getRunnableWidgetObject(
+        const std::string& tizenId);
+
+  private:
+    CoreModule();
+    ~CoreModule();
+    std::unique_ptr<CoreModuleImpl> m_impl;
+
+    friend class DPL::Singleton<CoreModule>;
+};
+
+typedef DPL::Singleton<CoreModule> CoreModuleSingleton;
+} /* namespace WRT */
+#endif /* CORE_MODULE_H_ */
\ No newline at end of file
diff --git a/src/api_new/i_runnable_widget_object.h b/src/api_new/i_runnable_widget_object.h
new file mode 100644 (file)
index 0000000..4570c16
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    i_runnable_widget_object.h
+ * @author  Przemyslaw Ciezkowski (p.ciezkowski@samsung.com)
+ * @version 1.0
+ * @brief   File contains declaration of IRunnableWidgetObject interface.
+ */
+
+#ifndef RUNNABLE_WIDGET_OBJECT_INTERFACE_H_
+#define RUNNABLE_WIDGET_OBJECT_INTERFACE_H_
+
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
+#include <dpl/exception.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+#include <user_delegates.h>
+
+namespace WRT {
+
+/**
+ * @brief The IRunnableWidgetObject class Runnable object interface
+ *
+ * Interface for managing WRT widgets runnable object.
+ * Methods should be called in approopriatte order. Check graph below.
+ *
+ *    /----------->(INITIAL)
+ *    |                |
+ *    |                | PrepareView()
+ *    |                V
+ *    |            (PREPARED)
+ *    |                |
+ *    | Reset()        |
+ *    |                |
+ *    |                | Show()
+ *    |                V
+ *    |             (SHOWED)
+ *    |               /  ^
+ *    |     Suspend() |  | Resume()
+ *    |               V  /
+ *    |            (SUSPENDED)
+ *    |
+ *    |
+ *    |     (any state besides INITIAL)
+ *    |                |
+ *    |                | Hide()
+ *    |                V
+ *    \-------------(HIDDEN)
+ *
+ */
+class IRunnableWidgetObject
+{
+  public:
+    // IRunnableWidgetObject base exception
+    DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
+
+    // Throwed by any method if it is called in wrong state
+    DECLARE_EXCEPTION_TYPE(Base, MethodInvocationForbidden)
+
+    /**
+     * Prepares view to launch. You MUST call elm_init before calling
+     * this method.
+     * @param window
+     * @param callbacks passed to viewLogic
+     */
+    virtual bool PrepareView(const std::string &startUrl,
+                             Evas_Object *window,
+                             Ewk_Context* ewkContext = NULL) = 0;
+    /**
+     * Shows widget asynchronously. Callback will be called when
+     * webkit generates website.
+     * @param callback
+     */
+    virtual void Show() = 0;
+    /**
+     * Hides widget. To show it again Reset must be called.
+     */
+    virtual void Hide() = 0;
+    /**
+     * Stops widget's javascript. If widget has set background_enabled
+     * then this method has no effect. To resume use Resume();
+     */
+    virtual void Suspend() = 0;
+    /**
+     * Resumes widget's javascript after calling Suspend(). Resumes only if
+     * widget is in suspend state.
+     */
+    virtual void Resume() = 0;
+    /**
+     * Reload widgets After resize.
+     */
+    virtual void ReloadUrl(const std::string &startUrl) = 0;
+    /**
+     * Resets widgets after calling Hide().
+     */
+    virtual void Reset() = 0;
+    /**
+     * Reload start page on widget.
+     */
+    virtual void ReloadStartPage() = 0;
+    /**
+     * Retrieve widget's top level webview
+     * @return Evas_Object*
+     */
+    virtual Evas_Object* GetCurrentWebview() = 0;
+    /**
+     * Register widget's delegates
+     */
+    virtual void SetUserDelegates(const UserDelegatesPtr& cbs) = 0;
+    /**
+     * Call goBack() on webkit
+     */
+    virtual void Backward() = 0;
+    /**
+     * fire custom javascript event
+     */
+    virtual void FireJavascriptEvent(int event, void* data) = 0;
+
+    virtual void HandleLowMemory() = 0;
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    virtual void ResetAulConnection() = 0;
+
+    virtual void SendIDEReply(const std::string &msg) = 0;
+#endif
+    virtual ~IRunnableWidgetObject() {}
+};
+
+typedef std::shared_ptr<IRunnableWidgetObject> RunnableWidgetObjectPtr;
+}
+#endif /* RUNNABLE_WIDGET_OBJECT_INTERFACE_H_ */
+
diff --git a/src/api_new/runnable_widget_object.cpp b/src/api_new/runnable_widget_object.cpp
new file mode 100644 (file)
index 0000000..5e4307b
--- /dev/null
@@ -0,0 +1,305 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    runnable_widget_object.cpp
+ * @author  Przemyslaw Ciezkowski (p.ciezkowski@samsung.com)
+ * @version 1.0
+ * @brief   File contains defitinions of RunnableWidgetObject implementation.
+ */
+
+#include "runnable_widget_object.h"
+
+#include <signal.h>
+
+#include <appcore-common.h>
+#include <dpl/exception.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/utils/wrt_global_settings.h>
+#include <dpl/wrt-dao-ro/global_config.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <privilege-control.h>
+
+#include <message_support.h>
+#include <runnable_widget_object_state.h>
+#include <profiling_util.h>
+#include <security_support.h>
+#include <message_support.h>
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+#include <application_data.h>
+#endif
+
+namespace { //Anonymous
+const unsigned int UID_ROOT = 0;
+} // namespace anonymous
+
+namespace WRT {
+RunnableWidgetObject::RunnableWidgetObject(WidgetModelPtr &model) :
+        m_widgetModel(model),
+        m_view(ViewModule::createView()),
+        m_contextManagerFactoryMethod(ViewModule::makeContextManagerFactoryMethod())
+{
+    //set initial state of runnable object
+    m_guardstate = std::shared_ptr<State::RunnableWidgetObjectState>(
+            new State::InitialState(*this));
+    // If current uid is 'root', change privilege to apps
+    if (UID_ROOT == getuid()) {
+        // Set privilege by tizen id
+        // this code prevent that widget launch with "root" permission,
+        // when developers launch by command in the shell
+        if (!SecuritySupport::setAppPrivilege(
+                DPL::ToUTF8String(m_widgetModel->TizenId))) {
+            Throw(IRunnableWidgetObject::Base);
+        }
+    }
+}
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+static std::string createInitMessage(std::string appid)
+{
+    bundle* b = ApplicationDataSingleton::Instance().getBundle(appid);
+    if (!b) {
+        WrtLogE("Failed to get the bundle");
+        std::string retStr;
+        retStr = "1 " + appid; // 1 specifies argument count
+        return retStr;
+    }
+    char **argv;
+    int argc = bundle_export_to_argv(b, &argv);
+
+    std::stringstream ssMsg;
+    ssMsg << argc;
+    ssMsg << " " << appid;
+
+    for (int ittr = 1; ittr < argc; ++ittr) {
+        ssMsg << " " << argv[ittr];
+    }
+    bundle_free_exported_argv(argc, &argv);
+    return ssMsg.str();
+}
+#endif
+
+bool RunnableWidgetObject::PrepareView(const std::string &startUrl,
+        Evas_Object *window, Ewk_Context* ewkContext)
+{
+    State::StateChange change = m_guardstate->allowPrepareView();
+    if (!window) {
+        return false;
+    }
+
+    std::string appId = DPL::ToUTF8String(m_widgetModel->TizenId);
+    Try {
+        if(!m_ewkContextManager) {
+            m_ewkContextManager = m_contextManagerFactoryMethod(appId, ewkContext, m_view);
+        } else {
+            if (ewkContext &&
+                    ewkContext != m_ewkContextManager->getEwkContext())
+            {
+                m_ewkContextManager = m_contextManagerFactoryMethod(appId, ewkContext, m_view);
+            }
+        }
+    } Catch (DPL::Exception) {
+        WrtLogE("Internal Error during create or initialize Ewk Context");
+        return false;
+    }
+
+    ADD_PROFILING_POINT("view_logic_init", "start");
+    Ewk_Context* context = m_ewkContextManager->getEwkContext();
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    std::string msg = createInitMessage(DPL::ToUTF8String(m_widgetModel->TizenId));
+    // plugin init
+    ewk_context_message_post_to_injected_bundle(
+                    context,
+                    Message::ToInjectedBundle::INIT,
+                    msg.c_str());
+#else
+    // plugin init
+    ewk_context_message_post_to_injected_bundle(
+                    context,
+                    Message::ToInjectedBundle::INIT,
+                    DPL::ToUTF8String(m_widgetModel->TizenId).c_str());
+#endif
+    // view init
+    if(!m_view->createWebView(context, window)) {
+        return false;
+    }
+    m_view->prepareView(m_widgetModel.get(), startUrl);
+    ADD_PROFILING_POINT("view_logic_init", "stop");
+
+    change.commit();
+    return true;
+}
+
+void RunnableWidgetObject::Show()
+{
+    State::StateChange change = m_guardstate->allowShow();
+
+    m_view->showWidget();
+
+    change.commit();
+}
+
+void RunnableWidgetObject::Hide()
+{
+    State::StateChange change = m_guardstate->allowHide();
+
+    m_view->hideWidget();
+
+    change.commit();
+}
+
+void RunnableWidgetObject::Suspend()
+{
+    WrtLogD("Suspending widget");
+    State::StateChange change = m_guardstate->allowSuspend();
+    m_view->suspendWidget();
+
+    change.commit();
+}
+
+void RunnableWidgetObject::Resume()
+{
+    WrtLogD("Resuming widget");
+    State::StateChange change = m_guardstate->allowResume();
+    m_view->resumeWidget();
+
+    change.commit();
+}
+
+void RunnableWidgetObject::ReloadUrl(const std::string &startUrl)
+{
+    m_view->setWidgetUrl(startUrl);
+}
+
+void RunnableWidgetObject::Reset()
+{
+    WrtLogD("Reseting widget");
+    State::StateChange change = m_guardstate->allowReset();
+    if (m_guardstate->toString() == "SUSPENDED") {
+        m_view->resetWidgetFromSuspend();
+    } else {
+        // PREPARED, SECURITY_CHECKED, SHOWED
+        m_view->resetWidgetFromResume();
+    }
+
+    change.commit();
+}
+
+void RunnableWidgetObject::ReloadStartPage()
+{
+    m_view->reloadStartPage();
+}
+
+Evas_Object* RunnableWidgetObject::GetCurrentWebview()
+{
+    State::StateChange change = m_guardstate->allowGetCurrentWebview();
+
+    Evas_Object* cww = m_view->getCurrentWebview();
+
+    change.commit();
+    return cww;
+}
+
+void RunnableWidgetObject::SetUserDelegates(const UserDelegatesPtr& cbs)
+{
+    State::StateChange change = m_guardstate->allowSetUserDelegates();
+    m_view->setUserCallbacks(cbs);
+    change.commit();
+}
+
+void RunnableWidgetObject::Backward()
+{
+    State::StateChange change = m_guardstate->allowBackward();
+    m_view->backward();
+
+    change.commit();
+}
+
+void RunnableWidgetObject::FireJavascriptEvent(int event, void* data)
+{
+    State::StateChange change = m_guardstate->allowFireJavascriptEvent();
+    m_view->fireJavascriptEvent(event, data);
+
+    change.commit();
+}
+
+void RunnableWidgetObject::setViewModule(ViewModule::IViewModulePtr ptr)
+{
+    WrtLogD("Setting ViewModule");
+    m_view = ptr;
+}
+
+void RunnableWidgetObject::setContextManagerFactoryMethod(
+        ViewModule::ContextManagerFactoryMethod method)
+{
+    WrtLogD("Setting ContextManagerFactoryMethod");
+    m_contextManagerFactoryMethod = method;
+}
+
+void RunnableWidgetObject::setNewState(
+    std::shared_ptr<State::RunnableWidgetObjectState> sptr)
+{
+    WrtLogD("RunnableWidgetObject changes state to: %s", sptr->toString().c_str());
+    m_guardstate = sptr;
+}
+
+void RunnableWidgetObject::HandleLowMemory()
+{
+    WrtLogD("RunnableWidgetObject HandleLowMemory");
+    m_ewkContextManager->handleLowMemory();
+}
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+void RunnableWidgetObject::ResetAulConnection()
+{
+    WrtLogD("Reset aul connection");
+    Ewk_Context* context = m_ewkContextManager->getEwkContext();
+    ewk_context_message_post_to_injected_bundle(
+                    context,
+                    Message::ToInjectedBundle::RESET_AUL_CONNECTION,
+                    DPL::ToUTF8String(m_widgetModel->TizenId).c_str());
+}
+
+void RunnableWidgetObject::SendIDEReply(const std::string &msg)
+{
+    WrtLogD("SendIDEReply");
+    if (!msg.empty()) {
+        Ewk_Context* context = m_ewkContextManager->getEwkContext();
+        ewk_context_message_post_to_injected_bundle(
+                        context,
+                        Message::ToInjectedBundle::REPLY_CLIENT,
+                        msg.c_str());
+    }
+}
+#endif
+
+RunnableWidgetObject::~RunnableWidgetObject()
+{
+    WrtLogD("");
+    if(m_ewkContextManager)
+    {
+        ewk_context_message_post_to_injected_bundle(
+            m_ewkContextManager->getEwkContext(),
+            Message::ToInjectedBundle::SHUTDOWN,
+            DPL::ToUTF8String(m_widgetModel->TizenId).c_str());
+    }
+    else
+    {
+        WrtLogE("ewk context manager is null");
+    }
+}
+} /* namespace WRT */
diff --git a/src/api_new/runnable_widget_object.h b/src/api_new/runnable_widget_object.h
new file mode 100644 (file)
index 0000000..32e4177
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    core_module.cpp
+ * @author  Przemyslaw Ciezkowski (p.ciezkowski@samsung.com)
+ * @version 1.0
+ * @brief   File contains defitinions of RunnableWidgetObject implementation.
+ */
+
+#ifndef RUNNABLE_WIDGET_OBJECT_H_
+#define RUNNABLE_WIDGET_OBJECT_H_
+
+//forward declaration
+namespace WRT {
+namespace State {
+class RunnableWidgetObjectState;
+class StateChange;
+}
+}
+
+#include "i_runnable_widget_object.h"
+
+#include <string>
+#include <memory>
+
+#include <widget_model.h>
+#include <dpl/exception.h>
+#include <i_view_module.h>
+#include <i_context_manager.h>
+
+namespace WRT {
+class RunnableWidgetObject : public IRunnableWidgetObject
+{
+public:
+    RunnableWidgetObject(WidgetModelPtr &model);
+    virtual ~RunnableWidgetObject();
+
+    bool PrepareView(const std::string &startUrl,
+            Evas_Object *window, Ewk_Context* ewkContext = NULL);
+    void Show(); //asynchronous function
+    void Hide();
+    void Suspend();
+    void Resume();
+    void Reset();
+    void ReloadUrl(const std::string &startUrl);
+    void ReloadStartPage();
+    Evas_Object* GetCurrentWebview();
+    void SetUserDelegates(const UserDelegatesPtr& cbs);
+    void Backward();
+    void FireJavascriptEvent(int event, void* data);
+
+    void setViewModule(ViewModule::IViewModulePtr ptr);
+    void setContextManagerFactoryMethod(ViewModule::ContextManagerFactoryMethod method);
+    void HandleLowMemory();
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    void ResetAulConnection();
+    void SendIDEReply(const std::string &msg);
+#endif
+  private:
+
+    bool CheckWACTestCertififedWidget();
+    void setNewState(std::shared_ptr<WRT::State::RunnableWidgetObjectState> sptr);
+
+    WidgetModelPtr m_widgetModel;
+    ViewModule::IViewModulePtr m_view;
+    std::shared_ptr<State::RunnableWidgetObjectState> m_guardstate;
+    ViewModule::ContextManagerPtr m_ewkContextManager;
+
+    //factor method to be used for creation of context manager when needed
+    ViewModule::ContextManagerFactoryMethod m_contextManagerFactoryMethod;
+
+    friend class State::StateChange;
+};
+} /* namespace WRT */
+#endif /* RUNNABLE_WIDGET_OBJECT_H_ */
diff --git a/src/api_new/runnable_widget_object_state.cpp b/src/api_new/runnable_widget_object_state.cpp
new file mode 100644 (file)
index 0000000..b227f39
--- /dev/null
@@ -0,0 +1,246 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    core_module.cpp
+ * @author  Tomasz Iwanek (t.iwanek@samsung.com)
+ * @version 1.0
+ * @brief   State classes for runnable object
+ */
+
+#include "runnable_widget_object_state.h"
+#include "runnable_widget_object.h"
+
+namespace WRT {
+namespace State {
+const StateChange StateChange::NoChange = StateChange();
+
+StateChange::StateChange()
+{}
+
+StateChange::StateChange(RunnableWidgetObjectStatePtr sptr) :
+    m_sptr(sptr)
+{}
+
+void StateChange::commit()
+{
+    if (m_sptr) {
+        m_sptr->getObject().setNewState(m_sptr);
+    }
+}
+
+RunnableWidgetObjectState::RunnableWidgetObjectState(
+    RunnableWidgetObject & object) :
+    m_object(object)
+{}
+
+RunnableWidgetObjectState::~RunnableWidgetObjectState()
+{}
+
+RunnableWidgetObject & RunnableWidgetObjectState::getObject() const
+{
+    return m_object;
+}
+
+StateChange RunnableWidgetObjectState::allowPrepareView()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "PrepareView cannot be called in current state" << toString());
+}
+
+StateChange RunnableWidgetObjectState::allowShow()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "Show cannot be called in current state" << toString());
+}
+
+StateChange RunnableWidgetObjectState::allowHide()
+{
+    return StateChange(RunnableWidgetObjectStatePtr(new HiddenState(m_object)));
+}
+
+StateChange RunnableWidgetObjectState::allowSuspend()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "Hide cannot be called in current state" << toString());
+}
+
+StateChange RunnableWidgetObjectState::allowResume()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "Resume cannot be called in current state" << toString());
+}
+
+StateChange RunnableWidgetObjectState::allowReset()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "Cannot reset in curretn state");
+}
+
+StateChange RunnableWidgetObjectState::allowGetCurrentWebview()
+{
+    return StateChange::NoChange;
+}
+
+StateChange RunnableWidgetObjectState::allowSetUserDelegates()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "SetUserCallbacks cannot be called in current state");
+}
+
+StateChange RunnableWidgetObjectState::allowBackward()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "Backward cannot be called in current state ");
+}
+
+StateChange RunnableWidgetObjectState::allowForward()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "Foreward cannot be called in current state ");
+}
+
+StateChange RunnableWidgetObjectState::allowReload()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "Reload cannot be called in current state ");
+}
+
+StateChange RunnableWidgetObjectState::allowFireJavascriptEvent()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "FireJavascriptEvent cannot be called in current state ");
+}
+
+InitialState::InitialState(RunnableWidgetObject & object) :
+    RunnableWidgetObjectState(object)
+{}
+
+std::string InitialState::toString() const
+{
+    return "INITIAL";
+}
+
+StateChange InitialState::allowPrepareView()
+{
+    return StateChange(RunnableWidgetObjectStatePtr(new PreparedState(m_object)));
+}
+
+StateChange InitialState::allowHide()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "Cannot hide before RunnableWidgetObject initialization");
+}
+
+StateChange InitialState::allowGetCurrentWebview()
+{
+    ThrowMsg(
+        IRunnableWidgetObject::MethodInvocationForbidden,
+        "Cannot call GetCurrentWebview before RunnableWidgetObject initialization");
+}
+
+PreparedState::PreparedState(RunnableWidgetObject & object) :
+    RunnableWidgetObjectState(object)
+{}
+
+std::string PreparedState::toString() const
+{
+    return "PREPARED";
+}
+
+StateChange PreparedState::allowSetUserDelegates()
+{
+    return StateChange::NoChange;
+}
+
+StateChange PreparedState::allowShow()
+{
+    return StateChange(RunnableWidgetObjectStatePtr(new ShowedState(m_object)));
+}
+
+ShowedState::ShowedState(RunnableWidgetObject & object) :
+    RunnableWidgetObjectState(object)
+{}
+
+std::string ShowedState::toString() const
+{
+    return "SHOWED";
+}
+
+StateChange ShowedState::allowSuspend()
+{
+    return StateChange(RunnableWidgetObjectStatePtr(new SuspendedState(m_object)));
+}
+
+StateChange ShowedState::allowBackward()
+{
+    return StateChange::NoChange;
+}
+
+StateChange ShowedState::allowForward()
+{
+    return StateChange::NoChange;
+}
+
+StateChange ShowedState::allowReload()
+{
+    return StateChange::NoChange;
+}
+
+StateChange ShowedState::allowReset()
+{
+    return StateChange::NoChange;
+}
+
+StateChange ShowedState::allowFireJavascriptEvent()
+{
+    return StateChange::NoChange;
+}
+
+SuspendedState::SuspendedState(RunnableWidgetObject & object) :
+    RunnableWidgetObjectState(object)
+{}
+
+std::string SuspendedState::toString() const
+{
+    return "SUSPENDED";
+}
+
+StateChange SuspendedState::allowResume()
+{
+    return StateChange(RunnableWidgetObjectStatePtr(new ShowedState(m_object)));
+}
+
+StateChange SuspendedState::allowReset()
+{
+    return StateChange(RunnableWidgetObjectStatePtr(new ShowedState(m_object)));
+}
+
+HiddenState::HiddenState(RunnableWidgetObject & object) :
+    RunnableWidgetObjectState(object)
+{}
+
+std::string HiddenState::toString() const
+{
+    return "HIDEN";
+}
+
+StateChange HiddenState::allowHide()
+{
+    ThrowMsg(IRunnableWidgetObject::MethodInvocationForbidden,
+             "Hide cannot be called in current state" << toString());
+}
+}
+}
diff --git a/src/api_new/runnable_widget_object_state.h b/src/api_new/runnable_widget_object_state.h
new file mode 100644 (file)
index 0000000..e6c69b4
--- /dev/null
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    core_module.cpp
+ * @author  Tomasz Iwanek (t.iwanek@samsung.com)
+ * @version 1.0
+ * @brief   State classes for runnable object
+ */
+#ifndef RUNNABLE_WIDGET_OBJECT_STATE_H
+#define RUNNABLE_WIDGET_OBJECT_STATE_H
+
+//forward declarations
+namespace WRT {
+class RunnableWidgetObject;
+
+namespace State {
+class RunnableWidgetObjectState;
+}
+}
+
+#include <dpl/exception.h>
+
+#include <i_runnable_widget_object.h>
+
+namespace WRT {
+namespace State {
+typedef std::shared_ptr<RunnableWidgetObjectState> RunnableWidgetObjectStatePtr;
+
+/**
+ * @brief The StateChange class
+ *
+ * RunnableWidgetObject state change abstraction
+ */
+class StateChange
+{
+  public:
+    static const StateChange NoChange;
+
+    StateChange();
+    explicit StateChange(RunnableWidgetObjectStatePtr sptr);
+
+    /**
+     * @brief commit actually performs change of state
+     */
+    void commit();
+
+  private:
+    RunnableWidgetObjectStatePtr m_sptr;
+};
+
+/**
+ * @brief The RunnableWidgetObjectState class
+ *
+ * Base class for all runnable object states
+ *
+ * Allow methods should be called if referenced method are actually
+ * going to be called effectively. They return next state object.
+ * Call commit on this object to make change of state of RunnableWidgetObject
+ */
+class RunnableWidgetObjectState
+{
+  public:
+    explicit RunnableWidgetObjectState(RunnableWidgetObject & object);
+    virtual ~RunnableWidgetObjectState();
+
+    virtual StateChange allowPrepareView();
+    virtual StateChange allowShow();
+    virtual StateChange allowHide();
+    virtual StateChange allowSuspend();
+    virtual StateChange allowResume();
+    virtual StateChange allowReset();
+    virtual StateChange allowGetCurrentWebview();
+    virtual StateChange allowSetUserDelegates();
+    virtual StateChange allowBackward();
+    virtual StateChange allowForward();
+    virtual StateChange allowReload();
+    virtual StateChange allowFireJavascriptEvent();
+
+    virtual std::string toString() const = 0;
+    virtual RunnableWidgetObject & getObject() const;
+
+  protected:
+    RunnableWidgetObject & m_object;
+};
+
+/**
+ * INITIAL STATE
+ */
+class InitialState : public RunnableWidgetObjectState
+{
+  public:
+    explicit InitialState(RunnableWidgetObject & object);
+    std::string toString() const;
+
+    StateChange allowPrepareView();
+    StateChange allowHide();
+    StateChange allowGetCurrentWebview();
+};
+
+/**
+ * PREPARED STATE
+ */
+class PreparedState : public RunnableWidgetObjectState
+{
+  public:
+    explicit PreparedState(RunnableWidgetObject & object);
+    std::string toString() const;
+
+    StateChange allowSetUserDelegates();
+    StateChange allowShow();
+};
+
+/**
+ * SHOWED STATE
+ */
+class ShowedState : public RunnableWidgetObjectState
+{
+  public:
+    explicit ShowedState(RunnableWidgetObject & object);
+    std::string toString() const;
+
+    StateChange allowSuspend();
+    StateChange allowBackward();
+    StateChange allowForward();
+    StateChange allowReload();
+    StateChange allowReset();
+    StateChange allowFireJavascriptEvent();
+};
+
+/**
+ * SUSPENDED STATE
+ */
+class SuspendedState : public RunnableWidgetObjectState
+{
+  public:
+    explicit SuspendedState(RunnableWidgetObject & object);
+    std::string toString() const;
+
+    StateChange allowResume();
+    StateChange allowReset();
+};
+
+/**
+ * HIDDEN STATE
+ */
+class HiddenState : public RunnableWidgetObjectState
+{
+  public:
+    explicit HiddenState(RunnableWidgetObject & object);
+    std::string toString() const;
+
+    StateChange allowHide();
+};
+}
+}
+
+#endif // RUNNABLE_WIDGET_OBJECT_STATE_H
diff --git a/src/api_new/security_support.cpp b/src/api_new/security_support.cpp
new file mode 100755 (executable)
index 0000000..4e7882c
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    client_security_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "security_support.h"
+
+#include <string>
+
+#include <ail.h>
+#include <privilege-control.h>
+
+#include <dpl/exception.h>
+#include <dpl/log/wrt_log.h>
+
+namespace WRT {
+namespace {
+class Exception
+{
+public:
+    DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
+    DECLARE_EXCEPTION_TYPE(Base, GetAppInfoFailed)
+    DECLARE_EXCEPTION_TYPE(Base, GetAppInfoStrFailed)
+    DECLARE_EXCEPTION_TYPE(Base, SetPrivilegeFailed)
+};
+
+// Function declare
+void destroyAppInfoHandle(ail_appinfo_h handle);
+void getAppInfo(const std::string& tizenAppId, ail_appinfo_h* handle);
+char* getExePath(ail_appinfo_h handle);
+char* getPackageId(ail_appinfo_h handle);
+char* getPackageType(ail_appinfo_h handle);
+
+void destroyAppInfoHandle(ail_appinfo_h handle)
+{
+    if (handle != NULL)
+        ail_destroy_appinfo(handle);
+}
+
+void getAppInfo(const std::string& tizenAppId, ail_appinfo_h* handle)
+{
+    ail_error_e ret = ail_get_appinfo(tizenAppId.c_str(), handle);
+    if (ret != AIL_ERROR_OK) {
+        WrtLogE("error ail_get_appinfo : %d", ret);
+        Throw(Exception::GetAppInfoFailed);
+    }
+}
+
+char* getExePath(ail_appinfo_h handle)
+{
+    char* str = NULL;
+    ail_error_e ret = ail_appinfo_get_str(handle, AIL_PROP_X_SLP_EXE_PATH, &str);
+    if (ret != AIL_ERROR_OK) {
+        WrtLogE("error ail_appinfo_get_str(%s) : %d", AIL_PROP_X_SLP_EXE_PATH, ret);
+        Throw(Exception::GetAppInfoStrFailed);
+    }
+    return str;
+}
+
+char* getPackageId(ail_appinfo_h handle)
+{
+    char* str = NULL;
+    ail_error_e ret = ail_appinfo_get_str(handle, AIL_PROP_X_SLP_PKGID_STR, &str);
+    if (ret != AIL_ERROR_OK) {
+        WrtLogE("error ail_appinfo_get_str(%s) : %d", AIL_PROP_X_SLP_PKGID_STR, ret);
+        Throw(Exception::GetAppInfoStrFailed);
+    }
+    return str;
+}
+
+char* getPackageType(ail_appinfo_h handle)
+{
+    char* str = NULL;
+    ail_error_e ret = ail_appinfo_get_str(handle, AIL_PROP_X_SLP_PACKAGETYPE_STR, &str);
+    if (ret != AIL_ERROR_OK) {
+        WrtLogE("error ail_appinfo_get_str(%s) : %d", AIL_PROP_X_SLP_PACKAGETYPE_STR, ret);
+        Throw(Exception::GetAppInfoStrFailed);
+    }
+    return str;
+}
+} // namespace anonymous
+
+bool SecuritySupport::setAppPrivilege(const std::string& tizenAppId)
+{
+    ail_appinfo_h handle = NULL;
+    Try
+    {
+        getAppInfo(tizenAppId, &handle);
+        char* path = getExePath(handle);
+        char* pkgId = getPackageId(handle);
+        char* type = getPackageType(handle);
+
+        WrtLogD("Package ID   : %s", pkgId);
+        WrtLogD("Package TYPE : %s", type);
+        WrtLogD("Package PATH : %s", path);
+
+        int ret = perm_app_set_privilege(pkgId, type, path);
+        if (ret != PC_OPERATION_SUCCESS) {
+            WrtLogE("error perm_app_set_privilege : (%d)", ret);
+            Throw(Exception::SetPrivilegeFailed);
+        }
+    }
+    Catch(Exception::Base)
+    {
+        destroyAppInfoHandle(handle);
+        return false;
+    }
+
+    destroyAppInfoHandle(handle);
+    return true;
+}
+
+std::string SecuritySupport::getPluginProcessSoftLinkPath(const std::string& tzAppId)
+{
+    const std::string npruntimePostfix = ".npruntime";
+
+    ail_appinfo_h handle = NULL;
+    std::string appBinPath;
+
+    Try
+    {
+        getAppInfo(tzAppId, &handle);
+        char* path = getExePath(handle);
+        appBinPath = path;
+    }
+    Catch(Exception::Base)
+    {
+        destroyAppInfoHandle(handle);
+        return "";
+    }
+
+    destroyAppInfoHandle(handle);
+    return appBinPath + npruntimePostfix;
+}
+} // WRT
diff --git a/src/api_new/security_support.h b/src/api_new/security_support.h
new file mode 100644 (file)
index 0000000..82de0ba
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+ /**
+ * @file    client_security_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+#ifndef SECURITY_SUPPORT_H_
+#define SECURITY_SUPPORT_H_
+
+#include <string>
+
+namespace WRT {
+namespace SecuritySupport {
+bool setAppPrivilege(const std::string& tizenAppId);
+std::string getPluginProcessSoftLinkPath(const std::string& tzAppId);
+} // namespace SecuritySupport
+} // namespace WRT
+#endif // SECURITY_SUPPORT_H_
diff --git a/src/api_new/user_delegates.h b/src/api_new/user_delegates.h
new file mode 100755 (executable)
index 0000000..37de6a9
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        user_delegates.h
+ * @author      Tomasz Iwanek (t.iwanek@samsung.com)
+ * @brief       user delegates
+ */
+#ifndef USER_DELEGATES_H
+#define USER_DELEGATES_H
+
+#include <functional>
+#include <memory>
+#include <string>
+
+#include <Evas.h>
+
+namespace WRT {
+typedef std::function<void(Evas_Object*)> SetWebviewCallback;
+typedef std::function<void(Evas_Object*)> UnsetWebviewCallback;
+typedef std::function<void(Evas_Object*, void*)> LoadProgressStartedCallback;
+typedef std::function<void(Evas_Object*, void*)> LoadProgressCallback;
+typedef std::function<void(Evas_Object*, void*)> LoadProgressFinishedCallback;
+typedef std::function<void(Evas_Object*, void*)> LoadStartedCallback;
+typedef std::function<void(Evas_Object*, void*)> LoadFinishedCallback;
+typedef std::function<void(Evas_Object*, void*)> WebProcessCrashedCallback;
+typedef std::function<void(Evas_Object*, void*)> ProcessCrashedCallback;
+typedef std::function<bool(Evas_Object*, void*)> PolicyNavigationDecideCallback;
+typedef std::function<void(Evas_Object*, void*)> ProcessExitCallback;
+typedef std::function<void(Evas_Object*, void*)> EnterFullscreenCallback;
+typedef std::function<void(Evas_Object*, void*)> ExitFullscreenCallback;
+typedef std::function<void(int)> OrientationLockCallback;
+typedef std::function<void(Evas_Object*, void*)> KeyCallback;
+typedef std::function<void(Evas_Object*, void*)> ConsoleMessageCallback;
+typedef std::function<void(Evas_Object*, void*)> RotatePreparedCallback;
+typedef std::function<void(Evas_Object*, void*)> EnableVideoHwOverlayCallback;
+typedef std::function<void(Evas_Object*, void*)> DisableVideoHwOverlaycallback;
+typedef std::function<void(Evas_Object*, void*)> PopupReplyWaitStartCallback;
+typedef std::function<void(Evas_Object*, void*)> PopupReplyWaitFinishCallback;
+typedef std::function<void(Evas_Object*, void*)> FrameRenderedCallback;
+typedef std::function<void(const std::string&)> BlockedUrlPolicyCallback;
+typedef std::function<bool(void)> IsCreateNewWindowAllowedCallback;
+typedef std::function<void(void*)> CreateContextMenuCallback;
+
+struct UserDelegates {
+    SetWebviewCallback setWebviewCallback;
+    UnsetWebviewCallback unsetWebviewCallback;
+    LoadProgressStartedCallback loadProgressStartedCallback;
+    LoadProgressCallback loadProgressCallback;
+    LoadProgressFinishedCallback loadProgressFinishedCallback;
+    LoadStartedCallback loadStartedCallback;
+    LoadFinishedCallback loadFinishedCallback;
+    WebProcessCrashedCallback webProcessCrashedCallback;
+    ProcessCrashedCallback processCrashedCallback;
+    PolicyNavigationDecideCallback policyNavigationDecideCallback;
+    ProcessExitCallback processExitCallback;
+    EnterFullscreenCallback enterFullscreenCallback;
+    ExitFullscreenCallback exitFullscreenCallback;
+    OrientationLockCallback orientationLockCallback;
+    KeyCallback keyCallback;
+    ConsoleMessageCallback consoleMessageCallback;
+    RotatePreparedCallback rotatePreparedCallback;
+    EnableVideoHwOverlayCallback enableVideoHwOverlayCallback;
+    DisableVideoHwOverlaycallback disableVideoHwOverlayCallback;
+    PopupReplyWaitStartCallback popupReplyWaitStartCallback;
+    PopupReplyWaitFinishCallback popupReplyWaitFinishCallback;
+    FrameRenderedCallback frameRenderedCallback;
+    BlockedUrlPolicyCallback blockedUrlPolicyCallback;
+    IsCreateNewWindowAllowedCallback isCreateNewWindowAllowedCallback;
+    CreateContextMenuCallback createContextMenuCallback;
+};
+
+typedef std::shared_ptr<UserDelegates> UserDelegatesPtr;
+}
+
+#endif // USER_DELEGATES_H
diff --git a/src/domain/DESCRIPTION b/src/domain/DESCRIPTION
new file mode 100644 (file)
index 0000000..2f8c08b
--- /dev/null
@@ -0,0 +1 @@
+Collective folder for a number of modules
diff --git a/src/domain/application_data.cpp b/src/domain/application_data.cpp
new file mode 100644 (file)
index 0000000..4186515
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    application_data.cpp
+ * @author  Yunchan Cho (yunchan.cho@samsung.com)
+ * @version 1.0
+ * @brief   implementation file for application_data.h
+ */
+
+#include "application_data.h"
+
+#include <bundle.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/singleton_safe_impl.h>
+
+IMPLEMENT_SAFE_SINGLETON(ApplicationData)
+
+ApplicationData::ApplicationData()
+{}
+
+ApplicationData::~ApplicationData()
+{}
+
+bundle* ApplicationData::getBundle(const std::string& appId) const
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    auto it = m_bundleDataMap.find(appId);
+    if (it == m_bundleDataMap.end()) {
+        WrtLogE("No data");
+        return NULL;
+    }
+
+    return it->second->originBundle;
+}
+
+const char* ApplicationData::getEncodedBundle(const std::string& appId) const
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    auto it = m_bundleDataMap.find(appId);
+    if (it == m_bundleDataMap.end()) {
+        WrtLogE("No data");
+        return NULL;
+    }
+
+    return (const char*)it->second->encodedBundle;
+}
+
+bool ApplicationData::setBundleData(const std::string& appId, bundle* originBundle)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    if (!originBundle) {
+        WrtLogE("bundle is empty!");
+        Assert(false);
+    }
+
+    auto it = m_bundleDataMap.find(appId);
+    if (it != m_bundleDataMap.end()) {
+        WrtLogE("already exist");
+        return false;
+    }
+
+    BundleDataPtr data(new BundleData);
+    data->originBundle = bundle_dup(originBundle);
+
+    int len, ret;
+    ret = bundle_encode(originBundle, &data->encodedBundle, &len);
+    if (ret == -1) {
+        WrtLogE("Failed to encode bundle data");
+        bundle_free(data->originBundle);
+        return false;
+    }
+
+    m_bundleDataMap.insert(BundleDataMapPair(appId, data));
+
+    return true;
+}
+
+void ApplicationData::freeBundleData(const std::string& appId)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    auto it = m_bundleDataMap.find(appId);
+    if (it == m_bundleDataMap.end()) {
+        WrtLogE("No data");
+        return;
+    }
+
+    bundle_free(it->second->originBundle);
+    bundle_free_encoded_rawdata(&it->second->encodedBundle);
+    m_bundleDataMap.erase(it);
+}
diff --git a/src/domain/application_data.h b/src/domain/application_data.h
new file mode 100644 (file)
index 0000000..73590b6
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    application_data.h
+ * @author  Yunchan Cho (yunchan.cho@samsung.com)
+ * @version 1.0
+ * @brief   Header file for application_data.h
+ */
+
+#ifndef APPLICATION_DATA_H_
+#define APPLICATION_DATA_H_
+
+#include <map>
+#include <string>
+#include <utility>
+
+#include <bundle.h>
+#include <dpl/singleton.h>
+
+class ApplicationData
+{
+  public:
+    bundle* getBundle(const std::string& appId) const;
+    const char* getEncodedBundle(const std::string& appId) const;
+    bool setBundleData(const std::string& appId, bundle* originBundle);
+    void freeBundleData(const std::string& appId);
+
+  private:
+    ApplicationData();
+    ~ApplicationData();
+
+    typedef struct bundleData {
+        bundle* originBundle;
+        bundle_raw* encodedBundle;
+    } BundleData;
+
+    typedef std::shared_ptr<BundleData> BundleDataPtr;
+    typedef std::map<std::string, BundleDataPtr> BundleDataMap;
+    typedef std::pair<std::string, BundleDataPtr> BundleDataMapPair;
+
+    BundleDataMap m_bundleDataMap;
+
+    friend class DPL::Singleton<ApplicationData>;
+};
+
+typedef DPL::Singleton<ApplicationData> ApplicationDataSingleton;
+
+#endif // APPLICATION_DATA_H_
\ No newline at end of file
diff --git a/src/domain/iana_record_types.h b/src/domain/iana_record_types.h
new file mode 100644 (file)
index 0000000..8f3bb6d
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    iana_record_types.h
+ * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @version 1.0
+ */
+
+enum iana_record_types_e
+{
+    RECORD_TYPE_LANGUAGE,
+    RECORD_TYPE_SCRIPT,
+    RECORD_TYPE_REGION,
+    RECORD_TYPE_VARIANT,
+    RECORD_TYPE_GRANDFATHERED,
+    RECORD_TYPE_REDUNDANT,
+    RECORD_TYPE_EXTLANG
+};
diff --git a/src/domain/localization_setting.cpp b/src/domain/localization_setting.cpp
new file mode 100644 (file)
index 0000000..b3c5400
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    localization_setting.cpp
+ * @author  Soyoung Kim (sy037.kim@samsung.com)
+ * @version 1.0
+ * @brief   Localization setting implementation
+ */
+
+#include "localization_setting.h"
+#include <dpl/log/wrt_log.h>
+
+#include <appcore-efl.h>
+
+namespace LocalizationSetting {
+void SetLanguageChangedCallback(LanguageChangedCallback cb, void *data)
+{
+    WrtLogD("Set language changed callback");
+
+    appcore_set_event_callback(
+        APPCORE_EVENT_LANG_CHANGE,
+        cb, data);
+}
+} //Namespace LocalizationSetting
diff --git a/src/domain/localization_setting.h b/src/domain/localization_setting.h
new file mode 100644 (file)
index 0000000..573c100
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    localization_setting.h
+ * @author  Soyoung Kim (sy037.kim@samsung.com)
+ * @version 1.0
+ * @brief   localization setting implementation
+ */
+#ifndef LOCALIZATION_SETTING_H_
+#define LOCALIZATION_SETTING_H_
+
+namespace LocalizationSetting {
+typedef int (*LanguageChangedCallback)(void *eventInfo,void *data);
+
+void SetLanguageChangedCallback(LanguageChangedCallback cb, void *data);
+} //LocalizationSetting
+
+#endif // ifndef LOCALIZATION_SETTING_H_
+
diff --git a/src/domain/main_thread.cpp b/src/domain/main_thread.cpp
new file mode 100644 (file)
index 0000000..6029df6
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       main_thread.cpp
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    1.0
+ */
+
+#include "main_thread.h"
+#include <dpl/log/wrt_log.h>
+#include <dpl/assert.h>
+#include <dpl/wrt-dao-ro/WrtDatabase.h>
+#include <ace_api_client.h>
+#include <dpl/wrt-dao-ro/WrtDatabase.h>
+#include <dpl/singleton_impl.h>
+#include <popup-runner/popup-runner.h>
+IMPLEMENT_SINGLETON(MainThread)
+
+using namespace WrtDB;
+
+MainThread::MainThread() : m_attached(false) {}
+
+MainThread::~MainThread()
+{
+    if (m_attached) {
+        WrtLogE("Destroyed without detach");
+    }
+}
+
+void MainThread::AttachDatabases()
+{
+    Assert(!m_attached);
+    // Attach databases
+    ace_return_t ret = ace_client_initialize(Wrt::Popup::run_popup);
+    Assert(ACE_OK == ret);
+    WrtDB::WrtDatabase::attachToThreadRO();
+    m_attached = true;
+}
+
+void MainThread::DetachDatabases()
+{
+    Assert(m_attached);
+    m_attached = false;
+    // Detach databases
+    ace_return_t ret = ace_client_shutdown();
+    Assert(ACE_OK == ret);
+    WrtDB::WrtDatabase::detachFromThread();
+}
diff --git a/src/domain/main_thread.h b/src/domain/main_thread.h
new file mode 100644 (file)
index 0000000..df00289
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       main_thread.h
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    1.0
+ */
+
+#ifndef WRT_SRC_DOMAIN_MAINTHREAD_H_
+#define WRT_SRC_DOMAIN_MAINTHREAD_H_
+
+#include <dpl/singleton.h>
+
+class MainThread
+{
+  public:
+    void AttachDatabases();
+    void DetachDatabases();
+
+  private:
+    friend class DPL::Singleton<MainThread>;
+
+    MainThread();
+    virtual ~MainThread();
+
+    bool m_attached;
+};
+
+typedef DPL::Singleton<MainThread> MainThreadSingleton;
+
+#endif /* WRT_SRC_DOMAIN_MAINTHREAD_H_ */
diff --git a/src/domain/message_support.h b/src/domain/message_support.h
new file mode 100644 (file)
index 0000000..c66f64d
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    message_support.h
+ * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @author  Yunchan Cho (yunchan.cho@samsung.com)
+ * @brief   definition of messages between UI Process and Injected bundle
+ */
+#ifndef WRT_SRC_DOMAIN_MESSAGE_SUPPORT_H_
+#define WRT_SRC_DOMAIN_MESSAGE_SUPPORT_H_
+
+#include <dpl/platform.h>
+
+namespace Message {
+
+namespace ToInjectedBundle {
+const char * const INIT = "ToInjectedBundle::INIT";
+const char * const START = "ToInjectedBundle::START";
+const char * const SHUTDOWN = "ToInjectedBundle::SHUTDOWN";
+const char * const SET_CUSTOM_PROPERTIES =
+    "ToInjectedBundle::SET_CUSTOM_PROPERTIES";
+const char * const DISPATCH_JS_EVENT = "ToInjectedBundle::DISPATCH_JS_EVENT";
+const char * const SET_XWINDOW_HANDLE = "ToInjectedBundle::SET_XWINDOW_HANDLE";
+const char * const SET_VIEWMODES = "ToInjectedBundle::SET_VIEWMODES";
+const char * const SET_VIEWMODES_MSGBODY_EXIT = "exit";
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+const char * const RESET_AUL_CONNECTION = "ToInjectedBundle::RECONNECT";
+const char * const REPLY_CLIENT = "ToInjectedBundle::REPLYCLIENT";
+#endif
+} // namespace ToInectedBundle
+
+namespace ToUIProcess {
+const char * const BLOCKED_URL = "ToUIProcess::BLOCKED_URL";
+const char * const SEND_WEBPROCESS_PID = "ToUIProcess::SEND_WEBPROCESS_PID";
+} // namespace ToUIProcess
+
+namespace ToWebProcess {
+const char * const CHANGE_CMDLINE = "ToWebProcess::ChangeCmdLine";
+} // namespace ToWebProcess
+
+namespace TizenScheme {
+const char * const GET_WINDOW_HANDLE = "tizen://getWindowHandle";
+const char * const CLEAR_ALL_COOKIES = "tizen://clearAllCookies";
+} // namespace ToUIProcess
+
+} //namespace Message
+
+#endif // WRT_SRC_DOMAIN_MESSAGE_SUPPORT_H_
diff --git a/src/domain/permission_popup_manager.cpp b/src/domain/permission_popup_manager.cpp
new file mode 100644 (file)
index 0000000..e2c1a8c
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    permission_popup_manager.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "permission_popup_manager.h"
+
+#include <dpl/availability.h>
+#include <dpl/foreach.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/singleton_safe_impl.h>
+#include <Evas.h>
+
+IMPLEMENT_SAFE_SINGLETON(PermissionPopupManager)
+
+PermissionPopupManager::PermissionPopupManager()
+{}
+
+PermissionPopupManager::~PermissionPopupManager()
+{}
+
+void PermissionPopupManager::registerPopup(Evas_Object* webview, Evas_Object* popup)
+{
+    WrtLogD("register");
+
+    if (!webview || !popup)
+    {
+        WrtLogW("Wrong input argument");
+        return;
+    }
+    addWebview(webview);
+    addPopup(popup);
+    m_pairList.push_back(Pair(webview, popup));
+}
+
+void PermissionPopupManager::unregisterWebview(Evas_Object* webview)
+{
+    WrtLogD("unegister");
+
+    FOREACH(it, m_pairList)
+    {
+        if (it->first == webview)
+        {
+            removePopup(it->second);
+            evas_object_del(it->second);
+
+            // erase iterator
+            PairList::iterator next = it;
+            ++next;
+            m_pairList.erase(it);
+            it = next;
+        }
+    }
+    removeWebview(webview);
+}
+
+void PermissionPopupManager::unregisterPopup(Evas_Object* popup)
+{
+    WrtLogD("unegister popup");
+
+    Evas_Object* webview = NULL;
+
+    FOREACH(it, m_pairList)
+    {
+        if (it->second == popup)
+        {
+            webview = it->first;
+            removePopup(it->second);
+
+            // erase iterator
+            PairList::iterator next = it;
+            ++next;
+            m_pairList.erase(it);
+            it = next;
+        }
+    }
+
+    if (webview)
+    {
+        FOREACH(it, m_pairList)
+        {
+            if (it->first == webview)
+            {
+                // PairList still has webview usage.
+                // Do not clean-up webview data.
+                return;
+            }
+        }
+        removeWebview(webview);
+    }
+}
+
+void PermissionPopupManager::addWebview(Evas_Object* webview)
+{
+    evas_object_event_callback_add(webview, EVAS_CALLBACK_DEL, deleteWebviewCallback, this);
+}
+
+void PermissionPopupManager::addPopup(Evas_Object* popup)
+{
+    evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, deletePopupCallback, this);
+}
+
+void PermissionPopupManager::removeWebview(Evas_Object* webview)
+{
+    evas_object_event_callback_del(webview, EVAS_CALLBACK_DEL, deleteWebviewCallback);
+}
+
+void PermissionPopupManager::removePopup(Evas_Object* popup)
+{
+    evas_object_event_callback_del(popup, EVAS_CALLBACK_DEL, deletePopupCallback);
+}
+
+void PermissionPopupManager::deleteWebviewCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(e);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionPopupManager* This = static_cast<PermissionPopupManager*>(data);
+    This->unregisterWebview(obj);
+}
+
+void PermissionPopupManager::deletePopupCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(e);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionPopupManager* This = static_cast<PermissionPopupManager*>(data);
+    This->unregisterPopup(obj);
+}
+
diff --git a/src/domain/permission_popup_manager.h b/src/domain/permission_popup_manager.h
new file mode 100644 (file)
index 0000000..68cead1
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    permission_popup_manager.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#ifndef PERMISSION_POPUP_MANAGER_H_
+#define PERMISSION_POPUP_MANAGER_H_
+
+#include <list>
+#include <utility>
+
+#include <dpl/singleton.h>
+#include <Evas.h>
+
+class PermissionPopupManager
+{
+  public:
+    void registerPopup(Evas_Object* webview, Evas_Object* popup);
+
+  private:
+    PermissionPopupManager();
+    ~PermissionPopupManager();
+
+    void unregisterPopup(Evas_Object* popup);
+    void unregisterWebview(Evas_Object* webview);
+
+    void addWebview(Evas_Object* webview);
+    void addPopup(Evas_Object* popup);
+    void removeWebview(Evas_Object* webview);
+    void removePopup(Evas_Object* popup);
+
+    static void deleteWebviewCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo);
+    static void deletePopupCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo);
+
+    typedef std::pair<Evas_Object*, Evas_Object* > Pair; // std::pair<webview, popup>
+    typedef std::list<Pair> PairList;
+    PairList m_pairList;
+
+    friend class DPL::Singleton<PermissionPopupManager>;
+};
+
+typedef DPL::Singleton<PermissionPopupManager> PermissionPopupManagerSingleton;
+
+#endif // PERMISSION_POPUP_MANAGER_H_
diff --git a/src/domain/widget_data_types.cpp b/src/domain/widget_data_types.cpp
new file mode 100755 (executable)
index 0000000..7fca8ac
--- /dev/null
@@ -0,0 +1,370 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * This file  have been implemented in compliance with  W3C WARP SPEC.
+ * but there are some patent issue between  W3C WARP SPEC and APPLE.
+ * so if you want to use this file, refer to the README file in root directory
+ */
+/**
+ * @file       widget_data_types.cpp
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @author     Tomasz Iwanek (t.iwanek@samsung.com) (implementation moved to
+ * cpp)
+ * @version    0.1
+ * @brief
+ */
+
+#include <widget_data_types.h>
+
+#include <stdlib.h>
+
+#include <dpl/foreach.h>
+#include <dpl/log/wrt_log.h>
+
+namespace {
+const char* const WRT_WIDGET_DATA_TYPES_LOG_ENABLE =
+    "WRT_WIDGET_DATA_TYPES_LOG_ENABLE";
+}
+
+WidgetAccessList::WidgetAccessList() : m_isAccessAll(false)
+{}
+
+WidgetAccessList::WidgetAccessList(
+    const WrtDB::WidgetAccessInfoList &widgetAccessInfoList) :
+    m_isAccessAll(false)
+{
+    FOREACH(it, widgetAccessInfoList)
+    {
+        if (DPL::FromUTF32String(L"*") == it->strIRI) {
+            m_isAccessAll = true;
+            m_warpIriList.clear();
+            return;
+        }
+
+        WarpIRI warpIri;
+
+        warpIri.set(DPL::ToUTF8String(it->strIRI).c_str(),
+                    it->bSubDomains);
+
+        if (warpIri.isAccessDefinition()) {
+            m_warpIriList.push_back(warpIri);
+        }
+    }
+}
+
+bool WidgetAccessList::getIsAccessAll() const
+{
+    return m_isAccessAll;
+}
+
+const WarpIRIList* WidgetAccessList::getWarpIRIList() const
+{
+    return &m_warpIriList;
+}
+
+bool WidgetAccessList::isRequiredIRI(const DPL::String &iri) const
+{
+    if (m_isAccessAll) {
+        return true;
+    }
+
+    WarpIRI requestIri;
+    requestIri.set(iri.c_str(), false);
+
+    FOREACH(it, m_warpIriList)
+    {
+        if (it->isSubDomain(requestIri)) {
+            return true;
+        }
+    }
+
+    return false;
+}
+
+bool WidgetAccessList::operator ==(const WidgetAccessList& other) const
+{
+    return m_warpIriList == other.m_warpIriList &&
+           m_isAccessAll == other.m_isAccessAll;
+}
+
+WidgetSettingList::WidgetSettingList() :
+    m_RotationLock(Screen_Portrait),
+    m_IndicatorPresence(Indicator_Enable),
+    m_BackButtonPresence(BackButton_Disable),
+    m_ContextMenu(ContextMenu_Enable),
+    m_Encryption(Encryption_Disable),
+    m_BackgroundSupport(BackgroundSupport_Disable),
+    m_ProgressbarPresence(ProgressBar_Disable),
+    m_HWkeyEvent(HWkeyEvent_Enable),
+#if USE(EA_SCREEN_READER)
+    m_Accessibility(Accessibility_Enable),
+#endif
+    m_SoundMode(SoundMode_Shared),
+    m_BackgroundVibration(BackgroundVibration_Disable)
+{
+    m_logEnable = (getenv(WRT_WIDGET_DATA_TYPES_LOG_ENABLE) != NULL);
+}
+
+WidgetSettingList::WidgetSettingList(WrtDB::WidgetSettings &widgetSettings)
+{
+    using namespace TizenSetting::Name;
+    using namespace TizenSetting::Value;
+
+    m_logEnable = (getenv(WRT_WIDGET_DATA_TYPES_LOG_ENABLE) != NULL);
+
+    m_RotationLock = Screen_Portrait;
+    m_IndicatorPresence = Indicator_Enable;
+    m_BackButtonPresence = BackButton_Disable;
+    m_ContextMenu = ContextMenu_Enable;
+    m_Encryption = Encryption_Disable;
+    m_BackgroundSupport = BackgroundSupport_Disable;
+    m_ProgressbarPresence = ProgressBar_Disable;
+    m_HWkeyEvent = HWkeyEvent_Enable;
+#if USE(EA_SCREEN_READER)
+    m_Accessibility = Accessibility_Enable;
+#endif
+    m_SoundMode = SoundMode_Shared;
+    m_BackgroundVibration = BackgroundVibration_Disable;
+
+    FOREACH(it, widgetSettings) {
+        DPL::String name = it->settingName;
+        DPL::String value = it->settingValue;
+
+        if (name == SCREEN_ORIENTATION) {
+            if (value == SCREEN_ORIENTATION_PORTRAIT) {
+                m_RotationLock = Screen_Portrait;
+            } else if (value == SCREEN_ORIENTATION_LANDSCAPE) {
+                m_RotationLock = Screen_Landscape;
+            } else if (value == SCREEN_ORIENTATION_AUTO_ROTATION) {
+                m_RotationLock = Screen_AutoRotation;
+            } else {
+                displayError(name, value);
+                m_RotationLock = Screen_Portrait;
+            }
+        } else if (name == INDICATOR_PRESENCE) {
+            if (value == INDICATOR_PRESENCE_ENALBE) {
+                m_IndicatorPresence = Indicator_Enable;
+            } else if (value == INDICATOR_PRESENCE_DISABLE) {
+                m_IndicatorPresence = Indicator_Disable;
+            } else {
+                displayError(name, value);
+                m_IndicatorPresence = Indicator_Enable;
+            }
+        } else if (name == BACKBUTTON_PRESENCE) {
+            if (value == BACKBUTTON_PRESENCE_ENALBE) {
+                m_BackButtonPresence = BackButton_Enable;
+            } else if (value == BACKBUTTON_PRESENCE_DISABLE) {
+                m_BackButtonPresence = BackButton_Disable;
+            } else {
+                displayError(name, value);
+                m_BackButtonPresence = BackButton_Disable;
+            }
+        } else if (name == CONTEXT_MENU) {
+            if (value == CONTEXT_MENU_ENABLE) {
+                m_ContextMenu = ContextMenu_Enable;
+            } else if (value == CONTEXT_MENU_DISABLE) {
+                m_ContextMenu = ContextMenu_Disable;
+            } else {
+                displayError(name, value);
+                m_ContextMenu = ContextMenu_Enable;
+            }
+        } else if (name == ENCRYPTION) {
+            if (value == ENCRYPTION_ENABLE) {
+                m_Encryption = Encryption_Enable;
+            } else if (value == ENCRYPTION_DISABLE) {
+                m_Encryption = Encryption_Disable;
+            } else {
+                displayError(name, value);
+                m_Encryption = Encryption_Disable;
+            }
+        } else if (name == BACKGROUND_SUPPORT) {
+            if (value == ENABLE) {
+                m_BackgroundSupport = BackgroundSupport_Enable;
+            } else if (value == DISABLE) {
+                m_BackgroundSupport = BackgroundSupport_Disable;
+            } else {
+                displayError(name, value);
+                m_BackgroundSupport = BackgroundSupport_Disable;
+            }
+        }
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+        else if (name == USER_AGENT) {
+            DPL::OptionalString userAgent = value;
+            if (!!userAgent) {
+                m_UserAgent = DPL::ToUTF8String(*userAgent);
+            }
+        }
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+        else if (name == PROGRESSBAR_PRESENCE) {
+            if (value == PROGRESSBAR_PRESENCE_ENABLE) {
+                m_ProgressbarPresence = ProgressBar_Enable;
+            } else if (value == PROGRESSBAR_PRESENCE_DISABLE) {
+                m_ProgressbarPresence = ProgressBar_Disable;
+            } else {
+                displayError(name, value);
+                m_ProgressbarPresence = ProgressBar_Disable;
+            }
+        } else if (name == HWKEY_EVENT) {
+            if (value == HWKEY_EVENT_ENABLE) {
+                m_HWkeyEvent = HWkeyEvent_Enable;
+            } else if (value == HWKEY_EVENT_DISABLE) {
+                m_HWkeyEvent = HWkeyEvent_Disable;
+            } else {
+                displayError(name, value);
+                m_HWkeyEvent = HWkeyEvent_Enable;
+            }
+        }
+#if USE(EA_SCREEN_READER)
+        else if (name == ACCESSIBILITY) {
+            if (value == ACCESSIBILITY_ENABLE) {
+                m_Accessibility = Accessibility_Enable;
+            } else if (value == ACCESSIBILITY_DISABLE) {
+                m_Accessibility = Accessibility_Disable;
+            } else {
+                displayError(name, value);
+                m_Accessibility = Accessibility_Enable;
+            }
+        }
+#endif
+        else if (name == SOUND_MODE) {
+            if (value == SOUND_MODE_SAHRED) {
+                m_SoundMode = SoundMode_Shared;
+            } else if (value == SOUND_MODE_EXCLUSIVE) {
+                m_SoundMode = SoundMode_Exclusive;
+            } else {
+                displayError(name, value);
+                m_SoundMode = SoundMode_Shared;
+            }
+        } else if (name == BACKGROUND_VIBRATION) {
+            if (value == ENABLE) {
+                m_BackgroundVibration = BackgroundVibration_Enable;
+            } else if (value == DISABLE) {
+                m_BackgroundVibration = BackgroundVibration_Disable;
+            } else {
+                displayError(name, value);
+                m_BackgroundVibration = BackgroundVibration_Disable;
+            }
+        } else {
+            displayError(name, value);
+        }
+    }
+}
+
+WidgetSettingScreenLock WidgetSettingList::getRotationValue() const
+{
+    if (m_logEnable) {WrtLogD("m_RotationLock: %d", m_RotationLock);}
+    return m_RotationLock;
+}
+
+WidgetSettingIndicatorPresence WidgetSettingList::getIndicatorPresence() const
+{
+    if (m_logEnable) {WrtLogD("m_IndicatorPresence: %d", m_IndicatorPresence);}
+    return m_IndicatorPresence;
+}
+
+WidgetSettingBackButtonPresence WidgetSettingList::getBackButtonPresence()
+const
+{
+    if (m_logEnable) {WrtLogD("m_BackButtonPresence: %d", m_BackButtonPresence);}
+    return m_BackButtonPresence;
+}
+
+WidgetSettingContextMenu WidgetSettingList::getContextMenu() const
+{
+    if (m_logEnable) {WrtLogD("m_ContextMenu: %d", m_ContextMenu);}
+    return m_ContextMenu;
+}
+
+WidgetSettingEncryption WidgetSettingList::getEncryption() const
+{
+    if (m_logEnable) {WrtLogD("m_Encryption: %d", m_Encryption);}
+    return m_Encryption;
+}
+
+WidgetSettingBackgroundSupport WidgetSettingList::getBackgroundSupport() const
+{
+    if (m_logEnable) {WrtLogD("m_BackgroundSupport: %d", m_BackgroundSupport);}
+    return m_BackgroundSupport;
+}
+
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+std::string WidgetSettingList::getUserAgent() const
+{
+    if (m_logEnable) {WrtLogD("m_UserAgent: %s", m_UserAgent.c_str());}
+    return m_UserAgent;
+}
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+
+WidgetSettingProgressBarPresence WidgetSettingList::getProgressBarPresence() const
+{
+    if (m_logEnable) {WrtLogD("m_ProgressbarPresence: %d", m_ProgressbarPresence);}
+    return m_ProgressbarPresence;
+}
+
+WidgetSettingHWkeyEventPresence WidgetSettingList::getHWkeyEvent() const
+{
+    if (m_logEnable) {WrtLogD("m_HWkeyEvent: %d", m_HWkeyEvent);}
+    return m_HWkeyEvent;
+}
+
+#if USE(EA_SCREEN_READER)
+WidgetSettingAccessibility WidgetSettingList::getAccessibility() const
+{
+    if (m_logEnable) {WrtLogD("m_Accessibility: %d", m_Accessibility);}
+    return m_Accessibility;
+}
+#endif
+
+WidgetSettingSoundMode WidgetSettingList::getSoundMode() const
+{
+    if (m_logEnable) {WrtLogD("m_SoundMode: %d", m_SoundMode);}
+    return m_SoundMode;
+}
+
+WidgetSettingBackgroundVibration WidgetSettingList::getBackgroundVibration() const
+{
+    if (m_logEnable) {WrtLogD("m_BackgroundVibration: %d", m_BackgroundVibration);}
+    return m_BackgroundVibration;
+}
+
+bool WidgetSettingList::operator ==(const WidgetSettingList& other) const
+{
+    return m_RotationLock == other.m_RotationLock &&
+           m_IndicatorPresence == other.m_IndicatorPresence &&
+           m_BackButtonPresence == other.m_BackButtonPresence &&
+           m_ContextMenu == other.m_ContextMenu &&
+           m_Encryption == other.m_Encryption &&
+           m_BackgroundSupport == other.m_BackgroundSupport &&
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+           m_UserAgent == other.m_UserAgent &&
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+           m_ProgressbarPresence == other.m_ProgressbarPresence &&
+           m_HWkeyEvent == other.m_HWkeyEvent &&
+#if USE(EA_SCREEN_READER)
+           m_Accessibility == other.m_Accessibility &&
+#endif
+           m_SoundMode == other.m_SoundMode &&
+           m_BackgroundVibration== other.m_BackgroundVibration;
+
+}
+
+void WidgetSettingList::displayError(const DPL::String& name,
+                                     const DPL::String& value)
+{
+    WrtLogW("Invalid \"%s\" setting value \"%s\"",
+       DPL::ToUTF8String(name).c_str(),
+       DPL::ToUTF8String(value).c_str());
+}
diff --git a/src/domain/widget_data_types.h b/src/domain/widget_data_types.h
new file mode 100755 (executable)
index 0000000..126500f
--- /dev/null
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * This file  have been implemented in compliance with  W3C WARP SPEC.
+ * but there are some patent issue between  W3C WARP SPEC and APPLE.
+ * so if you want to use this file, refer to the README file in root directory
+ */
+/**
+ * @file       widget_data_types.h
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    0.1
+ * @brief
+ */
+
+#ifndef WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_
+#define WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_
+
+#include <list>
+#include <memory>
+
+#include <dpl/platform.h>
+#include <dpl/utils/warp_iri.h>
+#include <dpl/utils/widget_version.h>
+#include <dpl/optional_typedefs.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+
+// WidgetIcon, LanguageTagsList, OptionalWidgetStartFileInfo,
+// WidgetStartFileInfo
+#include <dpl/localization/localization_utils.h>
+
+typedef std::list<WarpIRI> WarpIRIList;
+
+/**
+ * @brief Execution phase according to BONDI
+ *
+ * WidgetExecutionPhase_Unknown:
+ *  Execution state is not defined
+ *
+ * WidgetExecutionPhase_WidgetInstall:
+ *  Applies to access control queries made by a Widget User Agent during the
+ *  processing of a Widget Resource as part of an installation or update
+ *  operation
+ *
+ * WidgetExecutionPhase_WidgetInstantiate:
+ *  Applies to access control queries made by a Widget User Agent during the
+ *  instantiation of a Widget
+ *
+ * WidgetExecutionPhase_WebkitBind:
+ *  Applies to access control queries made in response to a call to
+ *  requestFeature() in the course of execution of a Website
+ *
+ * WidgetExecutionPhase_Invoke:
+ *  Applies to access control queries made in response to invocation of a
+ *  JavaScript API in the course of execution of a Web Application
+ */
+//enum WidgetExecutionPhase
+//{
+//    WidgetExecutionPhase_Unknown           = 0,
+//    WidgetExecutionPhase_WidgetInstall     = 1 << 0,
+//    WidgetExecutionPhase_WidgetInstantiate = 1 << 1,
+//    WidgetExecutionPhase_WebkitBind        = 1 << 2,
+//    WidgetExecutionPhase_Invoke            = 1 << 3
+//};
+
+class WidgetModel;
+
+class WidgetAccessList
+{
+  public:
+    WidgetAccessList();
+
+    WidgetAccessList(const WrtDB::WidgetAccessInfoList &widgetAccessInfoList);
+
+    bool getIsAccessAll() const;
+
+    const WarpIRIList* getWarpIRIList() const;
+
+    bool isRequiredIRI(const DPL::String &iri) const;
+
+    bool operator ==(const WidgetAccessList& other) const;
+
+  private:
+    WarpIRIList m_warpIriList;
+    bool m_isAccessAll;
+};
+
+namespace TizenSetting {
+namespace Name {
+const DPL::String SCREEN_ORIENTATION   = L"screen-orientation";
+const DPL::String INDICATOR_PRESENCE   = L"indicator-presence";
+const DPL::String BACKBUTTON_PRESENCE  = L"backbutton-presence";
+const DPL::String CONTEXT_MENU         = L"context-menu";
+const DPL::String BACKGROUND_SUPPORT   = L"background-support";
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+const DPL::String USER_AGENT           = L"user-agent";
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+const DPL::String PROGRESSBAR_PRESENCE = L"progressbar-presence";
+const DPL::String HWKEY_EVENT          = L"hwkey-event";
+const DPL::String ACCESSIBILITY        = L"accessibility";
+const DPL::String SOUND_MODE           = L"sound-mode";
+const DPL::String ENCRYPTION           = L"encryption";
+const DPL::String BACKGROUND_VIBRATION = L"background-vibration";
+} // namespace Name
+namespace Value {
+const DPL::String ENABLE                           = L"enable";
+const DPL::String DISABLE                          = L"disable";
+const DPL::String SCREEN_ORIENTATION_PORTRAIT      = L"portrait";
+const DPL::String SCREEN_ORIENTATION_LANDSCAPE     = L"landscape";
+const DPL::String SCREEN_ORIENTATION_AUTO_ROTATION = L"auto-rotation";
+const DPL::String INDICATOR_PRESENCE_ENALBE        = ENABLE;
+const DPL::String INDICATOR_PRESENCE_DISABLE       = DISABLE;
+const DPL::String BACKBUTTON_PRESENCE_ENALBE       = ENABLE;
+const DPL::String BACKBUTTON_PRESENCE_DISABLE      = DISABLE;
+const DPL::String CONTEXT_MENU_ENABLE              = ENABLE;
+const DPL::String CONTEXT_MENU_DISABLE             = DISABLE;
+const DPL::String ENCRYPTION_ENABLE                = ENABLE;
+const DPL::String ENCRYPTION_DISABLE               = DISABLE;
+const DPL::String PROGRESSBAR_PRESENCE_ENABLE      = ENABLE;
+const DPL::String PROGRESSBAR_PRESENCE_DISABLE     = DISABLE;
+const DPL::String HWKEY_EVENT_ENABLE               = ENABLE;
+const DPL::String HWKEY_EVENT_DISABLE              = DISABLE;
+#if USE(EA_SCREEN_READER)
+const DPL::String ACCESSIBILITY_ENABLE             = ENABLE;
+const DPL::String ACCESSIBILITY_DISABLE            = DISABLE;
+#endif
+const DPL::String SOUND_MODE_SAHRED                = L"shared";
+const DPL::String SOUND_MODE_EXCLUSIVE             = L"exclusive";
+} // namespace Value
+} // namespace TizenSetting
+
+enum WidgetSettingScreenLock
+{
+    Screen_Portrait, /* Default */
+    Screen_Landscape,
+    Screen_AutoRotation
+};
+
+enum WidgetSettingIndicatorPresence
+{
+    Indicator_Enable,     /* Default */
+    Indicator_Disable
+};
+
+enum WidgetSettingBackButtonPresence
+{
+    BackButton_Enable,
+    BackButton_Disable     /* Default */
+};
+
+enum WidgetSettingContextMenu
+{
+    ContextMenu_Enable,  /* Default */
+    ContextMenu_Disable
+};
+
+enum WidgetSettingEncryption
+{
+    Encryption_Enable,
+    Encryption_Disable     /* Default */
+};
+
+enum WidgetSettingBackgroundSupport
+{
+    BackgroundSupport_Enable,
+    BackgroundSupport_Disable    /* Default */
+};
+
+enum WidgetSettingProgressBarPresence
+{
+    ProgressBar_Enable,
+    ProgressBar_Disable    /* Default */
+};
+
+enum WidgetSettingHWkeyEventPresence
+{
+    HWkeyEvent_Enable,    /* Default */
+    HWkeyEvent_Disable
+};
+
+#if USE(EA_SCREEN_READER)
+enum WidgetSettingAccessibility
+{
+    Accessibility_Enable,    /* Default */
+    Accessibility_Disable
+};
+#endif
+
+enum WidgetSettingSoundMode
+{
+    SoundMode_Shared,    /* Default */
+    SoundMode_Exclusive
+};
+
+enum WidgetSettingBackgroundVibration
+{
+    BackgroundVibration_Enable,
+    BackgroundVibration_Disable    /* Default */
+};
+
+class WidgetSettingList
+{
+  public:
+    WidgetSettingList();
+    WidgetSettingList(WrtDB::WidgetSettings &widgetSettings);
+
+    WidgetSettingScreenLock getRotationValue() const;
+    WidgetSettingIndicatorPresence getIndicatorPresence() const;
+    WidgetSettingBackButtonPresence getBackButtonPresence() const;
+    WidgetSettingContextMenu getContextMenu() const;
+    WidgetSettingEncryption getEncryption() const;
+    WidgetSettingBackgroundSupport getBackgroundSupport() const;
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+    std::string getUserAgent() const;
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+    WidgetSettingProgressBarPresence getProgressBarPresence() const;
+    WidgetSettingHWkeyEventPresence getHWkeyEvent() const;
+#if USE(EA_SCREEN_READER)
+    WidgetSettingAccessibility getAccessibility() const;
+#endif
+    WidgetSettingSoundMode getSoundMode() const;
+    WidgetSettingBackgroundVibration getBackgroundVibration() const;
+    bool operator ==(const WidgetSettingList& other) const;
+
+  private:
+    void displayError(const DPL::String& name, const DPL::String& value);
+
+    bool m_logEnable;
+    WidgetSettingScreenLock m_RotationLock;
+    WidgetSettingIndicatorPresence m_IndicatorPresence;
+    WidgetSettingBackButtonPresence m_BackButtonPresence;
+    WidgetSettingContextMenu m_ContextMenu;
+    WidgetSettingEncryption m_Encryption;
+    WidgetSettingBackgroundSupport m_BackgroundSupport;
+    WidgetSettingProgressBarPresence m_ProgressbarPresence;
+    WidgetSettingHWkeyEventPresence m_HWkeyEvent;
+#if USE(EA_SCREEN_READER)
+    WidgetSettingAccessibility m_Accessibility;
+#endif
+    WidgetSettingSoundMode m_SoundMode;
+    WidgetSettingBackgroundVibration m_BackgroundVibration;
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+    std::string m_UserAgent;
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+};
+typedef std::shared_ptr<WidgetSettingList> WidgetSettingListPtr;
+
+namespace OrientationAngle {
+namespace W3C {
+namespace Portrait {
+const int PRIMARY  = 0;
+const int SECONDARY = 180;
+} // namespace Portrait
+namespace Landscape {
+const int PRIMARY  = 90;
+const int SECONDARY = -90;
+} // namespace Landscape
+} // namespace W3C
+namespace Window {
+namespace Portrait {
+const int PRIMARY  = 0;
+const int SECONDARY = 180;
+} // namespace Portrait
+namespace Landscape {
+const int PRIMARY  = 270;
+const int SECONDARY = 90;
+} // namespace Landscape
+const int UNLOCK = -1;
+} // namespace Window
+} // namespace OrientationAngle
+
+namespace KeyName {
+const std::string BACK = "back";
+const std::string MENU = "menu";
+} // KeyName
+
+enum ConsoleLogLevel {
+    Debug = 0,
+    Warning = 1,
+    Error = 2,
+};
+#endif /* WRT_SRC_DOMAIN_WIDGET_DATA_TYPES_H_ */
diff --git a/src/domain/widget_deserialize_model.cpp b/src/domain/widget_deserialize_model.cpp
new file mode 100644 (file)
index 0000000..842506d
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    widget_deserialize_model.h
+ * @author  Piotr Marcinkiewicz (p.marcinkiew@samsung.com)
+ * @version 1.0
+ * @brief   Widget deserialization creates WidgetModel from WidgetDAOReadOnly
+ */
+
+#include "widget_model.h"
+
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/wrt-dao-ro/widget_config.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/optional_typedefs.h>
+// to apply widget default locales instead of calling localizeWidgetModel()
+#include <dpl/localization/LanguageTagsProvider.h>
+
+namespace Domain {
+std::string getTimestamp()
+{
+    struct timeval tv;
+    char buff[128];
+
+    gettimeofday(&tv, NULL);
+    sprintf(buff, "%lf", (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f);
+    WrtLogD("timestamp: %s", buff);
+    return std::string(buff);
+}
+
+std::shared_ptr<WidgetModel> deserializeWidgetModel(const std::string& tizenId)
+{
+    std::shared_ptr<WidgetModel> model;
+    DPL::String dplTizenId(DPL::FromUTF8String(tizenId));
+    if (WrtDB::WidgetDAOReadOnly::isWidgetInstalled(dplTizenId)) {
+        WrtLogD("Widget installed - creating model");
+        model.reset(new WidgetModel(tizenId));
+
+        WrtDB::WidgetDAOReadOnly dao(dplTizenId);
+        DPL::String pkgId = dao.getTizenPkgId();
+        model->PersistentStoragePath.Set(
+            DPL::FromUTF8String(
+                WrtDB::WidgetConfig::GetWidgetPersistentStoragePath(pkgId)));
+        model->TemporaryStoragePath.Set(
+            DPL::FromUTF8String(
+                WrtDB::WidgetConfig::GetWidgetTemporaryStoragePath(pkgId)));
+
+        DPL::OptionalString defloc = model->defaultlocale.Get();
+        if (!!defloc) {
+            LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(
+                *defloc);
+        }
+
+        WrtDB::WidgetAccessInfoList widgetAccessInfoList;
+        // widgetAccessInfoList is output parameter
+        dao.getWidgetAccessInfo(widgetAccessInfoList);
+        model->AccessList.Set(widgetAccessInfoList);
+
+        // Widget app-control information data
+        WrtDB::WidgetAppControlList widgetApplicationControlList;
+        // widgetApplicationControlList is output parameter
+        dao.getAppControlList(widgetApplicationControlList);
+        model->AppControlList.Set(widgetApplicationControlList);
+
+        // Set Widget Settings
+        WrtDB::WidgetSettings widgetSettings;
+        dao.getWidgetSettings(widgetSettings);
+        model->SettingList.Set(widgetSettings);
+    } else {
+        WrtLogE("Widget is not installed - model not created");
+    }
+    return model;
+}
+
+} //Namespace Domain
+
diff --git a/src/domain/widget_deserialize_model.h b/src/domain/widget_deserialize_model.h
new file mode 100644 (file)
index 0000000..5e277ed
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    widget_deserialize_model.h
+ * @author  Piotr Marcinkiewicz (p.marcinkiew@samsung.com)
+ * @version 1.0
+ * @brief   Widget deserialization creates WidgetModel from WidgetDAO
+ */
+#ifndef WRT_ENGINE_SRC_DOMAIN_WIDGET_DESERIALIZE_MODEL_H_
+#define WRT_ENGINE_SRC_DOMAIN_WIDGET_DESERIALIZE_MODEL_H_
+
+#include <memory>
+#include <string>
+#include <widget_model.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
+#include <dpl/optional_typedefs.h>
+
+namespace Domain {
+/**
+ * @brief Creates widget model associated with selected
+ * @param[in] tizenId
+ * @param[in] service index, NULL for widget content
+ * @retval WidgetModel
+ */
+ std::shared_ptr<WidgetModel> deserializeWidgetModel(const std::string& tizenId);
+} //Namespace Domain
+
+#endif // ifndef WRT_ENGINE_SRC_DOMAIN_WIDGET_DESERIALIZE_MODEL_H_
+
diff --git a/src/domain/widget_model.cpp b/src/domain/widget_model.cpp
new file mode 100644 (file)
index 0000000..7f806fe
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    widget_model.cpp
+ * @author  Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
+ * @version 1.0
+ * @brief   Implementation file for widget model
+ */
+#include "widget_model.h"
+
+#include <dpl/event/model_bind_to_dao.h>
+#include <dpl/platform.h>
+#include <dpl/sstream.h>
+#include <dpl/utils/folder_size.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+
+using namespace WrtDB;
+
+template <typename RetType, RetType(WidgetDAOReadOnly::*extFun) () const >
+struct BindToWidgetDAO :
+    DPL::Event::BindToDAO<WidgetModel,
+                          RetType,
+                          DPL::String,
+                          WidgetDAOReadOnly,
+                          &WidgetModel::getTizenId,
+                          extFun>
+{};
+
+template <typename RetType, RetType(*extFun) (DPL::String)>
+struct BindToWidgetDAOStatic :
+    DPL::Event::BindToDAO_Static<WidgetModel,
+                                 RetType,
+                                 DPL::String,
+                                 &WidgetModel::getTizenId,
+                                 extFun>
+{};
+
+WidgetModel::WidgetModel(const std::string &tizenId) :
+    TizenId(DPL::FromASCIIString(tizenId)),
+    TzPkgId(this, &BindToWidgetDAO<WrtDB::TizenPkgId,
+                                   &WidgetDAOReadOnly::getTizenPkgId>::Get),
+    Type(this, &BindToWidgetDAO<WidgetType,
+                                &WidgetDAOReadOnly::getWidgetType>::Get),
+    CspPolicy(this, &BindToWidgetDAO<DPL::OptionalString,
+                                     &WidgetDAOReadOnly::getCspPolicy>::Get),
+    CspReportOnlyPolicy(this, &BindToWidgetDAO<DPL::OptionalString,
+                        &WidgetDAOReadOnly::getCspPolicyReportOnly>::Get),
+    StartURL(this),
+    //localized, so not binded
+    StartFileInfo(this),
+#if ENABLE(APP_SCHEME)
+    PrefixURL(this, DPL::String(L"app://") + DPL::FromASCIIString(tizenId) + DPL::String(L"/")),
+#else
+    //localized, so not binded
+    // file:// + / : without "/" path, webkit return security error
+    PrefixURL(this, DPL::String(L"file:///")),
+#endif
+    InstallPath(
+        this,
+        &BindToWidgetDAO<DPL::String, &WidgetDAOReadOnly::getFullPath>::Get),
+    PersistentStoragePath(this),
+    TemporaryStoragePath(this),
+    defaultlocale(
+        this,
+        &BindToWidgetDAO<DPL::OptionalString,
+                         &WidgetDAOReadOnly::getDefaultlocale>::Get),
+    Name(this),
+    //localized, so not binded
+    ShortName(this),
+    //localized, so not binded
+    Description(this),
+    //localized, so not binded
+    License(this),
+    //localized, so not binded
+    LicenseHref(this),
+    //localized, so not binded
+    Icon(this),
+    SplashImg(
+        this,
+        &BindToWidgetDAO<DPL::OptionalString,
+                         &WidgetDAOReadOnly::getSplashImgSrc>::Get),
+    RequiredVersion(this, &BindToWidgetDAO<DPL::OptionalString, &WidgetDAOReadOnly::getMinimumWacVersion>::Get),
+    WindowModes(
+        this,
+        &BindToWidgetDAO<WindowModeList,
+                         &WidgetDAOReadOnly::getWindowModes>::Get),
+    //localized, so not binded
+    //    AccessNetwork(this, false),
+    //    WarpDefinitionEmpty(this),
+    BackSupported(
+        this,
+        //TODO this type has to be here now, as Property constructor is wrongly
+        //chosen
+        (DPL::Event::Property<bool,
+                              DPL::Event::PropertyReadOnly,
+                              DPL::Event::PropertyStorageDynamicCached>::
+             ReadDelegateType) &
+        BindToWidgetDAO<bool, &WidgetDAOReadOnly::getBackSupported>::Get),
+    AccessList(this),
+    SettingList(this),
+    AppControlList(this),
+    WidgetPrivilegeList(this, &BindToWidgetDAO<PrivilegeList, &WidgetDAOReadOnly::getWidgetPrivilege>::Get),
+    SecurityModelVersion(this, &BindToWidgetDAO<WidgetSecurityModelVersion, &WidgetDAOReadOnly::getSecurityModelVersion>::Get)
+{}
+
+DPL::String WidgetModel::getTizenId() const
+{
+    return TizenId;
+}
diff --git a/src/domain/widget_model.h b/src/domain/widget_model.h
new file mode 100644 (file)
index 0000000..48aa76c
--- /dev/null
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    widget_model.h
+ * @author  Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
+ * @version 1.0
+ * @brief   Header file for widget model
+ */
+#ifndef SRC_DOMAIN_WIDGET_MODEL_H
+#define SRC_DOMAIN_WIDGET_MODEL_H
+
+#include <memory>
+#include <string>
+
+#include <dpl/event/model.h>
+#include <dpl/event/property.h>
+#include <dpl/optional_typedefs.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h> // definition of WidgetHandle
+
+#include "widget_data_types.h"
+
+/**
+ * @brief Widget model
+ *
+ * Widget model is the core object that hold information about
+ * properties of widget. After wrt launch each widget contained in database is
+ * mapped to WidgetModel.
+ *
+ * Widget model is a type of MVC model, so it is possible to listen for it's
+ * changes.
+ *
+ */
+class WidgetModel : public DPL::Event::Model
+{
+  public:
+
+    /**
+     * @brief Tizen id
+     *
+     *  ex> "TizenIDabc.appname"
+     *
+     *  - TizenId / AppId : "TizenIDabc.appname"
+     *  - TzPkgId         : "TizenIDabc"
+     *  - App name        : "appname"
+     *
+     */
+    DPL::String TizenId;
+    DPL::Event::Property<WrtDB::TizenPkgId,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached> TzPkgId;
+
+    /**
+     * @brief Widget type
+     *
+     * Note: This is a readonly property
+     */
+    DPL::Event::Property<WrtDB::WidgetType,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached> Type;
+
+    /**
+     * @brief Config file based csp policy
+     */
+    DPL::Event::Property<DPL::OptionalString,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached> CspPolicy;
+
+    /**
+     * @brief Config file based csp policy - report only
+     */
+    DPL::Event::Property<DPL::OptionalString,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached>
+    CspReportOnlyPolicy;
+
+    /**
+     * @brief Start URL for widget
+     */
+    DPL::Event::Property<DPL::OptionalString> StartURL;
+
+    /**
+     * @brief Start URL information for widget
+     */
+    DPL::Event::Property<OptionalWidgetStartFileInfo> StartFileInfo;
+
+    /**
+     * @brief Prefix URL for widget
+     *
+     * This is a prefix address of html file that widget is displaying.
+     * The whole address is PrefixURL + StartURL.
+     */
+    DPL::Event::Property<DPL::String, DPL::Event::PropertyReadOnly> PrefixURL;
+
+    /**
+     * @brief Install path for widget
+     *
+     * Gets path in which files of widget are being kept
+     */
+    DPL::Event::Property<DPL::String,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached> InstallPath;
+
+    /**
+     * @brief Path to widget's persistent storage.
+     *
+     * Gets path in which widget may store its persistent private data.
+     */
+    DPL::Event::Property<DPL::String> PersistentStoragePath;
+
+    /**
+     * @brief Path to widget's temporary storage.
+     *
+     * Gets path in which widget may store its temporary private data.
+     */
+    DPL::Event::Property<DPL::String> TemporaryStoragePath;
+
+    /**
+     * @brief Widget defaultlocale
+     */
+    DPL::Event::Property<DPL::OptionalString,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached>
+    defaultlocale;
+
+    /**
+     * @brief Widget name
+     */
+    DPL::Event::Property<DPL::OptionalString> Name;
+
+    /**
+     * @brief Widget short name
+     */
+    DPL::Event::Property<DPL::OptionalString> ShortName;
+
+    /**
+     * @brief Widget description
+     */
+    DPL::Event::Property<DPL::OptionalString> Description;
+
+    /**
+     * @brief Widget license
+     */
+    DPL::Event::Property<DPL::OptionalString> License;
+
+    /**
+     * @brief Widget license href
+     */
+    DPL::Event::Property<DPL::OptionalString> LicenseHref;
+
+    /**
+     * @brief Widget icon
+     */
+    DPL::Event::Property<OptionalWidgetIcon> Icon;
+
+    /**
+     * @brief Widget splash image src
+     */
+    DPL::Event::Property<DPL::OptionalString,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached> SplashImg;
+
+    /**
+     * @brief Widget TizenRequired(minimum) Version
+     */
+    DPL::Event::Property<DPL::OptionalString,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached> RequiredVersion;
+
+    /**
+     * @brief window mode
+     */
+    DPL::Event::Property<WrtDB::WindowModeList,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamic> WindowModes;
+
+    //    /**
+    //     * @brief Value of network element.
+    //     */
+    //    DPL::Event::Property<bool,
+    //                  DPL::Event::PropertyReadOnly> AccessNetwork;
+
+    //    /**
+    //     * @brief Does widget contain WARP definitions.
+    //     */
+    //    DPL::Event::Property<bool> WarpDefinitionEmpty;
+
+    /**
+     * @brief Is back supported
+     */
+    DPL::Event::Property<bool,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached>
+    BackSupported;
+
+    /**
+     * @brief Widget access list
+     */
+    DPL::Event::Property<WidgetAccessList> AccessList;
+
+    DPL::Event::Property<WidgetSettingList> SettingList;
+
+    /**
+     * @brief Widget app-control list
+     */
+    DPL::Event::Property<WrtDB::WidgetAppControlList> AppControlList;
+
+    /**
+     * @brief Widget Privilege list
+     */
+    DPL::Event::Property<WrtDB::PrivilegeList,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamic> WidgetPrivilegeList;
+
+    DPL::Event::Property<WrtDB::WidgetSecurityModelVersion,
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached> SecurityModelVersion;
+
+    WidgetModel(const std::string &tizenId);
+
+  private:
+    DPL::String getTizenId() const;
+};
+typedef std::shared_ptr<WidgetModel> WidgetModelPtr;
+
+#endif // SRC_DOMAIN_WIDGET_MODEL_H
diff --git a/src/domain/widget_string.h b/src/domain/widget_string.h
new file mode 100644 (file)
index 0000000..419a1c7
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file       widget_string.h
+ * @author     Jihoon Chung(jihoon.chung@samsung.com)
+ * @version    0.1
+ * @brief
+ */
+
+#ifndef WRT_SRC_DOMAIN_WIDGET_STRING_H_
+#define WRT_SRC_DOMAIN_WIDGET_STRING_H_
+
+#include <app.h>
+#include <initializer_list>
+#include <string>
+
+#include <dpl/log/wrt_log.h>
+
+#define WRT_PS "%s"
+#define WRT_PNS "%d$s"
+
+namespace WrtText {
+inline std::string replacePS(std::initializer_list<std::string> strs) {
+    std::size_t size = strs.size();
+    if (size <= 1 || size >= 10) {
+        return std::string("");
+    }
+
+    std::initializer_list<std::string>::iterator it = strs.begin();
+    std::string ret = *strs.begin();
+    std::string arg = *(++it);
+
+    // %s -> arg
+    std::size_t ps = ret.find(WRT_PS);
+    if (ps != std::string::npos) {
+        ret.replace(ps, std::string(WRT_PS).length(), arg);
+        return ret;
+    }
+
+    // %n$s -> n_arg
+    std::string n = "1";
+    for ( ; it != strs.end(); ++it) {
+        std::string pns = WRT_PNS;
+        pns.replace(1, 1, n);
+        n[0]++;
+        ret.replace(ret.find(pns), 4, (*it).c_str());
+    }
+    return ret;
+}
+}
+
+#define WRT_SK_OK dgettext("sys_string", "IDS_COM_SK_OK")
+#define WRT_SK_YES dgettext("sys_string", "IDS_COM_SK_YES")
+#define WRT_SK_NO dgettext("sys_string", "IDS_COM_SK_NO")
+#define WRT_SK_LOGIN dgettext("sys_string", "IDS_COM_BUTTON_LOGIN")
+#define WRT_SK_CANCEL dgettext("wrt", "IDS_BR_SK_CANCEL")
+#define WRT_OPT_ALLOW dgettext("wrt", "IDS_BR_OPT_ALLOW")
+#define WRT_OPT_DENY dgettext("wrt", "IDS_COM_BODY_DENY")
+
+#define WRT_POP_USERMEDIA_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_USE_YOUR_CAMERA")
+#define WRT_POP_WEB_NOTIFICATION_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_SHOW_NOTIFICATIONS")
+#define WRT_POP_GEOLOCATION_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_ACCESS_YOUR_LOCATION")
+#define WRT_POP_WEB_STORAGE_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_ATTEMPTING_TO_STORE_A_LARGE_AMOUNT_OF_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE")
+#define WRT_POP_APPLICATION_CACHE_PERMISSION dgettext("wrt", "IDS_BR_POP_P1SS_HP2SS_IS_REQUESTING_PERMISSION_TO_STORE_DATA_ON_YOUR_DEVICE_FOR_OFFLINE_USE")
+#define WRT_POP_STARTING_DOWNLOADING dgettext("wrt", "IDS_BR_POP_STARTING_DOWNLOAD_ING")
+#define WRT_POP_CERTIFICATE_PERMISSION dgettext("wrt", "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG")
+#define WRT_BODY_AUTHENTICATION_REQUIRED dgettext("wrt", "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED")
+#define WRT_BODY_PASSWORD dgettext("wrt", "IDS_BR_BODY_PASSWORD")
+#define WRT_BODY_AUTHUSERNAME dgettext("wrt", "IDS_BR_BODY_AUTHUSERNAME")
+#define WRT_BODY_REMEMBER_PREFERENCE dgettext("wrt", "IDS_BR_BODY_REMEMBER_PREFERENCE")
+#define WRT_POP_CLEAR_DEFAULT_SETTINGS dgettext("wrt", "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL")
+
+#define WRT_SK_OK_IDS "IDS_COM_SK_OK"
+#define WRT_SK_LOGIN_IDS "IDS_COM_BUTTON_LOGIN"
+#define WRT_SK_CANCEL_IDS "IDS_BR_SK_CANCEL"
+#define WRT_OPT_ALLOW_IDS "IDS_BR_OPT_ALLOW"
+#define WRT_OPT_DENY_IDS "IDS_COM_BODY_DENY"
+
+#define WRT_BODY_AUTHENTICATION_REQUIRED_IDS "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED"
+#define WRT_BODY_REMEMBER_PREFERENCE_IDS "IDS_BR_BODY_REMEMBER_PREFERENCE"
+#define WRT_POP_CLEAR_DEFAULT_SETTINGS_IDS "IDS_ST_POP_CLEAR_DEFAULT_APP_SETTINGS_BY_GOING_TO_SETTINGS_GENERAL_MANAGE_APPLICATIONS_ALL"
+
+#endif // WRT_SRC_DOMAIN_WIDGET_STRING_H_
diff --git a/src/pre-launching/pre_launching_support.cpp b/src/pre-launching/pre_launching_support.cpp
new file mode 100644 (file)
index 0000000..27497d1
--- /dev/null
@@ -0,0 +1,223 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    pre_launching_support.cpp
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 0.1
+ * @brief   Implementation for pre-launching support
+ */
+
+#include "pre_launching_support.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include <aul.h>
+#include <appcore-efl.h>
+#include <dpl/assert.h>
+#include <dpl/availability.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/singleton_safe_impl.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <Elementary.h>
+
+IMPLEMENT_SAFE_SINGLETON(PreLaunchingSupport)
+
+namespace {
+const float PRELAUNCHING_DEFAULT_DEFER_TIME = 2.5;
+const float PRELAUNCHING_DEFER_TIME = 1.0;
+const int   PRELAUNCHING_MAX_WAIT_TIME = 6;
+const std::string JS_FLAG_NAME = "tizenPreLaunch";
+
+// Function declare
+int appcoreOpenCallback(void* data);
+Eina_Bool deferredTimerCallback(void* data);
+
+int appcoreOpenCallback(void* data)
+{
+    DPL_UNUSED_PARAM(data);
+
+    if (PreLaunchingSupportSingleton::Instance().isPreLaunching()) {
+        PreLaunchingSupportSingleton::Instance().resume();
+        PreLaunchingSupportSingleton::Instance().finalize();
+    }
+
+    return 0;
+}
+
+Eina_Bool deferredTimerCallback(void* data)
+{
+    DPL_UNUSED_PARAM(data);
+
+    if (PreLaunchingSupportSingleton::Instance().isPreLaunching()) {
+        WrtLogD("suspend()");
+        PreLaunchingSupportSingleton::Instance().suspend();
+    }
+    PreLaunchingSupportSingleton::Instance().resetTimer();
+
+    return EINA_FALSE;
+}
+} // anonymous namespace
+
+void PreLaunchingSupport::setPreLaunching(bundle* b)
+{
+    if (b) {
+        const char* value = bundle_get_val(b, AUL_K_PRELAUCHING);
+
+        if (value != NULL) {
+            m_state = IN_PRE_LAUNCHING;
+            setenv("WRT_PRE_LAUNCHING_MODE", "TRUE", 1);
+            appcore_set_prelaunching(true);
+
+            WrtLogD("Pre-launching has been enabled!");
+        }
+    }
+}
+
+void PreLaunchingSupport::setJavascriptExecuteFlag(bool flag)
+{
+    if (!m_jsExecuteFlag && flag)
+    {
+        m_jsExecuteFlag = true;
+
+        std::stringstream script;
+        script << "var " << JS_FLAG_NAME << " = true";
+
+        WrtLogD("executing javascript : [%s]", script.str().c_str());
+        ewk_view_script_execute(m_ewkView, script.str().c_str(), NULL, NULL);
+    }
+    else if (m_jsExecuteFlag && !flag)
+    {
+        m_jsExecuteFlag = false;
+
+        std::stringstream script;
+        script << JS_FLAG_NAME << " = false";
+
+        WrtLogD("executing javascript : [%s]", script.str().c_str());
+        ewk_view_script_execute(m_ewkView, script.str().c_str(), NULL, NULL);
+    }
+}
+
+void PreLaunchingSupport::setEwkViewSuspended(bool suspend)
+{
+    m_ewkViewSuspended = suspend;
+}
+
+bool PreLaunchingSupport::isPreLaunching(void)
+{
+    return (m_state != NOT_PRE_LAUNCHING_MODE);
+}
+
+bool PreLaunchingSupport::isEwkViewSuspended()
+{
+    return m_ewkViewSuspended;
+}
+
+void PreLaunchingSupport::resetTimer(void)
+{
+    m_pauseTimerStartTime = 0;
+
+    if (m_pauseTimer)
+    {
+        ecore_timer_del(m_pauseTimer);
+        m_pauseTimer = NULL;
+    }
+}
+
+void PreLaunchingSupport::initialize(Evas_Object* ewkView, Evas_Object* window)
+{
+    WrtLogD("initialize called");
+
+    Assert(ewkView);
+    Assert(window);
+
+    m_ewkView = ewkView;
+    m_window = window;
+    appcore_set_open_cb(appcoreOpenCallback, NULL);
+}
+
+void PreLaunchingSupport::updateRender(void)
+{
+    WrtLogD("updateRender called");
+
+    if (isPreLaunching())
+    {
+        if (NULL == m_pauseTimer)
+        {
+            m_pauseTimer = ecore_timer_add(PRELAUNCHING_DEFAULT_DEFER_TIME, deferredTimerCallback, NULL);
+            if (NULL == m_pauseTimer)
+            {
+                WrtLogW("Fail to add timer");
+                // Fail to add timer. Move to suspend with current state.
+                resetTimer();
+                suspend();
+                return;
+            }
+            m_pauseTimerStartTime = time(NULL);
+        }
+        else
+        {
+            time_t curTime = time(NULL);
+            time_t diffTime = curTime - m_pauseTimerStartTime;
+
+            if (diffTime < PRELAUNCHING_MAX_WAIT_TIME)
+            {
+                ecore_timer_reset(m_pauseTimer);
+                WrtLogD("enterAppcorePause() is delayed! + %f sec", PRELAUNCHING_DEFER_TIME);
+            }
+        }
+    }
+}
+
+void PreLaunchingSupport::resume(void)
+{
+    WrtLogD("resume called");
+
+    Assert(m_ewkView);
+    Assert(m_window);
+
+    setJavascriptExecuteFlag(false);
+    ewk_view_page_visibility_state_set(m_ewkView, EWK_PAGE_VISIBILITY_STATE_VISIBLE, EINA_TRUE);
+    ewk_view_visibility_set(m_ewkView, EINA_TRUE);
+    elm_win_render(m_window);
+    evas_object_show(m_window);
+}
+
+void PreLaunchingSupport::suspend(void)
+{
+    WrtLogD("suspend called");
+
+    appcore_efl_goto_pause();
+}
+
+void PreLaunchingSupport::finalize(void)
+{
+    WrtLogD("finalize called");
+
+    m_state = NOT_PRE_LAUNCHING_MODE;
+    resetTimer();
+    m_ewkView = NULL;
+    m_window = NULL;
+
+    appcore_set_prelaunching(false);
+    appcore_set_open_cb(NULL, NULL);
+}
+
diff --git a/src/pre-launching/pre_launching_support.h b/src/pre-launching/pre_launching_support.h
new file mode 100644 (file)
index 0000000..2622855
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    pre_launching_support.h
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 0.1
+ */
+
+#ifndef PRE_LAUNCGING_SUPPORT_H
+#define PRE_LAUNCHING_SUPPORT_H
+
+#include <sys/time.h>
+
+#include <bundle.h>
+#include <dpl/singleton.h>
+#include <Ecore.h>
+#include <Evas.h>
+
+class PreLaunchingSupport {
+    enum PreLaunchingState
+    {
+        NOT_PRE_LAUNCHING_MODE,
+        IN_PRE_LAUNCHING,
+    };
+
+  public:
+    void setPreLaunching(bundle* b);
+    void setJavascriptExecuteFlag(bool flag);
+    void setEwkViewSuspended(bool suspend);
+
+    bool isPreLaunching(void);
+    bool isEwkViewSuspended();
+
+    void initialize(Evas_Object* ewkView, Evas_Object* window);
+    void updateRender(void);
+    void resume(void);
+    void suspend(void);
+    void finalize(void);
+    void resetTimer(void);
+
+  private:
+    PreLaunchingState m_state;
+    Ecore_Timer* m_pauseTimer;
+    time_t m_pauseTimerStartTime;
+    bool m_ewkViewSuspended;
+    bool m_jsExecuteFlag;
+    Evas_Object* m_ewkView;
+    Evas_Object* m_window;
+
+    friend class DPL::Singleton<PreLaunchingSupport>;
+
+    PreLaunchingSupport() :
+        m_state(NOT_PRE_LAUNCHING_MODE),
+        m_pauseTimer(NULL),
+        m_pauseTimerStartTime(0),
+        m_ewkViewSuspended(false),
+        m_jsExecuteFlag(false),
+        m_ewkView(NULL),
+        m_window(NULL)
+    {
+    }
+};
+
+typedef DPL::Singleton<PreLaunchingSupport> PreLaunchingSupportSingleton;
+
+#endif // PRE_LAUNCHING_SUPPORT_H
diff --git a/src/profiling/CMakeLists.txt b/src/profiling/CMakeLists.txt
new file mode 100644 (file)
index 0000000..768de1a
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+PKG_SEARCH_MODULE(PROFILING_DEPS REQUIRED dpl-efl)
+
+ADD_LIBRARY(${TARGET_PROFILING_LIB} SHARED
+    ${PROJECT_SOURCE_DIR}/src/profiling/profiling_util.cpp
+)
+
+SET_TARGET_PROPERTIES(${TARGET_PROFILING_LIB} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_PROFILING_LIB} PROPERTIES
+    VERSION ${PROJECT_VERSION}
+    SOVERSION ${PROJECT_API_VERSION})
+
+INCLUDE_DIRECTORIES(${PROFILING_DEPS_CFLAGS})
+
+SET_TARGET_PROPERTIES(${TARGET_PROFILING_LIB} PROPERTIES
+    COMPILE_FLAGS -fPIC)
+
+TARGET_LINK_LIBRARIES(${TARGET_PROFILING_LIB}
+    ${PROFILING_DEPS_LIBRARIES}
+)
+
+INSTALL(TARGETS ${TARGET_PROFILING_LIB}
+    DESTINATION lib
+    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+    GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+)
diff --git a/src/profiling/profiling_util.cpp b/src/profiling/profiling_util.cpp
new file mode 100644 (file)
index 0000000..aa30eca
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file
+ * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @version     1.0
+ * @brief       This is implementation file for profiling function.
+ */
+
+#include "profiling_util.h"
+
+#include <vector>
+#include <cstdio>
+#include <cstdlib>
+
+#include <sys/time.h>
+#include <signal.h>
+
+#include <dpl/foreach.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/mutex.h>
+#include <dpl/static_block.h>
+#include <dpl/assert.h>
+
+namespace {
+const int PROFILING_OUTPUT_DESCRIPTOR = 3;
+
+unsigned long long toULong(const struct timeval& value)
+{
+    unsigned long long ret = static_cast<unsigned long long>(value.tv_sec) *
+        1000000ULL;
+    ret += static_cast<unsigned long long>(value.tv_usec);
+    return ret;
+}
+
+struct PacketResult
+{
+    unsigned long long time;
+    const char* name;
+    const char* prefix;
+    const char* description;
+    PacketResult() :
+        time(0),
+        name(0),
+        prefix(0),
+        description(0)
+    {}
+    PacketResult(unsigned long long t,
+                 const char* n,
+                 const char* p,
+                 const char* d) :
+        time(t),
+        name(n),
+        prefix(p),
+        description(d)
+    {}
+
+    void Print(FILE *filePtr)
+    {
+        if (!prefix) {
+            prefix = "";
+        }
+        if (!description) {
+            description = "";
+        }
+        fprintf(filePtr, "%s#%s#%llu#[%s]\n", prefix, name, time, description);
+    }
+};
+
+std::vector<PacketResult> results;
+
+void dumpStatistic()
+{
+    FILE* fp = NULL;
+    int newfd = dup(PROFILING_OUTPUT_DESCRIPTOR);
+    if (-1 != newfd) {
+        fp = fdopen(newfd, "w");
+    }
+    if (!fp) {
+        if (-1 != newfd) {
+            close(newfd);
+        }
+        fp = stdout; //fallback
+    }
+    fprintf(fp, "###PROFILING###START###\n");
+    FOREACH(result, results)
+    {
+        result->Print(fp);
+    }
+    fprintf(fp, "###PROFILING###STOP###\n");
+    fflush(fp);
+    if (stdout != fp) {
+        fclose(fp); // newfd is also closed
+    }
+}
+
+void sigUsrHandler(int /*num*/)
+{
+    dumpStatistic();
+}
+
+DPL::Mutex* m_mutex = NULL;
+
+void initialize()
+{
+    m_mutex = new DPL::Mutex;
+    results.reserve(64 * 1024);
+    signal(SIGUSR1, &sigUsrHandler);
+    signal(SIGUSR2, &sigUsrHandler);
+    WrtLogD("Initialized profiling");
+    AddProfilingMeasurment("Profiling_Started");
+}
+
+std::string GetFormattedTime()
+{
+    timeval tv;
+    tm localNowTime;
+
+    gettimeofday(&tv, NULL);
+    localtime_r(&tv.tv_sec, &localNowTime);
+
+    char format[64];
+    snprintf(format,
+             sizeof(format),
+             "%02i:%02i:%02i.%03i",
+             localNowTime.tm_hour,
+             localNowTime.tm_min,
+             localNowTime.tm_sec,
+             static_cast<int>(tv.tv_usec / 1000));
+    return format;
+}
+} // namespace anonymous
+
+void AddStdoutProfilingMeasurment(const char* name, bool start)
+{
+    Assert(m_mutex != NULL);
+    std::ostringstream output;
+    output << "[" << GetFormattedTime() << "] [](): " << name << " ";
+    output << (start ? "profiling##start" : "profiling##stop");
+    fprintf(stdout, "%s\n", output.str().c_str());
+}
+
+#ifdef __cplusplus
+extern "C"
+#endif
+void AddProfilingMeasurment(const char* name,
+                            const char* prefix,
+                            const char* description)
+{
+    DPL::Mutex::ScopedLock lock(m_mutex);
+    struct timeval value;
+    gettimeofday(&value, NULL);
+    results.push_back(
+        PacketResult(toULong(value), name, prefix, description));
+}
+
+STATIC_BLOCK
+{
+    initialize();
+}
+
diff --git a/src/profiling/profiling_util.h b/src/profiling/profiling_util.h
new file mode 100644 (file)
index 0000000..3ce0de5
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file
+ * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @version     1.0
+ * @brief       This is header file for profiling function.
+ */
+
+#ifndef WRT_ENGINE_SRC_PROFILING_PROFILING_UTIL_H
+#define WRT_ENGINE_SRC_PROFILING_PROFILING_UTIL_H
+
+#ifdef PROFILING_ENABLED
+
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif //__cplusplus
+
+#ifdef __cplusplus
+extern "C"
+void AddProfilingMeasurment(const char* name,
+                            const char* prefix = 0,
+                            const char* description = 0);
+#define ADD_PROFILING_POINT(name, ...) AddProfilingMeasurment(name, \
+                                                              ##__VA_ARGS__)
+#else //__cplusplus
+void AddProfilingMeasurment(const char* name,
+                            const char* prefix,
+                            const char* description);
+#define ADD_PROFILING_POINT(name, prefix, desc) AddProfilingMeasurment(name, \
+                                                                       prefix, \
+                                                                       desc)
+#endif //__cplusplus
+
+void AddStdoutProfilingMeasurment(const char* name, bool start);
+// profiling script additional proceeds stdout output
+#define LOG_PROFILE_START(x) AddStdoutProfilingMeasurment(x, true)
+#define LOG_PROFILE_STOP(x) AddStdoutProfilingMeasurment(x, false)
+#else //PROFILING_ENABLED
+
+#define ADD_PROFILING_POINT(name, ...) (void)1
+#define LOG_PROFILE_START(x) (void)1
+#define LOG_PROFILE_STOP(x) (void)1
+
+#endif //PROFILING_ENABLED
+
+#endif /* WRT_ENGINE_SRC_PROFILING_PROFILING_UTIL_H */
+
diff --git a/src/profiling/script/profiling-host-part.pl b/src/profiling/script/profiling-host-part.pl
new file mode 100755 (executable)
index 0000000..fa85be5
--- /dev/null
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+print "Stage 1:\n";
+my @files = `find -name prof-raw-data 2>/dev/null`;
+for my $file (@files) {
+ chomp $file;
+  my $foutPoints = $file; $foutPoints =~ s/raw-data/-data-points/g;
+  my $foutRanges = $file; $foutRanges =~ s/raw-data/-data-ranges/g;
+  #print ">$file< >$fout<\n";
+  #print ">>>~/git/wrt-engine/src/profiling/script/analyse.pl $foutPoints $foutRanges <<<\n";
+  print "grep -v \"PROFILING\" $file | ./utils/analyse.pl $foutPoints $foutRanges\n";
+  `grep -v \"PROFILING\" $file | ./utils/analyse.pl $foutPoints $foutRanges`;
+}
+
+print "Stage 2:\n";
+
+for my $dir (qw{OUTPUT/minimal/cold OUTPUT/minimal/warm OUTPUT/minimal/preload OUTPUT/Jet_Pack_Agent/cold OUTPUT/Jet_Pack_Agent/warm OUTPUT/Jet_Pack_Agent/preload OUTPUT/UnitTest/cold OUTPUT/UnitTest/warm OUTPUT/UnitTest/preload})
+{
+    print $dir, "\n";
+    print "./utils/csv-stats.pl -c -r -s avg \`find $dir -name prof--data-points 2>/dev/null\`  > $dir/outpucik-points\n";
+    print "`./utils/csv-stats.pl -c -r -s avg \`find $dir -name prof--data-ranges 2>/dev/null\`  > $dir/outpucik-ranges\n";
+    `./utils/csv-stats.pl -c -r -s avg \`find $dir -name prof--data-points 2>/dev/null\`  > $dir/outpucik-points`;
+    `./utils/csv-stats.pl -c -r -s avg \`find $dir -name prof--data-ranges 2>/dev/null\`  > $dir/outpucik-ranges`;
+}
+
+print "Stage 3:\n";
+for my $dir (qw{OUTPUT/minimal OUTPUT/Jet_Pack_Agent OUTPUT/UnitTest})
+{
+    my $name = substr($dir, 7);
+    my $file = "$name.svg";
+    my $warm = "$dir/warm/outpucik-points";
+    my $cold = "$dir/cold/outpucik-points";
+    my $preload = "$dir/preload/outpucik-points";
+    my $difffile = "$dir/diff-points";
+    `paste -d, $cold $warm $preload > $difffile`;
+    my $title = "\"Performance profiling of WebRuntime - $name Widget\"";
+
+    my $font = 12;
+
+    my $wheader = 213;
+    my $hheader = 199;
+    my $max = 8100;
+
+    print "+++++++++++++++++++++++++++ $name\n";
+
+
+    my $maxtime = `cat $dir/cold/outpucik-points | tail -n1 | cut -d, -f2`;
+    my $nroftics = int($maxtime/100000 + 1);
+    my $maxtics = $nroftics * 100000;
+    print "NROFTIC: $nroftics\n";
+    my $height = int(20.7 * $nroftics + $hheader);
+    if ($height > $max)
+    {
+        $height = $max;
+    }
+
+    my $lines_count = `wc -l $warm`;
+    $lines_count = $lines_count - 2;
+    print "lc: $lines_count\n";
+    my $width = int(23.5 * $lines_count + $wheader);
+    print "wi: $width\n";
+    if ($width > $max)
+    {
+        my $newfont = int ($font * $max/$width);
+        $width = $max;
+        $height = $hheader + int (($height - $hheader)*$newfont/$font);
+        $font = $newfont
+    }
+
+    print "Generating $file W: $width H: $height F: $font\n\n";
+    print "./utils/generate-plot.sh $warm $cold $preload $file $title $font $width $height $maxtics\n\n\n";
+    `./utils/generate-plot.sh $warm $cold $preload $file $title $font $width $height $maxtics $difffile`;
+}
+
diff --git a/src/profiling/script/profiling-target-part.pl b/src/profiling/script/profiling-target-part.pl
new file mode 100755 (executable)
index 0000000..e20ece2
--- /dev/null
@@ -0,0 +1,308 @@
+#!/usr/bin/env perl
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+##### CONFIGURATION begin #####
+
+my $WIDGET_PACKAGE_DIR = './test-widgets';
+my @WIDGETS = (
+  ['minimal.wgt', 'minimal' ],
+  ['0Jet_Pack_Agent.wgt', 'Jet Pack Agent'],
+  ['UnitTestAuto.wgt', 'UnitTest' ],
+);
+my $WRT_INSTALL_ENV = 'WRT_TEST_MODE=1';
+
+my $WRT_CLIENT_LAUNCH = 'wrt-client -l {}';
+my $WRT_CLIENT_QUERY = 'wrt-launcher -l 2>/dev/null';
+my $WRT_CLIENT_INSTALL = "$WRT_INSTALL_ENV wrt-installer -i {}";
+my $WRT_CLIENT_UNINSTALL = "$WRT_INSTALL_ENV wrt-installer -un {}";
+my $COLD_START_PREPARE_COMMAND = '/sbin/sysctl vm.drop_caches=3';
+my $OUTPUT_DIR = './OUTPUT';
+my $PRELOAD_LIBRARIES = './utils/wrt-preloader';
+
+##### CONFIGURATION end #####
+
+
+use strict;
+use Time::HiRes;
+use Time::Local;
+use List::Util;
+
+
+##### Single test runners
+
+# $stream may be undef - then no output
+sub runWidget {
+  my $widgetTizenId = shift;
+  my $stream = shift;
+  my $streamout = shift;
+  my $fnameerr = shift;
+
+  unless (defined $fnameerr) {
+    $fnameerr = '/dev/null';
+  }
+
+  `mkdir -p $OUTPUT_DIR/tmp`;
+
+  my $fnameerr = "$OUTPUT_DIR/tmp/additional.tmp";
+
+  my $command = $WRT_CLIENT_LAUNCH;
+  $command =~ s/\{\}/$widgetTizenId/;
+  $command .= " 2>$fnameerr 3>$OUTPUT_DIR/tmp/prof.tmp & echo TEST-WIDGET-PID \$\!";
+
+  print "$command\n";
+
+  my ($startSec, $startUSec) = Time::HiRes::gettimeofday();
+
+  my $f;
+  open $f, "$command |";
+
+  my $pid = undef;
+
+  my $extralines  = "";
+
+  while (my $line = <$f>) {
+    print "The line is: $line";
+    if (defined $streamout) {
+      print $streamout $line;
+    }
+    chomp $line;
+    if (my ($p) = $line =~ /^TEST-WIDGET-PID (\d+)/) {
+        $pid = 0+$p;
+    } elsif ($line =~ /launched$/) {
+        print "launched detected $pid\n";
+        kill 10, $pid;
+        my $again = 1;
+        while ($again) {
+            my $t = `tail -1 $OUTPUT_DIR/tmp/prof.tmp`;
+            if ($t =~ /###PROFILING###STOP###/) {
+                $again = 0;
+            }
+        }
+        kill 9, $pid;
+        print "killed\n";
+    } elsif ($line =~ /\[([0-9]*):([0-9]*):([0-9]*).([0-9]*)\][^)]*\): *([A-Za-z0-9 ]+) *profiling##(start|stop)/) { #additionally take point from debug
+        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time());
+        my $name = $5;
+        $hour = $1;
+        $min = $2;
+        $sec = $3;
+        my $msec = $4;
+        my $type = $6;
+        my $value = timelocal($sec,$min,$hour,$mday,$mon,$year);
+        my $value = $msec + 1000 * $value;
+        my $insert = "$type#$name#$value${msec}#[]\n";
+        $extralines = "$extralines$insert";
+    }
+  }
+
+  close $f;
+
+  #TODO: do it perl way
+  `cat $OUTPUT_DIR/tmp/prof.tmp | sort -k3,3 -t"#" -n > $OUTPUT_DIR/tmp/prof.tmp.new && mv $OUTPUT_DIR/tmp/prof.tmp.new $OUTPUT_DIR/tmp/prof.tmp`;
+
+  open my $fin, "<", "$OUTPUT_DIR/tmp/prof.tmp";
+  while (my $line = <$fin>) {
+    chomp $line;
+    if ($line =~ /^#Profiling_Started#/) {
+        if (defined $stream) {
+            printf $stream "#Profiling_Started#%d%06d#[]\n", $startSec, $startUSec;
+        }
+    } elsif ($line =~ /###PROFILING###STOP###/) {
+        if (defined $stream) {
+            print $stream "$extralines###PROFILING###STOP###\n";
+        }
+       } else {
+        if (defined $stream) {
+            print $stream "$line\n";
+        }
+    }
+  }
+  close $fin;
+}
+
+# $mode:
+#   simple       - just run the widget, no special preparations
+#   cold         - after cache clean
+#   warm         - the same widget first launched w/o logs for "warm-up"
+#   double-warm  - two warm-up launches prior to proper test
+#   preload      - preloaded webkit library and its dependencies
+#  TODO - OTHER MODES:
+#     - warming-up with ANOTHER widget?
+#     - warming-up by copying all required binaries/libraries to /dev/null
+#     - running with all binaries/libraries placed on tmpfs (i.e. in cache)
+#     - first clean cache, then fill it with garbage, by copying lots
+#       of useless data from disk to /dev/null, until `free' shows small
+#       enough free memory level
+sub runTest {
+    my $widgetTizenId = shift;
+    my $mode = shift;
+    my $stream = shift;
+    my $streamout = shift;
+    my $fnameerr = shift;
+
+    if ($mode eq 'simple') {
+        # no preparations necessary
+    } elsif ($mode eq 'cold') {
+        `$COLD_START_PREPARE_COMMAND`;
+    } elsif ($mode eq 'warm') {
+        runWidget( $widgetTizenId, undef, undef, undef );
+    } elsif ($mode eq 'double-warm') {
+        runWidget( $widgetTizenId, undef, undef, undef );
+        runWidget( $widgetTizenId, undef, undef, undef );
+    } elsif ($mode eq 'preload') {
+        `$COLD_START_PREPARE_COMMAND`;
+        `$PRELOAD_LIBRARIES`;
+    } else {
+        die;
+    }
+    runWidget( $widgetTizenId, $stream, $streamout, $fnameerr );
+}
+
+##### Widget installation
+
+# returns \% a map: name->tizenId
+sub dropAndInstallAll {
+    my $pwidgets = shift;
+
+    {
+        print "Uninstalling all widgets\n";
+        my @out = `$WRT_CLIENT_QUERY`;
+        for my $line (@out) {
+            if (my ($tizenId) = $line =~ /^\s+\d+.*\s+([A-Za-z0-9]+)$/) {
+                my $command = $WRT_CLIENT_UNINSTALL;
+                $command =~ s/\{\}/$tizenId/g;
+                print "    uninstalling widget $tizenId [$command]\n";
+                `$command > /dev/null 2>/dev/null`;
+            }
+        }
+    }
+    {
+        print "Checking if widget list is empty\n";
+        my @out = `$WRT_CLIENT_QUERY`;
+        for my $line (@out) {
+            if (my ($tizenId) = $line =~ /^\s+\d+.*\s+([A-Za-z0-9]+)$/) {
+                print "WIDGET LIST NOT EMPTY!!!\n";
+                die;
+            }
+        }
+    }
+    {
+        print "Installing all test widgets\n";
+        for my $pwidgetData (@$pwidgets) {
+            my ($package, $name) = @$pwidgetData;
+            my $command = $WRT_CLIENT_INSTALL;
+            $command =~ s/\{\}/$WIDGET_PACKAGE_DIR\/$package/g;
+            print "    installing $name ($package) [$command]\n";
+            `$command > /dev/null 2>/dev/null`;
+        }
+    }
+    {
+        print "Checking if all widgets are installed, determining tizenIds\n";
+        my %widgetMap = ();
+        for my $pwidgetData (@$pwidgets) {
+            my ($package, $name) = @$pwidgetData;
+            $widgetMap{$name} = undef;
+        }
+        my @out = `$WRT_CLIENT_QUERY`;
+        for my $line (@out) {
+            if (my ($name, $trash, $tizenId) = $line =~ /^\s*\d+\s+(([^ ]| [^ ])+)\s+.*\s+([A-Za-z0-9]{10}\.[^\s]+)\s*$/) {
+                print "    found $name (tizenId $tizenId)\n";
+                $widgetMap{$name} = $tizenId;
+            }
+        }
+        for my $name (keys %widgetMap) {
+            unless (defined $widgetMap{$name}) {
+                print "    MISSING $name\n";
+                die;
+            }
+        }
+        return \%widgetMap;
+}
+}
+
+
+##### Test schemes
+
+# PARAMS:
+#   \@ list of widgets  (can be undef, then will use @WIDGETS)
+#   \@ list of modes (modes can be as in runTest)
+#   number of repetitions of one widget/mode pair
+sub fullRandomTest {
+    my $pwidgets = shift; $pwidgets = \@WIDGETS unless defined $pwidgets;
+my $pmodes = shift;
+my $repetitions = shift;
+
+my $pwidgetMap = dropAndInstallAll( $pwidgets );
+
+my @testList = ();
+
+print "Preparing the test list\n";
+for my $pwidget (@$pwidgets) {
+    my ($package, $name) = @$pwidget;
+    for my $mode (@$pmodes) {
+        for (my $number = 0; $number < $repetitions; $number++) {
+            push @testList, [$name, $mode];
+        }
+    }
+}
+
+@testList = List::Util::shuffle( @testList );
+
+print "Clearing the output dir\n";
+`rm -rf $OUTPUT_DIR`;
+
+print "Running tests\n";
+my %runNumbers = ();
+my $globalTestNumber = 0;
+my $totalTestCount = @testList;
+for my $ptest (@testList) {
+    # find test parameters
+    my ($name, $mode) = @$ptest;
+    my $widgetTizenId = $$pwidgetMap{$name};
+    my $runNo = $runNumbers{"$mode|$widgetTizenId"};
+    print "next\n";
+    if (defined $runNo)
+    { $runNo += 1; }
+    else
+    { $runNo = 0; }
+    $runNumbers{"$mode|$widgetTizenId"} = $runNo;
+    $globalTestNumber += 1;
+    print "    Test $globalTestNumber of $totalTestCount: ".
+    "$name ($widgetTizenId) run $runNo, $mode\n";
+
+    # remove and create output dir
+    my $prepName = $name;
+    $prepName =~ s/ /_/g;
+    my $dirName = sprintf "$OUTPUT_DIR/$prepName/$mode/run%03d", $runNo;
+    `mkdir -p $dirName`;
+
+    # create output files
+    open my $outFile, ">", "$dirName/prof-raw-data" or die;
+    open my $dumpOutFile, ">", "$dirName/dump-stdout" or die;
+
+    # run test
+    runTest( $widgetTizenId, $mode, $outFile, $dumpOutFile, "$dirName/dump-stderr" );
+
+    # close output files
+    close $outFile;
+    close $dumpOutFile;
+    print "Done\n";
+}
+}
+
+##### MAIN #####
+
+fullRandomTest( undef, ['cold', 'warm', 'preload'], 10 );
diff --git a/src/profiling/script/ranges b/src/profiling/script/ranges
new file mode 100644 (file)
index 0000000..0b06207
--- /dev/null
@@ -0,0 +1,5 @@
+Whole startup:Profiling_Started-:wrt_launch-stop
+Library loading:Profiling_Started-:main-entered-point
+app_core/dpl operations:main-entered-point:wrt_init-start
+wrt-init:wrt_init-start:wrt_init-stop
+WRT launch:wrt_launch-start:wrt_launch-stop
diff --git a/src/profiling/script/ranges.py b/src/profiling/script/ranges.py
new file mode 100755 (executable)
index 0000000..e6ae996
--- /dev/null
@@ -0,0 +1,68 @@
+#!/usr/bin/python
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+import os,sys
+
+def main():
+  if sys.version[0] != "2":
+    exit(1)
+
+  f = open('ranges', 'r')
+  # Array of ranges.
+  ranges = []
+  for line in f:
+    r = line.rstrip().split(':')
+    r.append(0)
+    r.append(0)
+    r.append(0)
+    ranges.append(r)
+  f.close()
+
+  # find directories with results
+  for root, dirs, files in os.walk('OUTPUT'):
+    path = root.rsplit('/',1)
+    if path[len(path)-1] not in ['cold','warm','preload']:
+      continue
+
+    # open file with measurements
+    print '\n' + root
+    output = open(root + '/outpucik-points', 'r')
+
+    # find matching points
+    for r in ranges:
+      output.seek(0)
+      for l in output:
+        if r[1] in l:
+          r[3] = l.split(',')[1]
+        if r[2] in l:
+          r[4] = l.split(',')[1]
+
+    output.close()
+
+    # calculate the difference
+    for r in ranges:
+      r[5] = int(r[4]) - int(r[3])
+
+    # save calculations
+    results = open(root + '/outpucik-results','w')
+    for r in ranges:
+      print " " + r[0] + ": " + str(float(r[5])/1000) + "ms"
+      results.write(r[0] + ": " + str(float(r[5])/1000) + "ms\n")
+    results.close()
+
+if __name__ == "__main__":
+  main()
+
diff --git a/src/profiling/script/test-widgets/0Jet_Pack_Agent.wgt b/src/profiling/script/test-widgets/0Jet_Pack_Agent.wgt
new file mode 100644 (file)
index 0000000..a9b27fa
Binary files /dev/null and b/src/profiling/script/test-widgets/0Jet_Pack_Agent.wgt differ
diff --git a/src/profiling/script/test-widgets/UnitTestAuto.wgt b/src/profiling/script/test-widgets/UnitTestAuto.wgt
new file mode 100644 (file)
index 0000000..57fb2e4
Binary files /dev/null and b/src/profiling/script/test-widgets/UnitTestAuto.wgt differ
diff --git a/src/profiling/script/test-widgets/minimal.wgt b/src/profiling/script/test-widgets/minimal.wgt
new file mode 100644 (file)
index 0000000..2406783
Binary files /dev/null and b/src/profiling/script/test-widgets/minimal.wgt differ
diff --git a/src/profiling/script/utils/analyse.pl b/src/profiling/script/utils/analyse.pl
new file mode 100755 (executable)
index 0000000..25c1527
--- /dev/null
@@ -0,0 +1,135 @@
+#!/usr/bin/env perl
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+use strict;
+use warnings;
+use diagnostics;
+
+my ($regular_out_file, $range_out_file) = @ARGV;
+
+print "Script requires two arguments,
+which are file names to store the output\n
+Regular points will be stored in first file,
+ranges in second one.\n" and exit unless (defined $regular_out_file and defined $range_out_file);
+
+
+print "Starting analysis\n";
+my @lines = <STDIN>;
+
+my @packets;
+foreach my $line (@lines)
+{
+    chomp($line);
+    my @splitted = split(/#/, $line);
+    my $prefix = $splitted[0];
+    my $name = $splitted[1];
+    my $time = $splitted[2];
+    my $description = $splitted[3];
+    my %packet;
+    $packet{time} = $time;
+    $packet{prefix} = $prefix;
+    $packet{name} = $name;
+    $packet{description} = $description;
+    push @packets, \%packet;
+}
+
+@packets = sort { $$a{time} <=> $$b{time} } @packets;
+
+my $starttime;
+my %tmps;
+my @ranges;
+
+foreach my $packet (@packets)
+{
+    my $name = $$packet{name};
+    my $prefix = $$packet{prefix};
+
+    if (not defined $starttime)
+    {
+        if (defined $name and $name eq "Profiling_Started")
+        {
+            $starttime = $$packet{time};
+        }
+        else
+        {
+            print "***** No Profiling Start Point Found *****\n";
+            exit();
+        }
+    }
+    $$packet{time} = $$packet{time} - $starttime;
+
+    if ($prefix eq "start")
+    {
+        if (exists($tmps{$name}))
+        {
+            print "***** Doubled start point found $name *****\n";
+            print "[$name]\n";
+            exit();
+        }
+        $tmps{$name} = \%$packet;
+    }
+    elsif ($prefix eq "stop")
+    {
+        if (not exists($tmps{$name}))
+        {
+            print "***** No start point found *****\n";
+            exit();
+        }
+        my %tmp = %{$tmps{$name}};
+        my %newpacket = %$packet;
+        $newpacket{time} = $newpacket{time} - $tmp{time};
+        delete ($tmps{$name});
+        my $found;
+        foreach my $p (@ranges)
+        {
+            if ($$p{name} eq $newpacket{name})
+            {
+                $$p{time} += $newpacket{time};
+                $found = 1;
+            }
+        }
+        if (not defined($found))
+        {
+            push(@ranges, \%newpacket);
+        }
+    }
+}
+
+open REGULAR_OUT_FILE, ">", $regular_out_file or die $!;
+
+print REGULAR_OUT_FILE "name,prefix,timestamp[µs],timespan[µs]\n";
+my $lastTime;
+foreach my $point (@packets)
+{
+    if (not defined $lastTime)
+    {
+        $lastTime = $$point{time};
+    }
+    my $toPrint = sprintf("%s-%s,%lu,%lu\n", $$point{name}, $$point{prefix}, $$point{time}, $$point{time} - $lastTime);
+    print REGULAR_OUT_FILE $toPrint;
+    $lastTime = $$point{time};
+}
+close REGULAR_OUT_FILE;
+
+open RANGE_OUT_FILE, ">", $range_out_file or die $!;
+print RANGE_OUT_FILE "range name,timespan[µs]\n";
+foreach my $range (@ranges)
+{
+    my $res = sprintf("%s,%lu\n", $$range{name}, $$range{time});
+    print RANGE_OUT_FILE $res;
+}
+close RANGE_OUT_FILE;
+
diff --git a/src/profiling/script/utils/csv-stats.pl b/src/profiling/script/utils/csv-stats.pl
new file mode 100755 (executable)
index 0000000..69a9165
--- /dev/null
@@ -0,0 +1,420 @@
+#!/usr/bin/perl -w
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+use warnings;
+use diagnostics;
+use strict;
+use Getopt::Std;
+
+my %options = ();
+my $delimiter = ',';
+getopts("crs:d:h", \%options);
+
+if (defined $options{h})
+{
+    print "HELP\n";
+    exit;
+}
+
+if (defined $options{d})
+{
+    $delimiter = $options{d};
+}
+
+my $skip_row = defined $options{r};
+my $skip_col = defined $options{c};
+my @stats_names;
+
+if (defined $options{s})
+{
+    @stats_names = split /,/, $options{s};
+}
+else
+{
+    @stats_names = split /,/, "min,max,avg";#,std";
+}
+
+foreach(@stats_names)
+{
+    if (not ($_ eq "min" or $_ eq "max" or $_ eq "avg" or $_ eq "std"))
+    {
+        print "bad stat name: ", $_, "\n";
+        print "Supported stats: min,max,avg,std\n";
+        exit;
+    }
+}
+
+my @FILES = @ARGV;
+my $first_file;
+
+sub ParseCSV {
+    my($filename, $delimiter) = @_;
+
+
+    open FILE, "<", $filename or die $!;
+    my @file_rows = <FILE>;
+    my @desc_fields;
+
+    if ($skip_col)
+    {
+        my $description_row = shift @file_rows;
+        chomp $description_row; #remove last \n
+        @desc_fields = split $delimiter, $description_row;
+    }
+
+    my @description_col;
+    my $rows = [];
+    foreach (@file_rows)
+    {
+        chomp $_; #remove last \n
+        my @fields = split $delimiter, $_;
+        if ($skip_row)
+        {
+            push @description_col, shift @fields;
+        }
+        push @$rows, \@fields;
+    }
+    my $table = Table->new($rows);
+    my $csv = CSV->new($table);
+    if ($skip_col)
+    {
+        $csv->addColsDescription(\@desc_fields);
+    }
+    if ($skip_row)
+    {
+        $csv->addRowsDescription(\@description_col);
+    }
+    $csv;
+}
+
+my $stats = {};
+foreach my $stat_name (@stats_names)
+{
+    my $stat_creator = createStatForName($stat_name);
+    $stats->{$stat_name} = $stat_creator;
+}
+
+foreach (@FILES)
+{
+#    print "parsing ", $_, "\n";
+    my $csv = ParseCSV($_, $delimiter);
+    while (my ($key, $value) = each (%$stats))
+    {
+#        print "adding ", $key, " stats\n";
+        $value->addResults($csv);
+    }
+}
+
+while (my ($key, $value) = each (%$stats))
+{
+#    print "printing ", $key, " stats\n";
+    $value->finish();
+    $value->writeToFile(*STDOUT);
+}
+
+sub createStatForName {
+    my ($name) = @_;
+    if ($name eq "min") {
+        MinStat->new();
+    } elsif ($name eq "max") {
+        MaxStat->new();
+    } elsif ($name eq "avg") {
+        AvgStat->new();
+    }
+}
+
+
+package MinStat;
+sub new {
+    my $class = shift;
+    my $self = {};
+    return bless $self, $class;
+}
+
+sub addResults {
+    my ($self, $csv) = @_;
+    if (defined $self->{m_base_csv}) {
+        my $rowNr = 0;
+        foreach my $row (@{$csv->getTable()->getData()})
+        {
+            my $colNr = 0;
+            foreach (@$row)
+            {
+                my $oldvalue = $self->{m_table}->getData()->[$rowNr][$colNr];
+                my $newvalue = $_;
+                if ($newvalue < $oldvalue) {
+                    $self->{m_table}->getData()->[$rowNr][$colNr] = $newvalue;
+                }
+                $colNr ++;
+            }
+            $rowNr ++;
+        }
+    } else {
+        my $newcsv = CSV->new(Table->new([]));
+        $newcsv->addColsDescription($csv->getColsDescription());
+        $newcsv->addRowsDescription($csv->getRowsDescription());
+        $self->{m_base_csv} = $newcsv;
+        my $table = [];
+        foreach(@{$csv->getTable()->getData()})
+        {
+            my $new_row = [];
+            @$new_row = @$_; #array copy
+            push @$table, $new_row;
+        }
+        $self->{m_table} = Table->new($table);
+    }
+}
+
+sub writeToFile {
+    my ($self, $file) = @_;
+    $self->{m_base_csv}->setTable($self->{m_table});
+    $self->{m_base_csv}->writeToFile($file);
+}
+
+sub finish {
+    my ($self) = @_;
+    $self->{m_base_csv}->setTable($self->{m_table});
+}
+
+package MaxStat;
+sub new {
+    my $class = shift;
+    my $self = {};
+    return bless $self, $class;
+}
+
+sub addResults {
+    my ($self, $csv) = @_;
+    if (defined $self->{m_base_csv}) {
+        my $rowNr = 0;
+        foreach my $row (@{$csv->getTable()->getData()})
+        {
+            my $colNr = 0;
+            foreach (@$row)
+            {
+                my $oldvalue = $self->{m_table}->getData()->[$rowNr][$colNr];
+                my $newvalue = $_;
+                if ($newvalue > $oldvalue) {
+                    $self->{m_table}->getData()->[$rowNr][$colNr] = $newvalue;
+                }
+                $colNr ++;
+            }
+            $rowNr ++;
+        }
+    } else {
+        my $newcsv = CSV->new(Table->new([]));
+        $newcsv->addColsDescription($csv->getColsDescription());
+        $newcsv->addRowsDescription($csv->getRowsDescription());
+        $self->{m_base_csv} = $newcsv;
+        my $table = [];
+        foreach(@{$csv->getTable()->getData()})
+        {
+            my $new_row = [];
+            @$new_row = @$_; #array copy
+            push @$table, $new_row;
+        }
+        $self->{m_table} = Table->new($table);
+    }
+}
+
+sub finish {
+    my ($self) = @_;
+    $self->{m_base_csv}->setTable($self->{m_table});
+}
+
+sub writeToFile {
+    my ($self, $file) = @_;
+    $self->{m_base_csv}->writeToFile($file);
+}
+
+package AvgStat;
+sub new {
+    my $class = shift;
+    my $self = {};
+    return bless $self, $class;
+}
+
+use Scalar::Util 'looks_like_number';
+sub addResults {
+    my ($self, $csv) = @_;
+    if (defined $self->{m_base_csv}) {
+        my $rowNr = 0;
+        foreach my $row (@{$csv->getTable()->getData()})
+        {
+            my $colNr = 0;
+            foreach my $coldata (@$row)
+            {
+#                if (not $coldata gt 0) {
+#                    die ("LINE: " . $rowNr . "  COL: " . $colNr . "   DATA: " . $coldata);
+#                }
+                $self->{m_table_with_mean}->getData()->[$rowNr][$colNr] += $coldata;
+                $self->{m_table_with_count}->getData()->[$rowNr][$colNr] ++;
+                $colNr ++;
+            }
+            $rowNr ++;
+        }
+    } else {
+        my $newcsv = CSV->new(Table->new([]));
+        $newcsv->addColsDescription($csv->getColsDescription());
+        $newcsv->addRowsDescription($csv->getRowsDescription());
+        $self->{m_base_csv} = $newcsv;
+        my $table = [];
+        my $table_2 = [];
+        foreach(@{$csv->getTable()->getData()})
+        {
+            my $new_row = [];
+            @$new_row = @$_; #array copy
+            push @$table, $new_row;
+            my $new_row_2 = [];
+            my $len = @$_;
+            @$new_row_2 = ((1) x $len);
+            push @$table_2, $new_row_2;
+        }
+        $self->{m_table_with_mean} = Table->new($table);
+        $self->{m_table_with_count} = Table->new($table_2);
+        foreach my $row (@{$self->{m_table_with_count}->getData()})
+        {
+            foreach my $field (@$row)
+            {
+                $field = 1;
+            }
+        }
+    }
+}
+
+sub finish {
+    my ($self) = @_;
+    my $rowNr = 0;
+    foreach my $row (@{$self->{m_table_with_count}->getData()})
+    {
+        my $colNr = 0;
+        foreach (@$row)
+        {
+            my $tmp = $self->{m_table_with_mean}->getData()->[$rowNr][$colNr];
+#            print "DIV: ", $tmp, " : ", $_, "\n";
+            $tmp = $tmp / $_;
+            $tmp = sprintf ("%.0f", $tmp);
+            $self->{m_table_with_mean}->getData()->[$rowNr][$colNr] = $tmp;
+            $colNr ++;
+        }
+        $rowNr ++;
+    }
+    $self->{m_base_csv}->setTable($self->{m_table_with_mean});
+}
+
+sub writeToFile {
+    my ($self, $file) = @_;
+    $self->{m_base_csv}->writeToFile($file);
+}
+
+
+package Table;
+sub new {
+    my $class = shift;
+    my $self = {
+        m_data => shift,
+    };
+    return bless $self, $class;
+}
+
+sub setField {
+    my ($self, $row, $col, $value) = @_;
+    $self->{m_data}[$row][$col] = $value;
+}
+
+sub getField {
+    my ($self, $row, $col) = @_;
+    $self->{m_data}[$row][$col];
+}
+
+sub addField {
+    my ($self, $row, $col, $value) = @_;
+    $self->{m_data}[$row][$col] += $value;
+}
+
+sub incField {
+    my ($self, $row, $col) = @_;
+    $self->{m_data}[$row][$col] ++;
+}
+
+sub getData {
+    my ($self) = @_;
+    $self->{m_data};
+}
+
+package CSV;
+sub new {
+    my $class = shift;
+    my $self = { m_data => shift, };
+    return bless $self, $class;
+}
+
+sub addColsDescription {
+    my ($self, $desc) = @_;
+    $self->{m_cols_desc} = $desc;
+}
+
+sub addRowsDescription {
+    my ($self, $desc) = @_;
+    $self->{m_rows_desc} = $desc;
+}
+
+sub getColsDescription {
+    my ($self) = @_;
+    $self->{m_cols_desc};
+}
+
+sub getRowsDescription {
+    my ($self) = @_;
+    $self->{m_rows_desc};
+}
+
+sub getNrRows {
+    my ($self) = @_;
+    my $ret = @{$self->{m_data}->getData()};
+}
+
+sub getNrCols {
+    my ($self) = @_;
+    my $ret = @{@{$self->{m_data}->getData()}[0]};
+}
+
+sub getTable {
+    my ($self) = @_;
+    $self->{m_data};
+}
+
+sub setTable {
+    my ($self, $table) = @_;
+    $self->{m_data} = $table;
+}
+
+sub writeToFile {
+    my ($self, $file) = @_;
+    if (defined $self->{m_cols_desc}) {
+        print $file join(',', @{$self->{m_cols_desc}}), "\n";
+    }
+    my $rowNr = 0;
+    foreach(@{$self->{m_data}->getData()})
+    {
+        my @row = @$_;
+        if (defined $self->{m_rows_desc}) {
+            print $file $self->{m_rows_desc}->[$rowNr], ',';
+        }
+        print $file join(',', @row), "\n";
+        $rowNr ++;
+    }
+}
diff --git a/src/profiling/script/utils/generate-plot.sh b/src/profiling/script/utils/generate-plot.sh
new file mode 100755 (executable)
index 0000000..7e3b66f
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+WARM_FILE=$1
+COLD_FILE=$2
+PRELOAD_FILE=$3
+OUTPUT_FILE=$4
+PLOT_TITLE=$5
+FONT_SIZE=$6
+WIDTH=$7
+HEIGHT=$8
+MAXTICS=$9
+DIFFFILE=${10}
+
+gnuplot \
+    -e "warm_file='$WARM_FILE'" \
+    -e "cold_file='$COLD_FILE'" \
+    -e "preload_file=\"$PRELOAD_FILE\"" \
+    -e "output_file='$OUTPUT_FILE'" \
+    -e "plot_title='$PLOT_TITLE'" \
+    -e "font_size='$FONT_SIZE'" \
+    -e "width='$WIDTH'" \
+    -e "height='$HEIGHT'" \
+    -e "maxtics='$MAXTICS'" \
+    -e "difffile='$DIFFFILE'" \
+    ./utils/plot-generator.gplot
diff --git a/src/profiling/script/utils/plot-generator.gplot b/src/profiling/script/utils/plot-generator.gplot
new file mode 100644 (file)
index 0000000..21b613b
--- /dev/null
@@ -0,0 +1,33 @@
+#cold_file="OUTPUT/1002_WAC_Test/cold/outpucik-points"
+#warm_file="OUTPUT/1002_WAC_Test/warm/outpucik-points"
+#preload_file="OUTPUT/1002_WAC_Test/preload/outpucik-points"
+#output_file="Some.svg"
+#plot_title="some title"
+#width
+#height
+#font_size
+#tics
+#difffile
+set terminal svg size width height dynamic fsize font_size
+set object 1 rect from screen 0, 0, 0 to screen 1, 1, 0 behind
+set object 1 rect fc  rgb "white"  fillstyle solid 1.0
+set output output_file
+set size 1.0,1.0
+set title plot_title
+set style fill solid
+set grid
+set datafile separator ","
+set style line 1
+set key top left
+set ytics 0,100000,maxtics
+set y2tics 0,100000,maxtics
+set ylabel "time [us]"
+set y2label "time [us]"
+set format y "%2.1e"
+set format y2 "%2.1e"
+set xlabel "Execution points of WRT during launching"
+set xtics border in nomirror rotate by -45  offset character 0, 0, 0
+plot warm_file  u 2:xtic(1) with lines title "        Warm", \
+     cold_file  u 2 with lines title         "        Cold", \
+     preload_file  u 2 with lines title      "        Preload", \
+     difffile   u ($3-$6) with fsteps title   "        Diff"
diff --git a/src/profiling/script/utils/wrt-preloader b/src/profiling/script/utils/wrt-preloader
new file mode 100755 (executable)
index 0000000..5d2e8fc
Binary files /dev/null and b/src/profiling/script/utils/wrt-preloader differ
diff --git a/src/view/CMakeLists.txt b/src/view/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ec71158
--- /dev/null
@@ -0,0 +1,26 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+# @file     src/view/CMakeLists.txt
+# @author   Pawel Sikorski (p.sikorski@samsung.com)
+
+SET(VIEW_MODULE_SOURCES
+    ${PROJECT_SOURCE_DIR}/src/view/view_module.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/context_manager.cpp
+)
+
+ADD_SUBDIRECTORY(common)  #ViewModule common library
+ADD_SUBDIRECTORY(webkit) #ViewModule based on Webkit2
+
diff --git a/src/view/common/CMakeLists.txt b/src/view/common/CMakeLists.txt
new file mode 100644 (file)
index 0000000..14f5a35
--- /dev/null
@@ -0,0 +1,102 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+# @file     src/view/common/CMakeLists.txt
+# @author   Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+
+GROUP_DEPS(SYS_VIEW_COMMON_DEP DEPS
+    wrt-commons-custom-handler-dao-ro
+    appsvc
+    aul
+    cert-svc-vcore
+    capi-appfw-app-manager
+    efl-assist
+    eina
+    elementary
+    evas
+    deviced
+    libcurl
+    libiri
+    libpcrecpp
+    libsoup
+    notification
+    ui-gadget-1
+    security-client
+    security-core
+    secure-storage
+    )
+
+GROUP_DEPS(VIEW_COMMON_DEP DEPS
+    dpl-efl
+    dpl-event-efl
+    dpl-wrt-dao-ro
+    wrt-commons-security-origin-dao
+    wrt-commons-certificate-dao
+    wrt-popup-wrt-runner
+    )
+
+SET(VIEW_COMMON_SOURCES
+    ${PROJECT_SOURCE_DIR}/src/view/common/application_launcher.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/evas_object.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/scheme.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/scheme_action_map.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_apps_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_custom_header_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_help_popup_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_privilege_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_origin_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_origin_support_util.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_security_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_storage_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_uri_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_vibration_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/view_logic_certificate_support.cpp
+)
+
+SET(VIEW_COMMON_INCLUDES
+    ${PROJECT_SOURCE_DIR}/src/domain
+    ${PROJECT_SOURCE_DIR}/src/profiling
+    ${PROJECT_SOURCE_DIR}/src/view/common
+    ${VIEW_COMMON_DEP_INCLUDE_DIRS}
+    )
+
+INCLUDE_DIRECTORIES(${VIEW_COMMON_INCLUDES})
+INCLUDE_DIRECTORIES(SYSTEM
+    ${SYS_VIEW_COMMON_DEP_INCLUDE_DIRS}
+)
+
+ADD_LIBRARY(${TARGET_VIEW_COMMON_LIB_STATIC} STATIC
+    ${VIEW_COMMON_SOURCES}
+)
+
+TARGET_LINK_LIBRARIES(${TARGET_VIEW_COMMON_LIB_STATIC}
+    ${SYS_VIEW_COMMON_DEP_LIBRARIES}
+    ${VIEW_COMMON_DEP_LIBRARIES}
+    ${PROF_LIB}
+)
+
+SET_TARGET_PROPERTIES(${TARGET_VIEW_COMMON_LIB_STATIC} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_VIEW_COMMON_LIB_STATIC} PROPERTIES
+    SOVERSION ${PROJECT_API_VERSION}
+    VERSION ${PROJECT_VERSION}
+    )
+SET_TARGET_PROPERTIES(${TARGET_VIEW_COMMON_LIB_STATIC} PROPERTIES
+    COMPILE_FLAGS -fPIC)
+SET_TARGET_PROPERTIES(${TARGET_VIEW_COMMON_LIB_STATIC} PROPERTIES
+    COMPILE_FLAGS "-include profiling_util.h"
+    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
+    OUTPUT_NAME ${TARGET_VIEW_COMMON_LIB_STATIC})
diff --git a/src/view/common/application_launcher.cpp b/src/view/common/application_launcher.cpp
new file mode 100644 (file)
index 0000000..a8fd63c
--- /dev/null
@@ -0,0 +1,267 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    application_launcher.cpp
+ * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @version 1.0
+ * @brief   Implementation file for application launcher
+ */
+
+#include "application_launcher.h"
+
+#include <dpl/log/wrt_log.h>
+#include <dpl/singleton_impl.h>
+
+#include <app.h>
+#include <app_manager.h>
+#include <appsvc.h>
+#include <notification.h>
+#include <widget_string.h>
+
+IMPLEMENT_SINGLETON(ApplicationLauncher)
+
+namespace {
+const char * const APP_CONTROL_EXTRA_DATA_KEY_PATH = "path";
+const char * const APP_CONTROL_EXTRA_DATA_KEY_COOKIE = "cookie";
+const char * const APP_CONTROL_EXTRA_DATA_KEY_MODE = "mode";
+const char * const APP_CONTROL_EXTRA_DATA_VALUE_SLIENT = "silent";
+
+const char * const SCHEME_TYPE_RTSP = "rtsp";
+const char * const SCHEME_TYPE_HTML5_VIDEO = "html5video";
+}
+
+ApplicationLauncher::ApplicationLauncher() :
+    m_windowHandle(0)
+{
+}
+
+ApplicationLauncher::~ApplicationLauncher()
+{}
+
+void ApplicationLauncher::OnEventReceived(
+    const ApplicationLauncherEvents::LaunchApplicationByAppService &event)
+{
+    int result;
+    app_control_h app_control = event.GetArg0();
+    app_control_reply_cb responseCallback = event.GetArg1();
+    void *userData = event.GetArg2();
+
+    if (m_windowHandle) {
+        app_control_set_window(app_control, m_windowHandle);
+    }
+
+    result = app_control_send_launch_request(app_control, responseCallback, userData);
+    if (result != APP_CONTROL_ERROR_NONE) {
+        app_control_destroy(app_control);
+        WrtLogE("Failed to run app_control : %d", result);
+        return;
+    }
+    app_control_destroy(app_control);
+    WrtLogD("Success to run app_control");
+}
+
+void ApplicationLauncher::OnEventReceived(
+    const ApplicationLauncherEvents::LaunchApplicationByPkgname &event)
+{
+    using namespace ApplicationLauncherPkgname;
+    std::string pkgName(event.GetArg0());
+
+    if (PKG_NAME_DOWNLOAD_PROVIDER == pkgName) {
+        std::string url(event.GetArg1());
+        // This value needs for checking video, music contents later.
+        //std::string mime_type(event.GetArg2());
+        std::string cookie(event.GetArg3());
+
+        if ("null" == url) {
+            WrtLogE("url is empty");
+            return;
+        }
+
+        app_control_h app_control = NULL;
+        int ret = APP_CONTROL_ERROR_NONE;
+
+        // create app_control
+        ret = app_control_create(&app_control);
+        if (APP_CONTROL_ERROR_NONE != ret && NULL == app_control) {
+            WrtLogE("Fail to create app_control");
+            return;
+        }
+
+        // set app_control operation
+        ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DOWNLOAD);
+        if (APP_CONTROL_ERROR_NONE != ret) {
+            WrtLogE("Fail to set operation [%d]", ret);
+            app_control_destroy(app_control);
+            return;
+        }
+
+        // set app_control uri
+        ret = app_control_set_uri(app_control, url.c_str());
+        if (APP_CONTROL_ERROR_NONE != ret) {
+            WrtLogE("Fail to set uri [%d]", ret);
+            app_control_destroy(app_control);
+            return;
+        }
+
+        // set cookie
+        if (cookie != "null") {
+            ret = app_control_add_extra_data(app_control,
+                                         APP_CONTROL_EXTRA_DATA_KEY_COOKIE,
+                                         cookie.c_str());
+            if (APP_CONTROL_ERROR_NONE != ret) {
+                WrtLogD("Fail to add cookie [%d]", ret);
+                app_control_destroy(app_control);
+                return;
+            }
+        }
+
+        ret = app_control_add_extra_data(app_control,
+                                     APP_CONTROL_EXTRA_DATA_KEY_MODE,
+                                     APP_CONTROL_EXTRA_DATA_VALUE_SLIENT);
+        if (APP_CONTROL_ERROR_NONE != ret) {
+            WrtLogE("Fail to set app_control extra data [%d]", ret);
+            app_control_destroy(app_control);
+            return;
+        }
+
+        if (m_windowHandle) {
+            app_control_set_window(app_control, m_windowHandle);
+        }
+
+        //launch app_control
+        ret = app_control_send_launch_request(app_control, NULL, NULL);
+        if (APP_CONTROL_ERROR_NONE != ret) {
+            WrtLogE("Fail to launch app_control [%d]", ret);
+            app_control_destroy(app_control);
+            return;
+        }
+        app_control_destroy(app_control);
+        notification_status_message_post(WRT_POP_STARTING_DOWNLOADING);
+        return;
+    } else if (PKG_NAME_VIDEO_PLAYER == pkgName) {
+        bool isRunning = false;
+        if (APP_MANAGER_ERROR_NONE !=
+            app_manager_is_running(PKG_NAME_VT_MAIN.c_str(), &isRunning))
+        {
+            WrtLogE("Fail to get app running information");
+            return;
+        }
+        if (true == isRunning) {
+            WrtLogE("video-call is running");
+            return;
+        }
+
+        std::string scheme(event.GetArg1());
+        std::string uri(event.GetArg2());
+        std::string cookie(event.GetArg3());
+        const char* url;
+
+        if ("null" == scheme) {
+            WrtLogE("scheme is empty");
+            return;
+        }
+        if ("null" == uri) {
+            WrtLogE("uri is empty");
+            return;
+        }
+
+        if (SCHEME_TYPE_RTSP == scheme ||
+            SCHEME_TYPE_HTML5_VIDEO == scheme)
+        {
+            url = uri.c_str();
+        } else {
+            WrtLogE("scheme is invalid!!");
+            return;
+        }
+
+        app_control_h app_control = NULL;
+        int ret = APP_CONTROL_ERROR_NONE;
+
+        // create app_control
+        ret = app_control_create(&app_control);
+        if (APP_CONTROL_ERROR_NONE != ret && NULL == app_control) {
+            WrtLogE("Fail to create app_control");
+            return;
+        }
+
+        // set url
+        if (!url || strlen(url) == 0) {
+            WrtLogE("Fail to get url");
+            app_control_destroy(app_control);
+            return;
+        }
+        ret = app_control_add_extra_data(app_control,
+                                     APP_CONTROL_EXTRA_DATA_KEY_PATH,
+                                     url);
+        if (APP_CONTROL_ERROR_NONE != ret) {
+            WrtLogE("Fail to set url [%d]", ret);
+            app_control_destroy(app_control);
+            return;
+        }
+
+        // set cookie
+        if (SCHEME_TYPE_HTML5_VIDEO == scheme) {
+            if ("null" != cookie) {
+                ret = app_control_add_extra_data(app_control,
+                                             APP_CONTROL_EXTRA_DATA_KEY_COOKIE,
+                                             cookie.c_str());
+                if (APP_CONTROL_ERROR_NONE != ret) {
+                    WrtLogE("Fail to add cookie [%d]", ret);
+                    app_control_destroy(app_control);
+                    return;
+                }
+            }
+        }
+
+        // set package
+        ret = app_control_set_app_id(app_control, PKG_NAME_VIDEO_PLAYER.c_str());
+        if (APP_CONTROL_ERROR_NONE != ret) {
+            WrtLogE("Fail to set package app_control [%d]", ret);
+            app_control_destroy(app_control);
+            return;
+        }
+
+        // set window handle when available
+        if (m_windowHandle) {
+            app_control_set_window(app_control, m_windowHandle);
+        }
+
+        //launch app_control
+        ret = app_control_send_launch_request(app_control, NULL, NULL);
+        if (APP_CONTROL_ERROR_NONE != ret) {
+            WrtLogE("Fail to launch app_control [%d]", ret);
+            app_control_destroy(app_control);
+            return;
+        }
+        app_control_destroy(app_control);
+        return;
+    } else {
+        WrtLogE("Not implemented application : %s", pkgName.c_str());
+    }
+
+    WrtLogD("Success to launch application : %s", pkgName.c_str());
+    return;
+}
+
+void ApplicationLauncher::setWidgetTizenId(const std::string& tizenId)
+{
+    m_tizenId = tizenId;
+}
+
+void ApplicationLauncher::setWindowHandle(unsigned windowHandle)
+{
+    m_windowHandle = windowHandle;
+}
diff --git a/src/view/common/application_launcher.h b/src/view/common/application_launcher.h
new file mode 100644 (file)
index 0000000..440892e
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    application_launcher.h
+ * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @version 1.0
+ * @brief   Header file for application launcher
+ */
+
+#ifndef APPLICATION_LAUNCHER_H
+#define APPLICATION_LAUNCHER_H
+
+#include <string>
+#include <dpl/event/controller.h>
+#include <dpl/generic_event.h>
+#include <dpl/singleton.h>
+
+#include <appfw/app_control.h>
+
+namespace ApplicationLauncherEvents {
+DECLARE_GENERIC_EVENT_3(LaunchApplicationByAppService,
+                        app_control_h,
+                        app_control_reply_cb,
+                        void*)
+DECLARE_GENERIC_EVENT_4(LaunchApplicationByPkgname,
+                        std::string,
+                        std::string,
+                        std::string,
+                        std::string)
+} //namespace ApplicationLauncherEvents
+
+namespace ApplicationLauncherPkgname {
+const std::string PKG_NAME_PREFIX = "com.samsung.";
+const std::string PKG_NAME_DOWNLOAD_PROVIDER = PKG_NAME_PREFIX +
+    "download-provider";
+const std::string PKG_NAME_VIDEO_PLAYER = PKG_NAME_PREFIX + "video-player";
+const std::string PKG_NAME_VT_MAIN = PKG_NAME_PREFIX + "vtmain";
+} // namespace ApplicationLauncherPkgname
+
+class ApplicationLauncher :
+    public DPL::Event::Controller<DPL::TypeListDecl<
+                                      ApplicationLauncherEvents::
+                                          LaunchApplicationByPkgname,
+                                      ApplicationLauncherEvents::
+                                          LaunchApplicationByAppService
+                                      >::Type>
+{
+  public:
+    ApplicationLauncher();
+    virtual ~ApplicationLauncher();
+    void setWidgetTizenId(const std::string& tizenId);
+    void setWindowHandle(unsigned windowHandle);
+
+  protected:
+    virtual void OnEventReceived(
+        const ApplicationLauncherEvents::
+            LaunchApplicationByPkgname &event);
+    virtual void OnEventReceived(
+        const ApplicationLauncherEvents::
+            LaunchApplicationByAppService &event);
+
+  private:
+    std::string m_tizenId;
+    unsigned m_windowHandle;
+};
+
+typedef DPL::Singleton<ApplicationLauncher> ApplicationLauncherSingleton;
+
+#endif //APPLICATION_LAUNCHER_H
diff --git a/src/view/common/evas_object.cpp b/src/view/common/evas_object.cpp
new file mode 100644 (file)
index 0000000..edc33d4
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file        evas_object.cpp
+ * @author      Lukasz Wrzosek (l.wrzosel@samsung.com)
+ * @version     1.0
+ * @brief       This file is the implementation for Evas_Object wrapper from
+ * Efl.
+ */
+
+#include "evas_object.h"
+#include <dpl/foreach.h>
+
+Evas_Object* EvasObject::IConnection::GetEvasObject()
+{
+    return m_object->GetObject();
+}
+
+void EvasObject::IConnection::Disconnect()
+{
+    m_object->DisconnectCallback(this);
+}
+
+EvasObject::IConnection::IConnection(EvasObject::EvasObjectShared* object) :
+    m_object(object)
+{}
+
+void EvasObject::IConnection::SmartCallbackWrapper(void* data,
+                                                   Evas_Object* /*object*/,
+                                                   void* event_info)
+{
+    Assert(data);
+    IConnection* Calle = static_cast<IConnection*>(data);
+    Calle->Call(event_info);
+}
+
+void EvasObject::IConnection::EvasCallbackWrapper(void* data,
+                                                  Evas* /*evas*/,
+                                                  Evas_Object* /*object*/,
+                                                  void* event_info)
+{
+    Assert(data);
+    IConnection* Calle = static_cast<IConnection*>(data);
+    Calle->Call(event_info);
+}
+
+Evas_Object* EvasObject::EvasObjectShared::GetObject()
+{
+    return m_object;
+}
+
+EvasObject::EvasObjectShared::SmartConnectionBase::SmartConnectionBase(
+    const std::string& name,
+    EvasObject::EvasObjectShared* object) :
+    IConnection(object),
+    m_callbackName(name)
+{}
+
+void EvasObject::EvasObjectShared::SmartConnectionBase::ConnectPrv()
+{
+    evas_object_smart_callback_add(GetEvasObject(),
+                                   m_callbackName.c_str(),
+                                   &IConnection::SmartCallbackWrapper, this);
+}
+
+void EvasObject::EvasObjectShared::SmartConnectionBase::DisconnectPrv()
+{
+    evas_object_smart_callback_del(GetEvasObject(),
+                                   m_callbackName.c_str(),
+                                   &IConnection::SmartCallbackWrapper);
+}
+
+EvasObject::EvasObjectShared::EvasConnectionBase::EvasConnectionBase(
+    Evas_Callback_Type type,
+    EvasObject::EvasObjectShared* object) :
+    IConnection(object),
+    m_callbackType(type)
+{}
+
+void EvasObject::EvasObjectShared::EvasConnectionBase::ConnectPrv()
+{
+    evas_object_event_callback_add(
+        GetEvasObject(), m_callbackType, &IConnection::EvasCallbackWrapper,
+        this);
+}
+
+void EvasObject::EvasObjectShared::EvasConnectionBase::DisconnectPrv()
+{
+    evas_object_event_callback_del_full(
+        GetEvasObject(), m_callbackType, &IConnection::EvasCallbackWrapper,
+        this);
+}
+
+EvasObject::EvasObjectShared::EvasObjectShared() :
+    m_object(NULL)
+{}
+
+EvasObject::EvasObjectShared::EvasObjectShared(Evas_Object* object) :
+    m_object(object)
+{
+    Assert(m_object);
+    evas_object_event_callback_add(m_object,
+                                   EVAS_CALLBACK_DEL,
+                                   &StaticOnDelEvent,
+                                   this);
+}
+
+void EvasObject::EvasObjectShared::SetObject(Evas_Object* object)
+{
+    Assert(m_object == NULL);
+    Assert(object != NULL);
+    m_object = object;
+    evas_object_event_callback_add(m_object,
+                                   EVAS_CALLBACK_DEL,
+                                   &StaticOnDelEvent,
+                                   this);
+}
+
+EvasObject::EvasObjectShared::~EvasObjectShared()
+{
+    if (m_object) {
+        DisconnectAll();
+        evas_object_event_callback_del(m_object,
+                                       EVAS_CALLBACK_DEL,
+                                       &StaticOnDelEvent);
+        m_object = NULL;
+    }
+}
+
+bool EvasObject::EvasObjectShared::DisconnectCallback(IConnection* connection)
+{
+    IConnectionsSet::iterator it = m_connections.find(connection);
+    if (it != m_connections.end()) {
+        (*it)->DisconnectPrv();
+        delete connection;
+        m_connections.erase(it);
+        return true;
+    }
+    return false;
+}
+
+void EvasObject::EvasObjectShared::DisconnectAll()
+{
+    FOREACH(it, m_connections)
+    {
+        (*it)->DisconnectPrv();
+        delete *it;
+    }
+    m_connections.clear();
+}
+
+void EvasObject::EvasObjectShared::StaticOnDelEvent(void* data,
+                                                    Evas* /*e*/,
+                                                    Evas_Object* /*o*/,
+                                                    void* /*ev*/)
+{
+    Assert(data);
+    EvasObjectShared* This = static_cast<EvasObjectShared*>(data);
+    if (This->m_object) {
+        evas_object_event_callback_del(This->m_object,
+                                       EVAS_CALLBACK_DEL,
+                                       &StaticOnDelEvent);
+        This->DisconnectAll();
+        This->m_object = NULL;
+    }
+}
+
+EvasObject::EvasObject() :
+    m_object(new EvasObjectShared())
+{}
+
+EvasObject::EvasObject(Evas_Object* object) :
+    m_object(new EvasObjectShared(object))
+{}
+
+EvasObject::EvasObject(const EvasObject& other) :
+    m_object(other.m_object)
+{}
+
+//this destructor must be here to let pimpl with shared_ptr work without warning
+EvasObject::~EvasObject()
+{}
+
+EvasObject& EvasObject::operator=(const EvasObject& other)
+{
+    Assert(m_object);
+    m_object = other.m_object;
+    return *this;
+}
+
+EvasObject* EvasObject::operator=(Evas_Object* object)
+{
+    Assert(m_object);
+    m_object->SetObject(object);
+    return this;
+}
+
+bool EvasObject::DisconnectCallback(IConnection* connection)
+{
+    Assert(m_object);
+    return m_object->DisconnectCallback(connection);
+}
+
+void EvasObject::DisconnectAll()
+{
+    Assert(m_object);
+    m_object->DisconnectAll();
+}
+
+EvasObject::operator Evas_Object *()
+{
+    Assert(m_object);
+    return m_object->GetObject();
+}
diff --git a/src/view/common/evas_object.h b/src/view/common/evas_object.h
new file mode 100644 (file)
index 0000000..5073919
--- /dev/null
@@ -0,0 +1,647 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file        evas_object.h
+ * @author      Lukasz Wrzosek (l.wrzosel@samsung.com)
+ * @version     1.0
+ * @brief       This file is the header for Evas_Object wrapper from Efl.
+ */
+#ifndef WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
+#define WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
+
+#include <set>
+#include <string>
+#include <tuple>
+#include <utility>
+#include <memory>
+
+#include <dpl/framework_efl.h>
+#include <dpl/assert.h>
+#include <dpl/foreach.h>
+#include <dpl/apply.h>
+#include <dpl/noncopyable.h>
+
+class EvasObject
+{
+    class EvasObjectShared;
+    typedef std::shared_ptr<EvasObjectShared> EvasObjectSharedPtr;
+
+  public:
+    class IConnection
+    {
+      public:
+        Evas_Object* GetEvasObject();
+        void Disconnect();
+
+      private:
+        IConnection(EvasObjectShared* object);
+        virtual ~IConnection()
+        {}
+        virtual void Call(void* /*event_info*/) = 0;
+
+        static void SmartCallbackWrapper(void* data,
+                                         Evas_Object* /*object*/,
+                                         void* event_info);
+        static void EvasCallbackWrapper(void* data,
+                                        Evas* /*evas*/,
+                                        Evas_Object* /*object*/,
+                                        void* event_info);
+
+        virtual void ConnectPrv() = 0;
+        virtual void DisconnectPrv() = 0;
+
+        friend class EvasObjectShared;
+
+        EvasObjectShared* m_object;
+    };
+
+  private:
+    class EvasObjectShared : DPL::Noncopyable
+    {
+      public:
+        friend class IConnection;
+        Evas_Object* GetObject();
+
+        typedef std::set<IConnection*> IConnectionsSet;
+
+        class SmartConnectionBase : public IConnection
+        {
+          public:
+            SmartConnectionBase(const std::string& name,
+                                EvasObjectShared* object);
+
+            virtual void ConnectPrv();
+            virtual void DisconnectPrv();
+            std::string m_callbackName;
+        };
+
+        template<typename ... Args>
+        class SmartConnection : public SmartConnectionBase
+        {
+          public:
+            typedef void (*CbType)(IConnection* connection,
+                                   void* event_info,
+                                   Args ... args);
+
+            SmartConnection(const std::string& name,
+                            CbType callback,
+                            EvasObjectShared* object,
+                            Args ... args) :
+                SmartConnectionBase(name, object),
+                m_callback(callback),
+                m_args(args ...)
+            {}
+
+            virtual ~SmartConnection()
+            {}
+
+            virtual void Call(void* event_info)
+            {
+                DPL::Apply<void,
+                           DPL::ExtraArgsInsertPolicy::Prepend>(m_callback,
+                                                                m_args,
+                                                                this,
+                                                                event_info);
+            }
+
+          private:
+            CbType m_callback;
+            std::tuple<Args ...> m_args;
+        };
+
+        template <class ThisType, class ArgType1>
+        class SmartMemberConnection1 : public SmartConnectionBase
+        {
+          public:
+            typedef void (ThisType::*CbType)(IConnection* connection,
+                                             void* event_info, ArgType1 *arg1);
+
+            SmartMemberConnection1(const std::string& name,
+                                   CbType callback,
+                                   ThisType* callee,
+                                   ArgType1* arg1,
+                                   EvasObjectShared* object) :
+                SmartConnectionBase(name, object),
+                m_callback(callback),
+                m_callee(callee),
+                m_arg1(arg1)
+            {}
+
+            virtual ~SmartMemberConnection1()
+            {}
+
+            virtual void Call(void* event_info)
+            {
+                (m_callee->*m_callback)(this, event_info, m_arg1);
+            }
+
+          private:
+            CbType m_callback;
+            ThisType* m_callee;
+            ArgType1* m_arg1;
+        };
+
+        template <class ThisType, class ArgType1, class ArgType2>
+        class SmartMemberConnection2 : public SmartConnectionBase
+        {
+          public:
+            typedef void (ThisType::*CbType)(IConnection* connection,
+                                             void* event_info, ArgType1 *arg1,
+                                             ArgType2* arg2);
+
+            SmartMemberConnection2(const std::string& name,
+                                   CbType callback,
+                                   ThisType* callee,
+                                   ArgType1* arg1,
+                                   ArgType2* arg2,
+                                   EvasObjectShared* object) :
+                SmartConnectionBase(name, object),
+                m_callback(callback),
+                m_callee(callee),
+                m_arg1(arg1),
+                m_arg2(arg2)
+            {}
+
+            virtual ~SmartMemberConnection2()
+            {}
+
+            virtual void Call(void* event_info)
+            {
+                (m_callee->*m_callback)(this, event_info, m_arg1, m_arg2);
+            }
+
+          private:
+            CbType m_callback;
+            ThisType* m_callee;
+            ArgType1* m_arg1;
+            ArgType2* m_arg2;
+        };
+
+        class EvasConnectionBase : public IConnection
+        {
+          public:
+            EvasConnectionBase(Evas_Callback_Type type,
+                               EvasObjectShared* object);
+
+            virtual void ConnectPrv();
+            virtual void DisconnectPrv();
+
+            Evas_Callback_Type m_callbackType;
+        };
+
+        template <class ArgType1>
+        class EvasConnection1 : public EvasConnectionBase
+        {
+          public:
+            typedef void (*CbType)(IConnection* connection, void* event_info,
+                                   ArgType1 *arg1);
+
+            EvasConnection1(Evas_Callback_Type type,
+                            CbType callback,
+                            ArgType1* arg1,
+                            EvasObjectShared* object) :
+                EvasConnectionBase(type, object),
+                m_callback(callback),
+                m_arg1(arg1)
+            {}
+
+            virtual ~EvasConnection1()
+            {}
+
+            virtual void Call(void* event_info)
+            {
+                m_callback(this, event_info, m_arg1);
+            }
+
+          private:
+            CbType m_callback;
+            ArgType1* m_arg1;
+        };
+
+        template <class ArgType1, class ArgType2>
+        class EvasConnection2 : public EvasConnectionBase
+        {
+          public:
+            typedef void (*CbType)(IConnection* connection, void* event_info,
+                                   ArgType1 *arg1, ArgType2 *arg2);
+
+            EvasConnection2(Evas_Callback_Type type,
+                            CbType callback,
+                            ArgType1* arg1,
+                            ArgType2* arg2,
+                            EvasObjectShared* object) :
+                EvasConnectionBase(type, object),
+                m_callback(callback),
+                m_arg1(arg1),
+                m_arg2(arg2)
+            {}
+
+            virtual ~EvasConnection2()
+            {}
+
+            virtual void Call(void* event_info)
+            {
+                m_callback(this, event_info, m_arg1, m_arg2);
+            }
+
+          private:
+            CbType m_callback;
+            ArgType1* m_arg1;
+            ArgType2* m_arg2;
+        };
+
+        template <class ThisType, class ArgType1>
+        class EvasMemberConnection1 : public EvasConnectionBase
+        {
+          public:
+            typedef void (ThisType::*CbType)(IConnection* connection,
+                                             void* event_info, ArgType1 *arg1);
+
+            EvasMemberConnection1(Evas_Callback_Type type,
+                                  CbType callback,
+                                  ThisType* callee,
+                                  ArgType1* arg1,
+                                  EvasObjectShared* object) :
+                EvasConnectionBase(type, object),
+                m_callback(callback),
+                m_callee(callee),
+                m_arg1(arg1)
+            {}
+
+            virtual ~EvasMemberConnection1()
+            {}
+
+            virtual void Call(void* event_info)
+            {
+                (m_callee->*m_callback)(this, event_info, m_arg1);
+            }
+
+          private:
+            CbType m_callback;
+            ThisType* m_callee;
+            ArgType1* m_arg1;
+        };
+
+        template <class ThisType, class ArgType1, class ArgType2>
+        class EvasMemberConnection2 : public EvasConnectionBase
+        {
+          public:
+            typedef void (ThisType::*CbType)(IConnection* connection,
+                                             void* event_info, ArgType1* arg1,
+                                             ArgType2* arg2);
+
+            EvasMemberConnection2(Evas_Callback_Type type,
+                                  CbType callback,
+                                  ThisType* callee,
+                                  ArgType1* arg1,
+                                  ArgType2* arg2,
+                                  EvasObjectShared* object) :
+                EvasConnectionBase(type, object),
+                m_callback(callback),
+                m_callee(callee),
+                m_arg1(arg1),
+                m_arg2(arg2)
+            {}
+
+            virtual ~EvasMemberConnection2()
+            {}
+
+            virtual void Call(void* event_info)
+            {
+                (m_callee->*m_callback)(this, event_info, m_arg1, m_arg2);
+            }
+
+          private:
+            CbType m_callback;
+            ThisType* m_callee;
+            ArgType1* m_arg1;
+            ArgType2* m_arg2;
+        };
+
+        EvasObjectShared();
+        explicit EvasObjectShared(Evas_Object* object);
+        void SetObject(Evas_Object* object);
+        ~EvasObjectShared();
+
+        template<typename ... Args>
+        IConnection* ConnectSmartCallback(
+            const char* callbackName,
+            typename SmartConnection<Args ...>::
+                CbType callback,
+            Args ... args)
+        {
+            Assert(m_object);
+            Assert(callbackName);
+            Assert(callback);
+            IConnection* connection = new SmartConnection<Args ...>(
+                    callbackName,
+                    callback,
+                    this,
+                    args ...);
+            m_connections.insert(connection);
+            connection->ConnectPrv();
+            return connection;
+        }
+
+        template <class ThisType, class ArgType1, class ArgType2>
+        IConnection* ConnectMemberSmartCallback(
+            const char* callbackName,
+            typename SmartMemberConnection2<ThisType, ArgType1,
+                                            ArgType2>::CbType callback,
+            ThisType* callee,
+            ArgType1* arg1,
+            ArgType2* arg2)
+        {
+            Assert(m_object);
+            Assert(callee);
+            Assert(callbackName);
+            Assert(callback);
+            IConnection* connection =
+                new SmartMemberConnection2<ThisType, ArgType1, ArgType2>(
+                    callbackName,
+                    callback,
+                    callee,
+                    arg1,
+                    arg2,
+                    this);
+            m_connections.insert(connection);
+            connection->ConnectPrv();
+            return connection;
+        }
+
+        template <class ThisType, class ArgType1>
+        IConnection* ConnectMemberSmartCallback(
+            const char* callbackName,
+            typename SmartMemberConnection1<ThisType,
+                                            ArgType1>::CbType callback,
+            ThisType* callee,
+            ArgType1* arg1)
+        {
+            Assert(m_object);
+            Assert(callee);
+            Assert(callbackName);
+            Assert(callback);
+            IConnection* connection =
+                new SmartMemberConnection1<ThisType, ArgType1>(callbackName,
+                                                               callback,
+                                                               callee,
+                                                               arg1,
+                                                               this);
+            m_connections.insert(connection);
+            connection->ConnectPrv();
+            return connection;
+        }
+
+        template <class ArgType1, class ArgType2>
+        IConnection* ConnectEvasCallback(Evas_Callback_Type callbackType,
+                                         typename EvasConnection2<ArgType1,
+                                                                  ArgType2>::
+                                             CbType callback,
+                                         ArgType1* arg1,
+                                         ArgType2* arg2)
+        {
+            Assert(m_object);
+            Assert(callbackType);
+            Assert(callback);
+            IConnection* connection = new EvasConnection2<ArgType1, ArgType2>(
+                    callbackType,
+                    callback,
+                    arg1,
+                    arg2,
+                    this);
+            m_connections.insert(connection);
+            connection->ConnectPrv();
+            return connection;
+        }
+
+        template <class ArgType1>
+        IConnection* ConnectEvasCallback(
+            Evas_Callback_Type callbackType,
+            typename EvasConnection1<ArgType1>::
+                CbType callback,
+            ArgType1* arg1)
+        {
+            Assert(m_object);
+            Assert(callbackType);
+            Assert(callback);
+            IConnection* connection = new EvasConnection1<ArgType1>(
+                    callbackType,
+                    callback,
+                    arg1,
+                    this);
+            m_connections.insert(connection);
+            connection->ConnectPrv();
+            return connection;
+        }
+
+        template <class ThisType, class ArgType1, class ArgType2>
+        IConnection* ConnectMemberEvasCallback(
+            Evas_Callback_Type callbackType,
+            typename EvasMemberConnection2<ThisType, ArgType1,
+                                           ArgType2>::CbType callback,
+            ThisType* callee,
+            ArgType1* arg1,
+            ArgType2* arg2)
+        {
+            Assert(m_object);
+            Assert(callee);
+            Assert(callbackType);
+            Assert(callback);
+            IConnection* connection =
+                new EvasMemberConnection2<ThisType, ArgType1, ArgType2>(
+                    callbackType,
+                    callback,
+                    callee,
+                    arg1,
+                    arg2,
+                    this);
+            m_connections.insert(connection);
+            connection->ConnectPrv();
+            return connection;
+        }
+
+        template <class ThisType, class ArgType1>
+        IConnection* ConnectMemberEvasCallback(
+            Evas_Callback_Type callbackType,
+            typename EvasMemberConnection1<ThisType,
+                                           ArgType1>::CbType callback,
+            ThisType* callee,
+            ArgType1* arg1)
+        {
+            Assert(m_object);
+            Assert(callee);
+            Assert(callbackType);
+            Assert(callback);
+            IConnection* connection =
+                new EvasMemberConnection1<ThisType, ArgType1>(callbackType,
+                                                              callback,
+                                                              callee,
+                                                              arg1,
+                                                              this);
+            m_connections.insert(connection);
+            connection->ConnectPrv();
+            return connection;
+        }
+
+        bool DisconnectCallback(IConnection* connection);
+        void DisconnectAll();
+
+        static void StaticOnDelEvent(void* data,
+                                     Evas* /*e*/,
+                                     Evas_Object* /*o*/,
+                                     void* /*ev*/);
+
+        IConnectionsSet m_connections;
+        Evas_Object* m_object;
+    };
+
+  public:
+    EvasObject();
+    explicit EvasObject(Evas_Object* object);
+    EvasObject(const EvasObject& other);
+    ~EvasObject();
+
+    EvasObject& operator=(const EvasObject& other);
+    EvasObject* operator=(Evas_Object* object);
+
+    operator Evas_Object *();
+
+    bool IsValid() const
+    {
+        Assert(m_object);
+        return m_object->GetObject() != NULL;
+    }
+
+    bool DisconnectCallback(IConnection* connection);
+    void DisconnectAll();
+
+    template <class ... Args>
+    IConnection* ConnectSmartCallback(
+        const char* callbackName,
+        typename EvasObjectShared::SmartConnection<Args ...>::CbType
+        callback,
+        Args ... args)
+    {
+        Assert(m_object);
+        return m_object->ConnectSmartCallback(callbackName, callback, args ...);
+    }
+
+    template <class ThisType, class ArgType1, class ArgType2>
+    IConnection* ConnectMemberSmartCallback(
+        const char* callbackName,
+        typename EvasObjectShared::SmartMemberConnection2<ThisType,
+                                                          ArgType1,
+                                                          ArgType2>::CbType
+        callback,
+        ThisType* callee,
+        ArgType1* arg1,
+        ArgType2* arg2)
+    {
+        Assert(m_object);
+        Assert(callee);
+        Assert(callback);
+        return m_object->ConnectMemberSmartCallback(callbackName,
+                                                    callback,
+                                                    callee,
+                                                    arg1,
+                                                    arg2);
+    }
+
+    template <class ThisType, class ArgType1>
+    IConnection* ConnectMemberSmartCallback(
+        const char* callbackName,
+        typename EvasObjectShared::SmartMemberConnection1<ThisType,
+                                                          ArgType1>::CbType
+        callback,
+        ThisType* callee,
+        ArgType1* arg1)
+    {
+        Assert(m_object);
+        Assert(callee);
+        Assert(callback);
+        return m_object->ConnectMemberSmartCallback(callbackName,
+                                                    callback,
+                                                    callee,
+                                                    arg1);
+    }
+
+    template <class ArgType1, class ArgType2>
+    IConnection* ConnectEvasCallback(
+        Evas_Callback_Type callbackType,
+        typename EvasObjectShared::EvasConnection1<ArgType1>::CbType
+        callback,
+        ArgType1* arg1,
+        ArgType2* arg2)
+    {
+        Assert(m_object);
+        return m_object->ConnectEvasCallback(callbackType, callback, arg1, arg2);
+    }
+
+    template <class ArgType1>
+    IConnection* ConnectEvasCallback(
+        Evas_Callback_Type callbackType,
+        typename EvasObjectShared::EvasConnection1<ArgType1>::CbType
+        callback,
+        ArgType1* arg1)
+    {
+        Assert(m_object);
+        return m_object->ConnectEvasCallback(callbackType, callback, arg1);
+    }
+
+    template <class ThisType, class ArgType1>
+    IConnection* ConnectMemberEvasCallback(
+        Evas_Callback_Type callbackType,
+        typename EvasObjectShared::EvasMemberConnection1<ThisType,
+                                                         ArgType1>::CbType
+        callback,
+        ThisType* callee,
+        ArgType1* arg1)
+    {
+        Assert(m_object);
+        Assert(callee);
+        Assert(callback);
+        return m_object->ConnectMemberEvasCallback(callbackType,
+                                                   callback,
+                                                   callee,
+                                                   arg1);
+    }
+
+    template <class ThisType, class ArgType1, class ArgType2>
+    IConnection* ConnectMemberEvasCallback(
+        Evas_Callback_Type callbackType,
+        typename EvasObjectShared::EvasMemberConnection2<ThisType, ArgType1,
+                                                         ArgType2>::CbType
+        callback,
+        ThisType* callee,
+        ArgType1* arg1,
+        ArgType2* arg2)
+    {
+        Assert(m_object);
+        Assert(callee);
+        Assert(callback);
+        return m_object->ConnectMemberEvasCallback(callbackType,
+                                                   callback,
+                                                   callee,
+                                                   arg1,
+                                                   arg2);
+    }
+
+  private:
+    EvasObjectSharedPtr m_object;
+};
+
+#endif //WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
+
diff --git a/src/view/common/scheme.cpp b/src/view/common/scheme.cpp
new file mode 100644 (file)
index 0000000..bb1daa3
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       scheme.cpp
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    1.0
+ */
+
+#include "scheme.h"
+#include <map>
+#include <dpl/log/wrt_log.h>
+#include <dpl/assert.h>
+#include <dpl/platform.h>
+
+namespace ViewModule {
+namespace {
+const char * const type2name[Scheme::COUNT] = {
+    "file",
+    "sms",
+    "smsto",
+    "mmsto",
+    "mailto",
+    "data",
+    "tel",
+    "http",
+    "https",
+    "widget",
+#if ENABLE(APP_SCHEME)
+    "app",
+#endif
+    "rtsp",
+    "about"
+};
+
+typedef std::map<std::string, Scheme::Type> SchemeMap;
+
+SchemeMap PopulateMap()
+{
+    WrtLogD("Populating scheme map...");
+    SchemeMap map;
+    for (size_t st = Scheme::FILE; st < Scheme::COUNT; ++st) {
+        WrtLogD(" * %s -> %d", type2name[st], st);
+        map[type2name[st]] = static_cast<Scheme::Type>(st);
+    }
+    return map;
+}
+
+const SchemeMap name2type = PopulateMap();
+} // namespace
+
+Scheme::Scheme(const std::string& name) : m_name(name), m_type(INVALID)
+{
+    m_type = GetType(name);
+}
+
+std::string Scheme::GetName (Type type)
+{
+    Assert(type >= FILE && type < COUNT);
+    return type2name[type];
+}
+
+Scheme::Type Scheme::GetType(const std::string& name)
+{
+    auto it = name2type.find(name);
+    if (it == name2type.end()) {
+        WrtLogE("Invalid scheme: %s", name.c_str());
+        return INVALID;
+    }
+    return it->second;
+}
+} /* namespace ViewModule */
diff --git a/src/view/common/scheme.h b/src/view/common/scheme.h
new file mode 100644 (file)
index 0000000..4eed310
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       scheme.h
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    1.0
+ */
+
+#ifndef SCHEME_H_
+#define SCHEME_H_
+
+#include <string>
+
+#include <dpl/platform.h>
+
+namespace ViewModule {
+class Scheme
+{
+  public:
+    enum Type {
+        INVALID = -1,
+        FILE = 0,
+        SMS,
+        SMSTO,
+        MMSTO,
+        MAILTO,
+        DATA,
+        TEL,
+        HTTP,
+        HTTPS,
+        WIDGET,
+#if ENABLE(APP_SCHEME)
+        APP,
+#endif
+        RTSP,
+        ABOUT,
+
+        COUNT
+    };
+
+    explicit Scheme(const std::string& name);
+    virtual ~Scheme() {}
+
+    std::string GetName() const
+    {
+        return m_name;
+    }
+    Type GetType() const
+    {
+        return m_type;
+    }
+
+    static std::string GetName (Type type);
+    static std::string GetName (size_t type)
+    {
+        return GetName(static_cast<Type>(type));
+    }
+    static Type GetType(const std::string& name);
+
+  private:
+    std::string m_name;
+    Type m_type;
+};
+} /* namespace ViewModule */
+#endif /* SCHEME_H_ */
diff --git a/src/view/common/scheme_action_map.cpp b/src/view/common/scheme_action_map.cpp
new file mode 100644 (file)
index 0000000..9a2e16e
--- /dev/null
@@ -0,0 +1,416 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       scheme_action_map.cpp
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    1.0
+ */
+
+#include "scheme_action_map.h"
+#include <scheme.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/event/controller.h>
+#include <application_launcher.h>
+#include <appsvc.h>
+#include <pcrecpp.h>
+#include <memory>
+#include <curl/curl.h>
+#include "scheme_action_map_data.h"
+
+namespace ViewModule {
+namespace {
+/*
+ * Lazy construction pattern.
+ * TODO Make it more general. Use variadic template/tuples/lambdas or sth. Move
+ * to DPL.
+ */
+template <typename T, typename Arg1>
+class Lazy
+{
+  public:
+    explicit Lazy(const Arg1& arg1) :
+        m_arg1(arg1),
+        m_object(new std::unique_ptr<T>())
+    {}
+    Lazy(const Lazy<T, Arg1>& other) :
+        m_arg1(other.m_arg1),
+        m_object(other.m_object)
+    {}
+
+    T& operator*()
+    {
+        return GetObject();
+    }
+    const T& operator*() const
+    {
+        return GetObject();
+    }
+    const T* operator->() const
+    {
+        return &GetObject();
+    }
+    T* operator->()
+    {
+        return &GetObject();
+    }
+
+    Lazy<T, Arg1>& operator=(const Lazy<T, Arg1>& other)
+    {
+        m_arg1 = other.m_arg1;
+        m_object = other.m_object;
+        return *this;
+    }
+
+  private:
+    T& GetObject() const
+    {
+        if (!(*m_object)) {
+            (*m_object).reset(new T(m_arg1));
+        }
+        return **m_object;
+    }
+
+    Arg1 m_arg1;
+    // single unique_ptr shared among many Lazy copies
+    mutable std::shared_ptr<std::unique_ptr<T> > m_object;
+};
+
+/*
+ * Struct defining conversion of scheme for given appsvc key for example:
+ * sms:5551212?body=expected%20text => APPSVC_DATA_TEXT + expected%20text
+ */
+struct AppSvcConversion {
+    AppSvcConversion(char const * const keyValue,
+                     const std::string& regexStr) :
+        key(keyValue),
+        regex(regexStr) {}
+    char const * const key;
+    Lazy<pcrecpp::RE, std::string> regex;
+};
+
+/*
+ * Struct defining an appsvc operation and a list of scheme conversions used to
+ * fill in additional appsvc data.
+ */
+struct ServiceOperation {
+    const char* operation;
+    const char* fakeUri;
+    const char* mime;
+    std::list<AppSvcConversion> conversions;
+};
+
+typedef std::map<Scheme::Type, ServiceOperation> ServiceOperationMap;
+
+// Regular expressions used to extract appsvc data from scheme
+// TODO what about multiple recipients?
+char const * const REGEX_BODY =         ".*[?&]body=([^&]+).*";
+char const * const REGEX_SMS =           "sms:([^&]+).*";
+char const * const REGEX_SMSTO =        "smsto:([^&]+).*";
+char const * const REGEX_MMSTO =        "mmsto:([^&]+).*";
+char const * const REGEX_MAILTO =       "mailto:([^&]+).*";
+char const * const REGEX_TO =           ".*[?&]to=([^&]+).*";
+char const * const REGEX_CC =           ".*[?&]cc=([^&]+).*";
+char const * const REGEX_BCC =          ".*[?&]bcc=([^&]+).*";
+char const * const REGEX_SUBJECT =      ".*[?&]subject=([^&]+).*";
+char const * const REGEX_DATA_CONTEXT = ".*;phone-context=([^:]+).*";
+
+ServiceOperationMap initializeAppSvcOperations()
+{
+    ServiceOperationMap ret;
+
+    // FILE, HTTP & HTTPS
+    ServiceOperation viewOp;
+    viewOp.operation = APP_CONTROL_OPERATION_VIEW;
+    viewOp.fakeUri = NULL;
+    viewOp.mime = NULL;
+    // no additional data
+    ret.insert(std::make_pair(Scheme::FILE, viewOp));
+    ret.insert(std::make_pair(Scheme::HTTP, viewOp));
+    ret.insert(std::make_pair(Scheme::HTTPS, viewOp));
+
+    // SMS
+    ServiceOperation smsOp;
+    smsOp.operation = APP_CONTROL_OPERATION_COMPOSE;
+    smsOp.fakeUri = NULL;
+    smsOp.mime = "*/*";
+    smsOp.conversions.push_back(AppSvcConversion(APP_CONTROL_DATA_TO, REGEX_SMS));
+    smsOp.conversions.push_back(AppSvcConversion(APP_CONTROL_DATA_TEXT, REGEX_BODY));
+    ret.insert(std::make_pair(Scheme::SMS, smsOp));
+
+    // SMSTO
+    ServiceOperation smstoOp;
+    smstoOp.operation = APP_CONTROL_OPERATION_COMPOSE;
+    smstoOp.fakeUri = "sms";
+    smstoOp.mime = "*/*";
+    smstoOp.conversions.push_back(AppSvcConversion(APP_CONTROL_DATA_TO, REGEX_SMSTO));
+    smstoOp.conversions.push_back(AppSvcConversion(APP_CONTROL_DATA_TEXT, REGEX_BODY));
+    ret.insert(std::make_pair(Scheme::SMSTO, smstoOp));
+
+
+    // MMSTO & MAILTO
+    ServiceOperation sendOp;
+    sendOp.operation = APP_CONTROL_OPERATION_COMPOSE;
+    sendOp.fakeUri = NULL;
+    sendOp.mime = NULL;
+    sendOp.conversions.push_back(AppSvcConversion(APP_CONTROL_DATA_TO, REGEX_MMSTO));
+    sendOp.conversions.push_back(AppSvcConversion(APP_CONTROL_DATA_TO, REGEX_MAILTO));
+    sendOp.conversions.push_back(AppSvcConversion(APP_CONTROL_DATA_CC, REGEX_CC));
+    sendOp.conversions.push_back(
+        AppSvcConversion(APP_CONTROL_DATA_BCC, REGEX_BCC));
+    sendOp.conversions.push_back(
+        AppSvcConversion(APP_CONTROL_DATA_SUBJECT, REGEX_SUBJECT));
+    sendOp.conversions.push_back(
+        AppSvcConversion(APP_CONTROL_DATA_TEXT, REGEX_BODY));
+    ret.insert(std::make_pair(Scheme::MAILTO, sendOp));
+    sendOp.mime = "*/*";
+    ret.insert(std::make_pair(Scheme::MMSTO, sendOp));
+
+    // TODO what about DATA?
+
+    // TEL
+    ServiceOperation telOp;
+    telOp.operation = APP_CONTROL_OPERATION_CALL;
+    telOp.fakeUri = NULL;
+    telOp.mime = NULL;
+    ret.insert(std::make_pair(Scheme::TEL, telOp));
+
+    return ret;
+}
+
+ServiceOperationMap g_serviceOperationMap = initializeAppSvcOperations();
+
+void handleTizenServiceScheme(const char* uri)
+{
+    // <a href="tizen-service:AppID=com.samsung.myfile; key=key1, value=value1; end">Tizen Service</a>
+    std::string parameter = std::string(uri);
+    std::string appId;
+    size_t start, end = 0;
+
+    if (parameter.find("AppID=") != std::string::npos) {
+        start = parameter.find("AppID=") + strlen("AppID=");
+        end = parameter.find(";", start);
+        appId = parameter.substr(start, end-start);
+    } else {
+        WrtLogE("parameter doesn't contain appID");
+        return;
+    }
+
+    app_control_h handle = NULL;
+    if (app_control_create(&handle) != APP_CONTROL_ERROR_NONE) {
+        WrtLogE("Fail to create app_control handle");
+        return;
+    }
+
+    if (app_control_set_app_id(handle, appId.c_str()) < 0) {
+        WrtLogE("Fail to app_control_set_app_id");
+        app_control_destroy(handle);
+        return;
+    }
+
+    const char* KEY_KEY = "key=";
+    const char* KEY_VALUE = "value=";
+
+    char* buf = strdup(parameter.c_str());
+    const char* ptr = strtok(buf,";");
+    while (ptr != NULL) {
+        std::string string = ptr;
+        ptr = strtok (NULL, ";");
+
+        size_t devide = string.find(',');
+        if (devide == std::string::npos) {
+            continue;
+        }
+        size_t keyPos = string.find(KEY_KEY);
+        if (keyPos == std::string::npos) {
+            continue;
+        }
+        size_t valuePos = string.find(KEY_VALUE);
+        if (valuePos == std::string::npos) {
+            continue;
+        }
+
+        std::string key =
+            string.substr(keyPos + std::string(KEY_KEY).size(),
+                          devide - (keyPos + std::string(KEY_KEY).size()));
+        std::string value =
+            string.substr(valuePos + std::string(KEY_VALUE).size());
+
+        if (app_control_add_extra_data(handle, key.c_str(), value.c_str())) {
+            WrtLogE("app_control_add_extra_data is failed.");
+            app_control_destroy(handle);
+            free(buf);
+            return;
+        }
+    }
+    free(buf);
+
+    CONTROLLER_POST_EVENT(
+        ApplicationLauncher,
+        ApplicationLauncherEvents::LaunchApplicationByAppService(
+            handle,
+            NULL,
+            NULL));
+}
+
+void handleUnknownScheme(const char* scheme, const char* uri)
+{
+    WrtLogE("Invalid scheme: %s", scheme);
+    // case of unknown scheme, send to app-control
+    // This is temporary soultion. "invalid" scheme should be handled by
+    // scheme map data
+
+    if (!strcmp(scheme, "tizen-service")) {
+        handleTizenServiceScheme(uri);
+        return;
+    } else {
+        // create app_control
+        app_control_h app_control = NULL;
+        if (APP_CONTROL_ERROR_NONE == app_control_create(&app_control)) {
+            app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
+            app_control_set_uri(app_control, uri);
+            CONTROLLER_POST_EVENT(
+                ApplicationLauncher,
+                ApplicationLauncherEvents::LaunchApplicationByAppService(
+                    app_control,
+                    NULL,
+                    NULL));
+        }
+    }
+}
+
+
+} // namespace
+
+namespace SchemeActionMap {
+bool HandleUri(const char* uri, NavigationContext context)
+{
+    if (!uri) {
+        WrtLogE("wrong arguments passed");
+        return false;
+    }
+    WrtLogD("Uri being checked: %s", uri);
+
+    const char *end = strstr(uri, ":");
+    if (!end) {
+        WrtLogE("Lack of scheme - ignoring");
+        return false;
+    }
+    std::string name(uri, end);
+    Scheme scheme(name);
+    WrtLogD("Scheme: %s", name.c_str());
+
+    Scheme::Type type = scheme.GetType();
+    if (type < Scheme::FILE || type >= Scheme::COUNT) {
+        WrtLogE("Invalid scheme: %s", name.c_str());
+        handleUnknownScheme(name.c_str(), uri);
+        return false;
+    }
+
+    WrtLogD("Scheme type: %d", type);
+    WrtLogD("Navigation context: %d", context);
+
+    UriAction action = g_tizenActionMap[type][context];
+
+    WrtLogD("Uri action: %d", action);
+
+    // execute action if necessary
+    switch (action) {
+    case URI_ACTION_APPSVC:
+    {
+        // find AppSvcOperation for given scheme type
+        auto it = g_serviceOperationMap.find(type);
+        if (it == g_serviceOperationMap.end()) {
+            WrtLogE("No entry for scheme: %s", name.c_str());
+            return false;
+        }
+
+        // prepare appsvc bundle
+        app_control_h app_control = NULL;
+        app_control_create(&app_control);
+        WrtLogD("appsvc operation %s", it->second.operation);
+        app_control_set_operation(app_control, it->second.operation);
+        if (it->second.fakeUri) {
+            size_t size = strlen(it->second.fakeUri) + strlen(uri) + 1;
+            char *newUri = new char[size];
+            strcpy(newUri, it->second.fakeUri);
+            const char* uriArgs = strstr(uri, ":");
+            strcpy(newUri + strlen(it->second.fakeUri), uriArgs);
+            app_control_set_uri(app_control, newUri);
+            delete [] newUri;
+        }
+        else {
+            app_control_set_uri(app_control, uri);
+        }
+        if (it->second.mime) {
+            app_control_set_mime(app_control, it->second.mime);
+        }
+
+        // this is safe as there are no other threads
+        CURL* curl = curl_easy_init();
+        // unescape the url
+        int outLength = 0;
+        char* unescaped = curl_easy_unescape(curl, uri, 0, &outLength);
+        if (unescaped == NULL) {
+            WrtLogE("unescaped is null");
+            app_control_destroy(app_control);
+            curl_easy_cleanup(curl);
+            return false;
+        }
+        std::string uUri(unescaped, outLength);
+        curl_free(unescaped);
+        curl_easy_cleanup(curl);
+        WrtLogD("unescaped %s", uUri.c_str());
+
+        // setup additional appsvc data
+        FOREACH(cit, it->second.conversions) {
+            WrtLogD("extracting data for key %s", cit->key);
+
+            std::string match;
+            pcrecpp::StringPiece input(uUri);
+
+            // convert scheme text to appsvc format
+            while (cit->regex->Consume(&input, &match)) {
+                WrtLogD("Adding apssvc data: %s %s", cit->key, match.c_str());
+                app_control_add_extra_data(app_control, cit->key, match.c_str());
+            }
+        }
+
+        // TODO do we need a callback?
+        CONTROLLER_POST_EVENT(
+            ApplicationLauncher,
+            ApplicationLauncherEvents::LaunchApplicationByAppService(
+                app_control,
+                NULL,
+                NULL));
+        break;
+    }
+
+    case URI_ACTION_VIDEO:
+        CONTROLLER_POST_EVENT(
+            ApplicationLauncher,
+            ApplicationLauncherEvents::LaunchApplicationByPkgname(
+                ApplicationLauncherPkgname::PKG_NAME_VIDEO_PLAYER,
+                name,
+                uri,
+                "null"));
+        break;
+    default:
+        break;
+    }
+    return (action == URI_ACTION_WRT);
+}
+} // namespace SchemeActionMap
+} /* namespace ViewModule */
diff --git a/src/view/common/scheme_action_map.h b/src/view/common/scheme_action_map.h
new file mode 100644 (file)
index 0000000..04973df
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       scheme_action_map.h
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    1.0
+ */
+
+#ifndef SCHEME_ACTION_MAP_H_
+#define SCHEME_ACTION_MAP_H_
+
+#include "scheme_action_map_type.h"
+
+namespace ViewModule {
+namespace SchemeActionMap {
+bool HandleUri(const char* uri,
+               NavigationContext context);
+};
+} /* namespace ViewModule */
+#endif /* SCHEME_ACTION_MAP_H_ */
diff --git a/src/view/common/scheme_action_map_data.h b/src/view/common/scheme_action_map_data.h
new file mode 100644 (file)
index 0000000..3abff0a
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       scheme_action_map_data.h
+ * @author     Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version    1.0
+ */
+
+#include "scheme_action_map.h"
+
+#include <dpl/platform.h>
+
+#include <scheme.h>
+
+namespace ViewModule {
+namespace {
+enum UriAction {
+    URI_ACTION_WRT,       // load in WRT
+    URI_ACTION_APPSVC,    // launch in APPSVC
+    URI_ACTION_VIDEO,     // launch in VIDEO player
+    URI_ACTION_ERROR
+};
+
+/**
+ * WS-1501 - No top-level window navigation outside the widget. Deafult browser
+ *           should be used instead. Frames/iframes are allowed to navigate.
+ *           This requirement can't be applied to tizen hosted app as in its
+ *           case the whole widget is "outside".
+ *
+ * WS-1502 - When calling window.open() with scheme HTTP/HTTPS and target
+ *           attribute set to "_blank" WRT should open default browser. At the
+ *           moment we can't distinguish target attributes, therefore all new
+ *           windows are opened in the browser regardless of the attribute (the
+ *           value "_new" is also treated this way). Tizen won't satisfy this
+ *           requirement. It should open new windows in WRT.
+ *
+ * Video - YOUTUBE and RSTP are handled by video player.
+ *
+ * File scheme - FILE scheme has to be handled by WRT
+ *
+ * WS-1510/20/30/40/50 - All remaining cases are always handled by appsvc
+ */
+
+// TIZEN
+const UriAction g_tizenActionMap[Scheme::COUNT][SchemeActionMap::COUNT] = {
+    //  TOP_LEVEL           FRAME_LEVEL         NEW_WINDOW
+    { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // FILE
+    { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // SMS
+    { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // SMSTO
+    { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // MMSTO
+    { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // MAILTO
+    { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },        // DATA
+    { URI_ACTION_APPSVC, URI_ACTION_APPSVC, URI_ACTION_APPSVC },  // TEL
+    { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // HTTP
+    { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // HTTPS
+    { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // WIDGET
+#if ENABLE(APP_SCHEME)
+    { URI_ACTION_WRT, URI_ACTION_WRT, URI_ACTION_WRT },           // APP
+#endif
+    { URI_ACTION_VIDEO, URI_ACTION_VIDEO, URI_ACTION_VIDEO }      // RTSP
+};
+
+}
+}
diff --git a/src/view/common/scheme_action_map_type.h b/src/view/common/scheme_action_map_type.h
new file mode 100644 (file)
index 0000000..334e01e
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       scheme_action_map_type.h
+ * @author     Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version    1.0
+ */
+
+#ifndef SCHEME_ACTION_MAP_TYPE_H_
+#define SCHEME_ACTION_MAP_TYPE_H_
+
+namespace ViewModule {
+namespace SchemeActionMap {
+enum NavigationContext {
+    TOP_LEVEL = 0,
+    FRAME_LEVEL,
+    NEW_WINDOW,
+
+    COUNT
+};
+} // namespace SchemeActionMap
+} // namespace ViewModule
+#endif /* SCHEME_ACTION_MAP_TYPE_H_ */
diff --git a/src/view/common/view_logic_apps_support.cpp b/src/view/common/view_logic_apps_support.cpp
new file mode 100644 (file)
index 0000000..9809aec
--- /dev/null
@@ -0,0 +1,411 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_apps_support.cpp
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @brief   Implementation file of AppsSupport class used by ViewLogic
+ */
+
+#include "view_logic_apps_support.h"
+
+#include <fstream>
+#include <memory>
+
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <iri.h>
+#include <appsvc.h>
+#include <notification.h>
+#include <notification_internal.h>
+
+#include <widget_model.h>
+#include <application_launcher.h>
+
+namespace ViewModule {
+namespace {
+const char* const SCHEME_TYPE_HTML5_VIDEO = "html5video";
+const char* const HTTP_STREAMING_MPEG_MIMETYPE = "application/x-mpegurl";
+const char* const HTTP_STREAMING_APPLE_MIMETYPE =
+    "application/vnd.apple.mpegurl";
+const char* const SCHEM_FILE = "file";
+const char* const DOWNLOAD_PATH = "/opt/usr/media/Downloads/";
+}
+
+//Implementation class
+class AppsSupportImplementation
+{
+  private:
+    WidgetModel *m_widgetModel;
+    bool m_initialized;
+    int m_notiId;
+
+    struct HTML5Video {
+        const char* path;
+        const char* cookie;
+    };
+
+    bool httpMultimediaRequest(std::string mimeType, std::string uri)
+     {
+         WrtLogD("httpMultimediaRequest called");
+
+         if ("null" == mimeType || "null" == uri) {
+             WrtLogE("uri/mimeType is null");
+             return false;
+         }
+
+         app_control_h app_control = NULL;
+         app_control_create(&app_control);
+
+         // ignore case match of string of mime type
+         // if needed, define appsvc response callback
+         // and its user data per mimetype
+         if (!strcasecmp(mimeType.c_str(), HTTP_STREAMING_APPLE_MIMETYPE) ||
+             !strcasecmp(mimeType.c_str(), HTTP_STREAMING_MPEG_MIMETYPE))
+         {
+             app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
+             app_control_set_mime(app_control, mimeType.c_str());
+             app_control_set_uri(app_control, uri.c_str());
+         } else {
+             WrtLogD("Not Supported MIME type in WRT");
+             app_control_destroy(app_control);
+             return false;
+         }
+
+         CONTROLLER_POST_EVENT(
+             ApplicationLauncher,
+             ApplicationLauncherEvents::LaunchApplicationByAppService(
+                 app_control,
+                 NULL,
+                 NULL));
+
+         return true;
+     }
+
+    bool isFileExist(std::string path, bool isDirectory)
+    {
+        struct stat fileState;
+        if (stat(path.c_str(), &fileState) != 0) {
+            WrtLogE("Fail to get file stat");
+            return false;
+        }
+
+        if (isDirectory && S_ISDIR(fileState.st_mode)) {
+            return true;
+        }
+        if (!isDirectory && S_ISREG(fileState.st_mode)) {
+            return true;
+        }
+        return false;
+    }
+
+    bool copyFile(std::string file, std::string dest)
+    {
+        std::ifstream in (file);
+        if (in.is_open() == false) {
+            WrtLogE("Fail to open input file");
+            return false;
+        }
+        std::ofstream out(dest);
+        if (out.is_open() == false) {
+            WrtLogE("Fail to open output file");
+            return false;
+        }
+        out << in.rdbuf();
+        out.close();
+        in.close();
+
+        return true;
+    }
+
+    void freeResource(notification_h n, bundle *b)
+    {
+        if (n) {
+            notification_free(n);
+        }
+        if (b) {
+            bundle_free(b);
+        }
+        return;
+    }
+
+    int createCompleteNotification(std::string fileName, std::string filePath, std::string result)
+    {
+        // create notification
+        notification_h noti = NULL;
+        noti = notification_create(NOTIFICATION_TYPE_NOTI);
+        if (noti == NULL) {
+            WrtLogE("Fail to notification_create");
+            return -1;
+        }
+
+        // set notification layout
+        int ret;
+        ret = notification_set_layout(noti, NOTIFICATION_LY_ONGOING_EVENT);
+        if (ret != NOTIFICATION_ERROR_NONE) {
+            WrtLogE("Fail to notification_set_layout");
+            freeResource(noti, NULL);
+            return -1;
+        }
+
+        // set notification title text
+        ret = notification_set_text(noti,
+                                    NOTIFICATION_TEXT_TYPE_TITLE,
+                                    fileName.c_str(),
+                                    NULL,
+                                    NOTIFICATION_VARIABLE_TYPE_NONE);
+        if (ret != NOTIFICATION_ERROR_NONE) {
+            WrtLogE("Fail to notification_set_text title");
+            freeResource(noti, NULL);
+            return -1;
+        }
+
+        // set notification content text
+        ret = notification_set_text(noti,
+                                    NOTIFICATION_TEXT_TYPE_CONTENT,
+                                    result.c_str(),
+                                    NULL,
+                                    NOTIFICATION_VARIABLE_TYPE_NONE);
+        if (ret != NOTIFICATION_ERROR_NONE) {
+            WrtLogE("Fail to notification_set_text content");
+            freeResource(noti, NULL);
+            return -1;
+        }
+
+        //set image for notification
+        ret = notification_set_image(noti,
+                                     NOTIFICATION_IMAGE_TYPE_ICON,
+                                     filePath.c_str());
+        if (ret != NOTIFICATION_ERROR_NONE) {
+            WrtLogE("Fail to notification_set_image");
+            freeResource(noti, NULL);
+            return -1;
+        }
+
+        // set bundle data
+        bundle *b = bundle_create();
+        if (!b) {
+            WrtLogE("Fail to bundle_create");
+            freeResource(noti, NULL);
+            return -1;
+        }
+        if (appsvc_set_operation(b, APPSVC_OPERATION_VIEW) != APPSVC_RET_OK) {
+            WrtLogE("Fail to appsvc_set_operation");
+            freeResource(noti, b);
+            return -1;
+        }
+        if (appsvc_set_uri(b, filePath.c_str()) != APPSVC_RET_OK) {
+            WrtLogE("Fail to appsvc_set_uri");
+            freeResource(noti, b);
+            return -1;
+        }
+
+        // set notification execute option
+        ret = notification_set_execute_option(noti,
+                                              NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
+                                              "View",
+                                              NULL,
+                                              b);
+        if (ret != NOTIFICATION_ERROR_NONE) {
+            WrtLogE("Fail to notification_set_execute_option");
+            freeResource(noti, b);
+            return -1;
+        }
+
+        int privId;
+        ret = notification_insert(noti, &privId);
+        if (ret != NOTIFICATION_ERROR_NONE) {
+            WrtLogE("Fail to notification_insert");
+            freeResource(noti, b);
+            return -1;
+        }
+        freeResource(noti, b);
+        return privId;
+    }
+
+    void localUriRequest(std::string filePath)
+    {
+        WrtLogD("file path = [%s]", filePath.c_str());
+
+        // verify request file path
+        if (isFileExist(filePath, false) == false) {
+            WrtLogE("Request file path isn't existed");
+            return;
+        }
+
+        // create destPath
+        if (isFileExist(DOWNLOAD_PATH, true) == false) {
+            WrtLogE("Downloads directory isn't existed");
+            return;
+        }
+
+        // create destFileFullPath
+        std::string fileName = filePath.substr(filePath.rfind('/') + 1);
+        unsigned int renameSuffixNb = 0;
+        std::string destFileName = fileName;
+        while (isFileExist(DOWNLOAD_PATH + destFileName, false)) {
+            std::ostringstream suffixOstr;
+            suffixOstr.str("");
+            suffixOstr << fileName << "_" << renameSuffixNb++;
+
+            destFileName = fileName;
+            destFileName.insert(destFileName.find('.'), suffixOstr.str());
+        }
+        std::string destFileFullPath = DOWNLOAD_PATH + destFileName;
+
+        // copy
+        if (copyFile(filePath, destFileFullPath) == false) {
+            WrtLogE("Fail to copy file");
+            return;
+        }
+        m_notiId = createCompleteNotification(destFileName,
+                                              destFileFullPath,
+                                              "Download Complete");
+    }
+
+  public:
+    AppsSupportImplementation() :
+        m_widgetModel(NULL),
+        m_initialized(false)
+    {}
+
+    ~AppsSupportImplementation()
+    {
+        AssertMsg(!m_initialized,
+               "AppsSupport has to be deinitialized prior destroying!");
+    }
+
+    void initialize(WidgetModel *widgetModel, unsigned windowHandle)
+    {
+        AssertMsg(!m_initialized, "Already initialized!");
+
+        WrtLogD("Initializing Apps Support");
+        AssertMsg(widgetModel, "Passed widgetModel is NULL!");
+        m_widgetModel = widgetModel;
+
+        ApplicationLauncherSingleton::Instance().Touch();
+        ApplicationLauncherSingleton::Instance().setWidgetTizenId(
+            DPL::ToUTF8String(m_widgetModel->TizenId));
+        ApplicationLauncherSingleton::Instance().setWindowHandle(windowHandle);
+
+        WrtLogD("Initialized");
+        m_initialized = true;
+    }
+
+    void deinitialize()
+    {
+        AssertMsg(m_initialized, "Not initialized!");
+        WrtLogD("Deinitialized");
+        m_widgetModel = NULL;
+        m_initialized = false;
+    }
+
+    void downloadRequest(const char *url,
+                         const char *mimeType,
+                         const char *userParam)
+    {
+        WrtLogD("Download info: %s (%s, %s)", url, mimeType, userParam);
+
+        // separate local & host scheme
+        std::unique_ptr<iri_t, decltype(&iri_destroy)> iri(iri_parse(url), iri_destroy);
+        if (!iri.get()) {
+            WrtLogD("Fail to get iri");
+            return;
+        }
+        if (!iri->scheme) {
+            WrtLogE("Fail to get scheme");
+            return;
+        }
+        if (std::string(iri->scheme) == SCHEM_FILE) {
+            WrtLogD("copy to Download directory");
+            if (!iri->path) {
+                WrtLogE("file path is empty");
+                return;
+            }
+            localUriRequest(iri->path);
+            return;
+        }
+
+        // ignore case match of string of mime type
+        bool isAppServiceable = httpMultimediaRequest(
+                mimeType ? std::string(mimeType) : "null",
+                url ? std::string(url) : "null");
+
+        if (isAppServiceable) {
+            WrtLogD("Application Service start");
+            return;
+        }
+
+        CONTROLLER_POST_EVENT(
+            ApplicationLauncher,
+            ApplicationLauncherEvents::LaunchApplicationByPkgname(
+                ApplicationLauncherPkgname::PKG_NAME_DOWNLOAD_PROVIDER,
+                url ? std::string(url) : "null",
+                mimeType && strlen(mimeType) != 0 ? mimeType : "null",
+                userParam && strlen(userParam) != 0 ? userParam : "null"));
+    }
+
+    void html5VideoRequest(void* event_info)
+    {
+        WrtLogD("html5VideoRequestCallback called");
+        Assert(event_info);
+        HTML5Video* video = static_cast<HTML5Video*>(event_info);
+
+        WrtLogD("video->path : %s", video->path);
+        WrtLogD("video->cookie : %s", video->cookie);
+        if (NULL == video->path) {
+            WrtLogE("path is null");
+            return;
+        }
+        CONTROLLER_POST_EVENT(
+            ApplicationLauncher,
+            ApplicationLauncherEvents::LaunchApplicationByPkgname(
+                ApplicationLauncherPkgname::PKG_NAME_VIDEO_PLAYER,
+                SCHEME_TYPE_HTML5_VIDEO,
+                video->path ? video->path : "null",
+                video->cookie ? video->cookie : "null"));
+    }
+};
+
+AppsSupport::AppsSupport() : m_impl(new AppsSupportImplementation)
+{}
+
+AppsSupport::~AppsSupport()
+{}
+
+void AppsSupport::initialize(WidgetModel *widgetModel, unsigned windowHandle)
+{
+    m_impl->initialize(widgetModel, windowHandle);
+}
+
+void AppsSupport::deinitialize()
+{
+    m_impl->deinitialize();
+}
+
+void AppsSupport::html5VideoRequest(void* event_info)
+{
+    m_impl->html5VideoRequest(event_info);
+}
+
+void AppsSupport::downloadRequest(const char *url,
+                                  const char *mimeType,
+                                  const char *userParam)
+{
+    m_impl->downloadRequest(url, mimeType, userParam);
+}
+} //namespace
diff --git a/src/view/common/view_logic_apps_support.h b/src/view/common/view_logic_apps_support.h
new file mode 100644 (file)
index 0000000..505f3ac
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_apps_support.h
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @brief   Header file of AppsSupport class used by ViewLogic
+ */
+
+#ifndef VIEW_LOGIC_APPS_SUPPORT_H_
+#define VIEW_LOGIC_APPS_SUPPORT_H_
+
+#include <memory>
+#include <string>
+
+class WidgetModel; //Forward declaration
+
+namespace ViewModule {
+class AppsSupportImplementation; //Forward declaration
+
+class AppsSupport
+{
+  public:
+    AppsSupport();
+    virtual ~AppsSupport();
+
+    void initialize(WidgetModel *, unsigned);
+    void deinitialize();
+    void html5VideoRequest(void* event_info);
+    void downloadRequest(
+        const char *url,
+        const char *mimeType,
+        const char *userParam);
+
+  private:
+    std::unique_ptr<AppsSupportImplementation> m_impl;
+};
+} //namespace
+
+#endif /* VIEW_LOGIC_APPS_SUPPORT_H_ */
diff --git a/src/view/common/view_logic_certificate_support.cpp b/src/view/common/view_logic_certificate_support.cpp
new file mode 100644 (file)
index 0000000..d76b717
--- /dev/null
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_certificate_origin_support.cpp
+ * @author  Leerang Song (leerang.song@samsung.com)
+ * @version 1.0
+ * @brief   Support certificate dao
+ */
+
+#include "view_logic_certificate_support.h"
+
+#include <memory>
+#include <Evas.h>
+#include <Elementary.h>
+#include <efl_assist.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/availability.h>
+#include <dpl/assert.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include <wrt-commons/certificate-dao/certificate_dao.h>
+#include <widget_model.h>
+#include <widget_string.h>
+#include <common/view_logic_get_parent_window_util.h>
+
+namespace ViewModule {
+namespace {
+const double MAX_POPUP_HEIGHT = 0.80;
+const double MAX_SCROLLER_HEIGHT = 0.5;
+
+struct CallbackData {
+    Evas_Smart_Cb eaKeyCallback;
+};
+
+static void deleteCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo);
+static void resizeCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo);
+
+static void deleteCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(e);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    CallbackData* callbackData = static_cast<CallbackData*>(data);
+    if (callbackData) {
+        ea_object_event_callback_del(obj, EA_CALLBACK_BACK, callbackData->eaKeyCallback);
+        delete callbackData;
+    }
+    evas_object_event_callback_del(obj, EVAS_CALLBACK_RESIZE, resizeCallback);
+}
+
+static void resizeCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(data);
+    DPL_UNUSED_PARAM(e);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    Evas_Object* popup = obj;
+    int popupH;
+    evas_object_geometry_get(popup, 0, 0, 0, &popupH);
+
+    Evas_Object* parent = PopupUtil::getParentWindow(popup);
+    int parentW, parentH;
+    evas_object_geometry_get(parent, 0, 0, &parentW, &parentH);
+
+    // compare current popup height with screen height.
+    // To avoid popup is filled full screen, used magic number to be filled 80% of screen height.
+    // TODO: Automatically add scroller feature should implement in the elementary
+    double threshold = parentH * MAX_POPUP_HEIGHT;
+    double currentH = popupH;
+    if (threshold < currentH) {
+        WrtLogD("text is overflow popup height. add scroller");
+        Evas_Object* layout = elm_object_content_get(obj);
+        Evas_Object* label = elm_object_part_content_get(layout, "elm.swallow.label");
+
+        Evas_Object* scroller = elm_scroller_add(layout);
+        elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_AUTO);
+        evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+        evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
+        elm_scroller_content_min_limit(scroller, EINA_TRUE, EINA_TRUE);
+        int scrollerHeight = parentW > parentH ? parentH : parentW;
+        evas_object_size_hint_max_set(scroller, -1, scrollerHeight * MAX_SCROLLER_HEIGHT);
+
+        elm_object_part_content_unset(layout, "elm.swallow.label");
+        elm_object_content_set(scroller, label);
+        elm_object_part_content_set(layout, "elm.swallow.label", scroller);
+        evas_object_show(layout);
+    }
+}
+}
+
+class CertificateSupportImplementation
+{
+  private:
+    WidgetModel* m_model;
+    CertificateDB::CertificateDAOPtr m_certificateDAO;
+
+  public:
+    CertificateSupportImplementation(WidgetModel* widgetModel) :
+        m_model(NULL)
+    {
+        Assert(widgetModel);
+        m_model = widgetModel;
+    }
+
+    ~CertificateSupportImplementation()
+    {}
+
+    CertificateDB::CertificateDAO* getCertificateDAO(void)
+    {
+        Assert(m_model);
+        if (!m_certificateDAO) {
+            WrtLogD("initialize CertificateDAO");
+            m_certificateDAO =
+                CertificateDB::CertificateDAOPtr(
+                    new CertificateDB::CertificateDAO(m_model->TzPkgId.
+                                                                Get()));
+            // initialize certificate result data. Remove allow, deny for
+            m_certificateDAO->removeCertificateData(
+                CertificateDB::RESULT_ALLOW_ONCE);
+            m_certificateDAO->removeCertificateData(
+                CertificateDB::RESULT_DENY_ONCE);
+        }
+        return m_certificateDAO.get();
+    }
+};
+
+CertificateSupport::CertificateSupport(WidgetModel* widgetModel) :
+    m_impl(new CertificateSupportImplementation(widgetModel))
+{}
+
+CertificateSupport::~CertificateSupport()
+{}
+
+CertificateDB::CertificateDAO* CertificateSupport::
+    getCertificateDAO(void)
+{
+    return m_impl->getCertificateDAO();
+}
+
+Evas_Object* CertificateSupportUtil::createPopup(
+    Evas_Object* window,
+    const char* bodyText,
+    const char* checkText,
+    Evas_Smart_Cb buttonCallback,
+    Evas_Smart_Cb keyCallback,
+    void* data)
+{
+    WrtLogD("createPopup");
+
+    Evas_Object* parentWindow = PopupUtil::getParentWindow(window);
+    Evas_Object* popup = elm_popup_add(parentWindow);
+
+    CallbackData* callbackData = NULL;
+    if (keyCallback) {
+        callbackData = new CallbackData;
+        callbackData->eaKeyCallback = keyCallback;
+        ea_object_event_callback_add(popup, EA_CALLBACK_BACK, keyCallback, data);
+    }
+    evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, deleteCallback, static_cast<void*>(callbackData));
+    evas_object_event_callback_add(popup, EVAS_CALLBACK_RESIZE, resizeCallback, NULL);
+
+    elm_object_style_set(popup, "popup/default");
+    evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(popup, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+    Evas_Object* layout = elm_layout_add(popup);
+    elm_layout_file_set(layout, WRT_EDJ_PATH, "popupWithCheck");
+    evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+    Evas_Object* label = elm_label_add(popup);
+    elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
+    elm_object_text_set(label, bodyText);
+    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);
+
+    Evas_Object* check = elm_check_add(layout);
+#if USE(EFL_LITE)
+    elm_object_style_set(check, "popup");
+#else
+    elm_object_style_set(check, "multiline");
+#endif
+    elm_object_domain_translatable_part_text_set(check, 0, "wrt", checkText);
+
+    elm_object_part_content_set(layout, "elm.swallow.label", label);
+    elm_object_part_content_set(layout, "elm.swallow.checkbox", check);
+    elm_object_content_set(popup, layout);
+
+    Evas_Object* btn1 = elm_button_add(popup);
+    elm_object_style_set(btn1, "popup");
+    elm_object_domain_translatable_part_text_set(btn1, 0, "wrt", WRT_OPT_DENY_IDS);
+    elm_object_part_content_set(popup, "button1", btn1);
+    evas_object_smart_callback_add(btn1, "clicked", buttonCallback, data);
+    Evas_Object* btn2 = elm_button_add(popup);
+    elm_object_style_set(btn2, "popup");
+    elm_object_domain_translatable_part_text_set(btn2, 0, "wrt", WRT_OPT_ALLOW_IDS);
+    elm_object_part_content_set(popup, "button2", btn2);
+    evas_object_smart_callback_add(btn2, "clicked", buttonCallback, data);
+
+    return popup;
+}
+
+Evas_Object* CertificateSupportUtil::getPopup(Evas_Object* button)
+{
+    Assert(button);
+
+    Evas_Object* popup = button;
+    while (strcmp(elm_object_widget_type_get(popup), "elm_popup")) {
+        popup = elm_object_parent_widget_get(popup);
+        if (!popup) {
+            return NULL;
+        }
+    }
+    return popup;
+}
+
+Evas_Object* CertificateSupportUtil::getCheck(Evas_Object* popup)
+{
+    Assert(popup);
+    if (strcmp(elm_object_widget_type_get(popup), "elm_popup")) {
+        return NULL;
+    }
+    Evas_Object* check = elm_object_part_content_get(
+            elm_object_content_get(popup),
+            "elm.swallow.checkbox");
+    return check;
+}
+
+CertificateDB::Result CertificateSupportUtil::getResult(
+    Evas_Object* button)
+{
+    using namespace CertificateDB;
+
+    Assert(button);
+    // get popup evas_object
+    Evas_Object* popup = getPopup(button);
+    if (popup == NULL) {
+        return RESULT_UNKNOWN;
+    }
+    bool allow = !strcmp(WRT_OPT_ALLOW, elm_object_text_get(button));
+
+    // get check evas_object
+    Evas_Object* check = getCheck(popup);
+    if (check == NULL) {
+        return RESULT_UNKNOWN;
+    }
+    if (allow) {
+        return elm_check_state_get(check) ? RESULT_ALLOW_ALWAYS :
+               RESULT_ALLOW_ONCE;
+    } else {
+        return elm_check_state_get(check) ? RESULT_DENY_ALWAYS :
+               RESULT_DENY_ONCE;
+    }
+}
+} // namespace ViewModule
diff --git a/src/view/common/view_logic_certificate_support.h b/src/view/common/view_logic_certificate_support.h
new file mode 100644 (file)
index 0000000..15b541b
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_certificate_origin_support.h
+ * @author  Leerang Song (leerang.song@samsung.com)
+ * @version 1.0
+ * @brief   Header file for certificate
+ */
+
+#ifndef VIEW_LOGIC_CERTIFICATE_SUPPORT_H_
+#define VIEW_LOGIC_CERTIFICATE_SUPPORT_H_
+
+#include <memory>
+#include <Evas.h>
+#include <Elementary.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include <wrt-commons/certificate-dao/certificate_dao.h>
+
+class WidgetModel;
+namespace CertificateDB {
+class CertificateDAO;
+}
+
+namespace ViewModule {
+class CertificateSupportImplementation;
+
+class CertificateSupport
+{
+  public:
+    CertificateSupport(WidgetModel* widgetModel);
+    virtual ~CertificateSupport();
+    CertificateDB::CertificateDAO* getCertificateDAO();
+
+  private:
+    std::unique_ptr<CertificateSupportImplementation> m_impl;
+};
+
+namespace CertificateSupportUtil {
+class PermissionData
+{
+  public:
+    CertificateDB::CertificateDAO* m_certiDao;
+    CertificateDB::CertificateData m_certiData;
+    void* m_data;
+
+    PermissionData(
+        CertificateDB::CertificateDAO* certiDao,
+        CertificateDB::CertificateData certiData,
+        void* data) :
+        m_certiDao(certiDao),
+        m_certiData(certiData),
+        m_data(data)
+    {}
+};
+
+Evas_Object* createPopup(Evas_Object* window,
+                         const char* bodyText,
+                         const char* checkText,
+                         Evas_Smart_Cb buttonCallback,
+                         Evas_Smart_Cb keyCallback,
+                         void* data);
+Evas_Object* getPopup(Evas_Object* button);
+Evas_Object* getCheck(Evas_Object* popup);
+CertificateDB::Result getResult(Evas_Object* button);
+};
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_CERTIFICATE_SUPPORT_H_
\ No newline at end of file
diff --git a/src/view/common/view_logic_custom_header_support.cpp b/src/view/common/view_logic_custom_header_support.cpp
new file mode 100644 (file)
index 0000000..6ecba87
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_custom_header_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @brief   Implementation file of CustomHeaderSupport API used by ViewLogic
+ */
+
+#include "view_logic_custom_header_support.h"
+
+#include <vconf.h>
+#include <vconf-keys.h>
+
+#include <string>
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+
+namespace {
+const std::string LANGUAGE_EN = "en";
+};
+
+namespace ViewModule {
+namespace CustomHeaderSupport {
+std::string getValueByField(const std::string &field)
+{
+    WrtLogD("Field : %s", field.c_str());
+    std::string ret;
+
+    if (field == ACCEPT_LANGUAGE) {
+        char *systemLanguageSet = NULL;
+        systemLanguageSet = vconf_get_str(VCONFKEY_LANGSET);
+        WrtLogD("system language = [%s]", systemLanguageSet);
+
+        if (!systemLanguageSet) {
+            WrtLogE("Failed to get VCONFKEY_LANGSET. set as English");
+            ret.append(LANGUAGE_EN);
+        } else {
+            // copy first 2bytes of language set (en, ko, po)
+            ret.append(systemLanguageSet, 2);
+        }
+
+        if (systemLanguageSet) {
+            free(systemLanguageSet);
+        }
+    } else {
+        WrtLogE("Wrong field is passed");
+        Assert(false);
+    }
+
+    return ret;
+}
+} // namespace CustomHeaderSupport
+} // namespace ViewModule
diff --git a/src/view/common/view_logic_custom_header_support.h b/src/view/common/view_logic_custom_header_support.h
new file mode 100644 (file)
index 0000000..99ab3e9
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_custom_header_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @brief   Header file of CustomHeaderSupport API used by ViewLogic
+ */
+
+#ifndef VIEW_LOGIC_CUSTOM_HEADER_SUPPORT_H_
+#define VIEW_LOGIC_CUSTOM_HEADER_SUPPORT_H_
+
+#include <string>
+
+namespace ViewModule {
+namespace CustomHeaderSupport {
+const std::string ACCEPT_LANGUAGE = "Accept-Language";
+
+std::string getValueByField(const std::string &field);
+} // namespace UserAgentSupport
+} // namespace CustomHeaderSupport
+
+#endif /* VIEW_LOGIC_CUSTOM_HEADER_SUPPORT_H_ */
diff --git a/src/view/common/view_logic_get_parent_window_util.h b/src/view/common/view_logic_get_parent_window_util.h
new file mode 100644 (file)
index 0000000..8580424
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_get_parent_window_util.h
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_GET_PARENT_WINDOW_UTIL_H_
+#define VIEW_LOGIC_GET_PARENT_WINDOW_UTIL_H_
+
+#include <Elementary.h>
+#include <dpl/log/wrt_log.h>
+
+namespace ViewModule {
+namespace PopupUtil {
+
+static Evas_Object* getParentWindow(Evas_Object* object)
+{
+    Evas_Object* parent = elm_object_parent_widget_get(object);
+    Evas_Object* win = parent;
+
+    while (parent) {
+        const char* type = elm_object_widget_type_get(parent);
+        if (type) {
+            if (!strncmp(type, "elm_win", strlen("elm_win"))) {
+                win = parent;
+                break;
+            }
+        }
+        parent = elm_object_parent_widget_get(parent);
+    }
+
+    if (!win)
+    {
+        WrtLogE("Parent window was not found!");
+        win = object;
+    }
+
+    return win;
+}
+
+} //namespace ViewModule
+} //namespace PopupUtil
+#endif //VIEW_LOGIC_GET_PARENT_WINDOW_UTIL_H_
diff --git a/src/view/common/view_logic_help_popup_support.cpp b/src/view/common/view_logic_help_popup_support.cpp
new file mode 100644 (file)
index 0000000..7b86e6e
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_help_popup_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+
+#include "view_logic_help_popup_support.h"
+
+#include <efl_assist.h>
+#include <Elementary.h>
+#include <dpl/assert.h>
+#include <dpl/availability.h>
+#include <dpl/log/wrt_log.h>
+
+#include <common/view_logic_get_parent_window_util.h>
+#include <widget_string.h>
+
+namespace ViewModule {
+namespace {
+Evas_Object* getPopup(Evas_Object* object);
+static void buttonClickedCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+Evas_Object* getPopup(Evas_Object* object)
+{
+    Assert(object);
+
+    Evas_Object* popup = object;
+    while (strcmp(elm_object_widget_type_get(popup), "elm_popup")) {
+        popup = elm_object_parent_widget_get(popup);
+        if (!popup) {
+            return NULL;
+        }
+    }
+    return popup;
+}
+
+static void buttonClickedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(data);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    Evas_Object* popup = getPopup(obj);
+    if (!popup) {
+        WrtLogW("Fail to get popup object");
+        return;
+    }
+    evas_object_hide(popup);
+    evas_object_del(popup);
+}
+} // namespace anonymous
+
+void HelpPopupSupport::showClearDefaultPopup(Evas_Object* object)
+{
+    WrtLogD("called");
+
+    Assert(object);
+
+    // create popup
+    Evas_Object* parentWindow = PopupUtil::getParentWindow(object);
+    Evas_Object* popup = elm_popup_add(parentWindow);
+    elm_object_domain_translatable_part_text_set(popup, 0, "wrt", WRT_POP_CLEAR_DEFAULT_SETTINGS_IDS);
+    ea_object_event_callback_add(popup, EA_CALLBACK_BACK, ea_popup_back_cb, NULL);
+
+    // create button
+    Evas_Object* button = elm_button_add(popup);
+    elm_object_style_set(button, "popup");
+    elm_object_domain_translatable_part_text_set(button, 0, "sys_string", WRT_SK_OK_IDS);
+    elm_object_part_content_set(popup, "button1", button);
+    evas_object_smart_callback_add(button, "clicked", buttonClickedCallback, NULL);
+
+    evas_object_show(popup);
+}
+} // namespace ViewModule
diff --git a/src/view/common/view_logic_help_popup_support.h b/src/view/common/view_logic_help_popup_support.h
new file mode 100644 (file)
index 0000000..1abbaa9
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_help_popup_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_HELP_POPUP_SUPPORT_H_
+#define VIEW_LOGIC_HELP_POPUP_SUPPORT_H_
+
+#include <Elementary.h>
+
+namespace ViewModule {
+namespace HelpPopupSupport {
+
+void showClearDefaultPopup(Evas_Object* object);
+
+} //namespace HelpPopupSupport
+} //namespace ViewModule
+#endif //VIEW_LOGIC_HELP_POPUP_SUPPORT_H_
\ No newline at end of file
diff --git a/src/view/common/view_logic_privilege_support.cpp b/src/view/common/view_logic_privilege_support.cpp
new file mode 100644 (file)
index 0000000..4748e70
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_privilege_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "view_logic_privilege_support.h"
+
+#include <cwchar>
+#include <map>
+
+#include <dpl/log/wrt_log.h>
+#include <dpl/foreach.h>
+#include <dpl/string.h>
+#include <widget_model.h>
+
+namespace ViewModule {
+namespace {
+const std::map<PrivilegeSupport::Privilege, std::string> privilegeTextMap = {
+    {PrivilegeSupport::Privilege::CAMERA,       "http://tizen.org/privilege/camera"},
+    {PrivilegeSupport::Privilege::LOCATION,     "http://tizen.org/privilege/location"},
+    {PrivilegeSupport::Privilege::MEDIACAPTURE, "http://tizen.org/privilege/mediacapture"},
+    {PrivilegeSupport::Privilege::RECORDER,     "http://tizen.org/privilege/recorder"}
+};
+}
+
+//Implementation class
+class PrivilegeSupportImplementation
+{
+  private:
+    WidgetModel* m_model;
+    bool m_isLegacyPolicy;
+    std::map<PrivilegeSupport::Privilege, DPL::OptionalBool> m_cacheResult;
+
+    void initializePrivilegePolicy(void)
+    {
+        Assert(m_model);
+
+        DPL::OptionalString requiredVersionString = m_model->RequiredVersion.Get();
+        if (!requiredVersionString) {
+            // tizen required_version is mandatory element
+            Assert(false && "Required version is empty");
+        }
+
+        double requiredVersion = atof(DPL::ToUTF8String(*requiredVersionString).c_str());
+
+        if (requiredVersion < 2.3) {
+            // tizen v1.0 ~ v2.2
+            m_isLegacyPolicy = true;
+        } else {
+            // tizen v2.3 ~
+            m_isLegacyPolicy = false;
+        }
+    }
+
+    bool isCached(PrivilegeSupport::Privilege priv)
+    {
+        return m_cacheResult.find(priv) != m_cacheResult.end();
+    }
+
+    void setCache(PrivilegeSupport::Privilege priv, DPL::OptionalBool result)
+    {
+        m_cacheResult[priv] = result;
+    }
+
+    DPL::OptionalBool getCache(PrivilegeSupport::Privilege priv)
+    {
+        return m_cacheResult[priv];
+    }
+
+    bool searchPrivilege(PrivilegeSupport::Privilege priv)
+    {
+        std::string target = privilegeTextMap.find(priv)->second;
+        WrtDB::PrivilegeList list = m_model->WidgetPrivilegeList.Get();
+        FOREACH(it, list) {
+            if (target == DPL::ToUTF8String(*it)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+
+  public:
+    PrivilegeSupportImplementation(WidgetModel* model) :
+        m_model(model),
+        m_isLegacyPolicy(false)
+    {
+        // Distribute required version
+        initializePrivilegePolicy();
+    }
+
+    ~PrivilegeSupportImplementation()
+    {
+    }
+
+    DPL::OptionalBool getPrivilegeStatus(PrivilegeSupport::Privilege priv)
+    {
+        // ALLOW : return true
+        // DENY : return false
+        // ASK : return empty
+        DPL::OptionalBool ret;
+
+        if (m_isLegacyPolicy) {
+            return ret;
+        }
+
+        if (isCached(priv)) {
+            return getCache(priv);
+        }
+
+        if (searchPrivilege(priv)) {
+            setCache(priv, ret);
+            return ret;
+        }
+
+        ret = false;
+        setCache(priv, ret);
+        return ret;
+    }
+};
+
+PrivilegeSupport::PrivilegeSupport(WidgetModel* model) : m_impl(new PrivilegeSupportImplementation(model))
+{
+}
+
+PrivilegeSupport::~PrivilegeSupport()
+{
+}
+
+DPL::OptionalBool PrivilegeSupport::getPrivilegeStatus(PrivilegeSupport::Privilege priv)
+{
+    return m_impl->getPrivilegeStatus(priv);
+}
+
+} //namespace ViewModule
diff --git a/src/view/common/view_logic_privilege_support.h b/src/view/common/view_logic_privilege_support.h
new file mode 100644 (file)
index 0000000..8f2e6c7
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_privilege_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_PRIVILEGE_SUPPORT_H_
+#define VIEW_LOGIC_PRIVILEGE_SUPPORT_H_
+
+#include <memory>
+
+#include <dpl/optional_typedefs.h>
+
+//Forward declaration
+class WidgetModel;
+
+namespace ViewModule {
+//Forward declaration
+class PrivilegeSupportImplementation;
+
+class PrivilegeSupport
+{
+  public:
+    enum class Privilege {
+        CAMERA,       // http://tizen.org/privilege/camera
+        LOCATION,     // http://tizen.org/privilege/location
+        MEDIACAPTURE, // http://tizen.org/privilege/mediacapture
+        RECORDER      // http://tizen.org/privilege/recorder
+    };
+
+    PrivilegeSupport(WidgetModel* model);
+    virtual ~PrivilegeSupport();
+
+    DPL::OptionalBool getPrivilegeStatus(Privilege pri);
+
+  private:
+    std::unique_ptr<ViewModule::PrivilegeSupportImplementation> m_impl;
+};
+
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_PRIVILEGE_SUPPORT_H_
diff --git a/src/view/common/view_logic_security_origin_support.cpp b/src/view/common/view_logic_security_origin_support.cpp
new file mode 100644 (file)
index 0000000..775205e
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_security_origin_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ * @brief   Support security origin dao
+ */
+
+#include "view_logic_security_origin_support.h"
+
+#include <memory>
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao.h>
+#include <widget_model.h>
+
+namespace ViewModule {
+
+    class SecurityOriginSupportImplementation
+{
+  private:
+    WidgetModel* m_model;
+    SecurityOriginDB::SecurityOriginDAOPtr m_securityOriginDAO;
+
+  public:
+    SecurityOriginSupportImplementation(WidgetModel* widgetModel) :
+        m_model(NULL)
+    {
+        Assert(widgetModel);
+        m_model = widgetModel;
+    }
+
+    ~SecurityOriginSupportImplementation()
+    {}
+
+    SecurityOriginDB::SecurityOriginDAO* getSecurityOriginDAO(void)
+    {
+        Assert(m_model);
+        if (!m_securityOriginDAO) {
+            WrtLogD("initialize securityOriginDAO");
+            m_securityOriginDAO =
+                SecurityOriginDB::SecurityOriginDAOPtr(
+                    new SecurityOriginDB::SecurityOriginDAO(m_model->TzPkgId.
+                                                                Get()));
+            // initialize security result data. Remove allow, deny for
+            m_securityOriginDAO->removeSecurityOriginData(
+                SecurityOriginDB::RESULT_ALLOW_ONCE);
+            m_securityOriginDAO->removeSecurityOriginData(
+                SecurityOriginDB::RESULT_DENY_ONCE);
+        }
+        return m_securityOriginDAO.get();
+    }
+};
+
+SecurityOriginSupport::SecurityOriginSupport(WidgetModel* widgetModel) :
+    m_impl(new SecurityOriginSupportImplementation(widgetModel))
+{}
+
+SecurityOriginSupport::~SecurityOriginSupport()
+{}
+
+SecurityOriginDB::SecurityOriginDAO* SecurityOriginSupport::
+    getSecurityOriginDAO(void)
+{
+    return m_impl->getSecurityOriginDAO();
+}
+
+} // namespace ViewModule
diff --git a/src/view/common/view_logic_security_origin_support.h b/src/view/common/view_logic_security_origin_support.h
new file mode 100755 (executable)
index 0000000..f658b81
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_security_origin_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ * @brief   Header file for security origin
+ */
+
+#ifndef VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_H_
+#define VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_H_
+
+#include <memory>
+
+class WidgetModel;
+namespace SecurityOriginDB {
+class SecurityOriginDAO;
+}
+
+namespace ViewModule {
+class SecurityOriginSupportImplementation;
+
+class SecurityOriginSupport
+{
+  public:
+    SecurityOriginSupport(WidgetModel* widgetModel);
+    virtual ~SecurityOriginSupport();
+    SecurityOriginDB::SecurityOriginDAO* getSecurityOriginDAO();
+
+  private:
+    std::unique_ptr<SecurityOriginSupportImplementation> m_impl;
+};
+
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_H_
diff --git a/src/view/common/view_logic_security_origin_support_util.cpp b/src/view/common/view_logic_security_origin_support_util.cpp
new file mode 100644 (file)
index 0000000..840e380
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_security_origin_support_util.cpp
+ * @author  Adam Banasiak (a.banasiak@samsung.com)
+ * @version 1.0
+ * @brief   Support security origin utility
+ */
+
+#include "view_logic_security_origin_support_util.h"
+
+#include <Evas.h>
+#include <Elementary.h>
+#include <efl_assist.h>
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/availability.h>
+#include <widget_string.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao.h>
+#include <common/view_logic_get_parent_window_util.h>
+
+namespace ViewModule {
+
+namespace {
+const double MAX_POPUP_HEIGHT = 0.80;
+const double MAX_SCROLLER_HEIGHT = 0.5;
+
+struct CallbackData {
+    Evas_Smart_Cb eaKeyCallback;
+};
+
+static void resizeCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo);
+
+static void deleteCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(e);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    CallbackData* callbackData = static_cast<CallbackData*>(data);
+    Assert(obj);
+    if (callbackData) {
+        ea_object_event_callback_del(obj, EA_CALLBACK_BACK, callbackData->eaKeyCallback);
+        delete callbackData;
+    }
+    evas_object_event_callback_del(obj, EVAS_CALLBACK_RESIZE, resizeCallback);
+}
+static void resizeCallback(void* data, Evas* e, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(data);
+    DPL_UNUSED_PARAM(e);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    Assert(obj);
+    Evas_Object* popup = obj;
+    int popupH;
+    evas_object_geometry_get(popup, 0, 0, 0, &popupH);
+
+    Evas_Object* parent = PopupUtil::getParentWindow(popup);
+    int parentW, parentH;
+    evas_object_geometry_get(parent, 0, 0, &parentW, &parentH);
+
+    // compare current popup height with screen height.
+    // To avoid popup is filled full screen, used magic number to be filled 80% of screen height.
+    // TODO: Automatically add scroller feature should implement in the elementary
+    double threshold = parentH * MAX_POPUP_HEIGHT;
+    double currentH = popupH;
+    if (threshold < currentH) {
+        WrtLogD("text is overflow popup height. add scroller");
+        Evas_Object* layout = elm_object_content_get(obj);
+        Evas_Object* label = elm_object_part_content_get(layout, "elm.swallow.label");
+
+        Evas_Object* scroller = elm_scroller_add(layout);
+        elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_AUTO);
+        evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+        evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
+        elm_scroller_content_min_limit(scroller, EINA_TRUE, EINA_TRUE);
+        int scrollerHeight = parentW > parentH ? parentH : parentW;
+        evas_object_size_hint_max_set(scroller, -1, scrollerHeight * MAX_SCROLLER_HEIGHT);
+
+        elm_object_part_content_unset(layout, "elm.swallow.label");
+        elm_object_content_set(scroller, label);
+        elm_object_part_content_set(layout, "elm.swallow.label", scroller);
+        evas_object_show(layout);
+    }
+}
+} // anonymous namespace
+
+Evas_Object* SecurityOriginSupportUtil::createPopup(
+    Evas_Object* window,
+    const char* bodyText,
+    const char* checkText,
+    Evas_Smart_Cb buttonCallback,
+    Evas_Smart_Cb keyCallback,
+    void* data)
+{
+    WrtLogD("createPopup");
+    Evas_Object* parentWindow = PopupUtil::getParentWindow(window);
+    Evas_Object* popup = elm_popup_add(parentWindow);
+
+    CallbackData* callbackData = NULL;
+    if (keyCallback) {
+        callbackData = new CallbackData;
+        callbackData->eaKeyCallback = keyCallback;
+        ea_object_event_callback_add(popup, EA_CALLBACK_BACK, keyCallback, data);
+    }
+    evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, deleteCallback, static_cast<void*>(callbackData));
+    evas_object_event_callback_add(popup, EVAS_CALLBACK_RESIZE, resizeCallback, NULL);
+
+    elm_object_style_set(popup, "popup/default");
+    evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(popup, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+    Evas_Object* layout = elm_layout_add(popup);
+    elm_layout_file_set(layout, WRT_EDJ_PATH, "popupWithCheck");
+    evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+    Evas_Object* label = elm_label_add(popup);
+    elm_label_line_wrap_set(label, ELM_WRAP_WORD);
+    elm_object_domain_translatable_part_text_set(label, 0, "wrt", bodyText);
+    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);
+
+    Evas_Object* check = elm_check_add(layout);
+#if USE(EFL_LITE)
+    elm_object_style_set(check, "popup");
+#else
+    elm_object_style_set(check, "multiline");
+#endif
+    elm_object_domain_translatable_part_text_set(check, 0, "wrt", checkText);
+
+    elm_object_part_content_set(layout, "elm.swallow.label", label);
+    elm_object_part_content_set(layout, "elm.swallow.checkbox", check);
+    elm_object_content_set(popup, layout);
+
+    Evas_Object* btn1 = elm_button_add(popup);
+    elm_object_style_set(btn1, "popup");
+    elm_object_domain_translatable_part_text_set(btn1, 0, "wrt", "IDS_COM_BODY_DENY");
+    elm_object_part_content_set(popup, "button1", btn1);
+    evas_object_smart_callback_add(btn1, "clicked", buttonCallback, data);
+    Evas_Object* btn2 = elm_button_add(popup);
+    elm_object_style_set(btn2, "popup");
+    elm_object_domain_translatable_part_text_set(btn2, 0, "wrt", "IDS_BR_OPT_ALLOW");
+    elm_object_part_content_set(popup, "button2", btn2);
+    evas_object_smart_callback_add(btn2, "clicked", buttonCallback, data);
+    return popup;
+}
+
+Evas_Object* SecurityOriginSupportUtil::getPopup(Evas_Object* button)
+{
+    Assert(button);
+
+    Evas_Object* popup = button;
+    while (strcmp(elm_object_widget_type_get(popup), "elm_popup")) {
+        popup = elm_object_parent_widget_get(popup);
+        if (!popup) {
+            return NULL;
+        }
+    }
+    return popup;
+}
+
+Evas_Object* SecurityOriginSupportUtil::getCheck(Evas_Object* popup)
+{
+    Assert(popup);
+    if (strcmp(elm_object_widget_type_get(popup), "elm_popup")) {
+        return NULL;
+    }
+    Evas_Object* check = elm_object_part_content_get(
+            elm_object_content_get(popup),
+            "elm.swallow.checkbox");
+    return check;
+}
+
+SecurityOriginDB::Result SecurityOriginSupportUtil::getResult(
+    Evas_Object* button)
+{
+    using namespace SecurityOriginDB;
+
+    Assert(button);
+    // get popup evas_object
+    Evas_Object* popup = getPopup(button);
+    if (popup == NULL) {
+        return RESULT_UNKNOWN;
+    }
+    bool allow = !strcmp(WRT_OPT_ALLOW, elm_object_text_get(button));
+
+    // get check evas_object
+    Evas_Object* check = getCheck(popup);
+    if (check == NULL) {
+        return RESULT_UNKNOWN;
+    }
+    if (allow) {
+        return elm_check_state_get(check) ? RESULT_ALLOW_ALWAYS :
+               RESULT_ALLOW_ONCE;
+    } else {
+        return elm_check_state_get(check) ? RESULT_DENY_ALWAYS :
+               RESULT_DENY_ONCE;
+    }
+}
+
+bool SecurityOriginSupportUtil::isNeedHelpPopup(Evas_Object* popup)
+{
+    Assert(popup);
+
+    if (strcmp(elm_object_widget_type_get(popup), "elm_popup")) {
+        return false;
+    }
+    Evas_Object* check = getCheck(popup);
+    if (check && elm_check_state_get(check)) {
+        return true;
+    }
+    return false;
+}
+
+} // namespace ViewModule
diff --git a/src/view/common/view_logic_security_origin_support_util.h b/src/view/common/view_logic_security_origin_support_util.h
new file mode 100644 (file)
index 0000000..2b39072
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_security_origin_support_util.h
+ * @author  Adam Banasiak (a.banasiak@samsung.com)
+ * @version 1.0
+ * @brief   Header file for security origin utility
+ */
+
+#ifndef VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_UTILITY_H
+#define VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_UTILITY_H
+
+#include <Evas.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao.h>
+#include <dpl/string.h>
+
+namespace ViewModule {
+namespace SecurityOriginSupportUtil {
+class PermissionData
+{
+  public:
+    SecurityOriginDB::SecurityOriginDAO* m_originDao;
+    SecurityOriginDB::SecurityOriginData m_originData;
+    void* m_data;
+    DPL::String m_pkgId;
+
+    PermissionData(
+        SecurityOriginDB::SecurityOriginDAO* originDao,
+        SecurityOriginDB::SecurityOriginData originData,
+        void* data) :
+        m_originDao(originDao),
+        m_originData(originData),
+        m_data(data)
+    {}
+
+    PermissionData(
+        SecurityOriginDB::SecurityOriginDAO* originDao,
+        SecurityOriginDB::SecurityOriginData originData,
+        void* data,
+        DPL::String& pkgId):
+        m_originDao(originDao),
+        m_originData(originData),
+        m_data(data),
+        m_pkgId(pkgId)
+    {}
+};
+
+Evas_Object* createPopup(Evas_Object* window,
+                         const char* bodyText,
+                         const char* checkText,
+                         Evas_Smart_Cb buttonCallback,
+                         Evas_Smart_Cb keyCallback,
+                         void* data);
+Evas_Object* getPopup(Evas_Object* button);
+Evas_Object* getCheck(Evas_Object* popup);
+SecurityOriginDB::Result getResult(Evas_Object* button);
+bool isNeedHelpPopup(Evas_Object* popup);
+}  // namespace SecurityOriginSupportUtil
+}  // namespace ViewModule
+
+
+#endif /* VIEW_LOGIC_SECURITY_ORIGIN_SUPPORT_UTILITY_H */
+
diff --git a/src/view/common/view_logic_security_support.cpp b/src/view/common/view_logic_security_support.cpp
new file mode 100644 (file)
index 0000000..c6f1db3
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_keys_support.cpp
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @brief   Implementation file of SecuritySupport API used by ViewLogic
+ */
+
+#include "view_logic_security_support.h"
+#include <string>
+#include <dpl/string.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <ace_api_client.h>
+#include <dpl/utils/warp_iri.h>
+#include <widget_data_types.h>
+
+namespace ViewModule {
+namespace SecuritySupport {
+namespace {
+const char *GEOLOCATION_DEV_CAP = "geolocation.position";
+const char *GEOLOCATION_PARAM_NAME = "param:enableHighAccuracy";
+const char *GEOLOCATION_PARAM_VALUE = "true";
+
+bool simpleAceCheck(
+    const DPL::String& tizenId,
+    const char *devCap,
+    const char *paramName,
+    const char *paramValue)
+{
+    WrtDB::WidgetDAOReadOnly dao(tizenId);
+    ace_request_t aceRequest;
+    aceRequest.widget_handle = dao.getHandle();
+    aceRequest.session_id = const_cast<const ace_string_t>("");
+    aceRequest.feature_list.count = 0;
+    aceRequest.dev_cap_list.count = 1;
+    aceRequest.dev_cap_list.items = new ace_dev_cap_t[1];
+    aceRequest.dev_cap_list.items[0].name =
+        const_cast<ace_string_t>(devCap);
+
+    aceRequest.dev_cap_list.items[0].param_list.count = paramName ? 1 : 0;
+    aceRequest.dev_cap_list.items[0].param_list.items = NULL;
+
+    if (paramName) {
+        aceRequest.dev_cap_list.items[0].param_list.items = new ace_param_t[1];
+        aceRequest.dev_cap_list.items[0].param_list.items[0].name =
+            const_cast<ace_string_t>(paramName);
+        aceRequest.dev_cap_list.items[0].param_list.items[0].value =
+            const_cast<ace_string_t>(paramValue);
+    }
+
+    WrtLogD("Making ace check with new C-API");
+    ace_check_result_t result = ACE_PRIVILEGE_DENIED;
+    ace_return_t ret = ace_check_access_ex(&aceRequest, &result);
+
+    WrtLogD("Result is: %d", static_cast<int>(result));
+
+    delete[] aceRequest.dev_cap_list.items[0].param_list.items;
+    delete[] aceRequest.dev_cap_list.items;
+
+    return ACE_OK == ret && ACE_ACCESS_GRANTED == result;
+}
+} //TODO copied from view_logic.cpp
+
+bool geolocationACECheck(const DPL::String& tizenId, bool highAccuracy)
+{
+    const char *paramName = NULL;
+    const char *paramValue = NULL;
+    if (highAccuracy) {
+        paramName = GEOLOCATION_PARAM_NAME;
+        paramValue = GEOLOCATION_PARAM_VALUE;
+    }
+    return simpleAceCheck(
+               tizenId,
+               GEOLOCATION_DEV_CAP,
+               paramName,
+               paramValue);
+}
+} // namespace SecuritySupport
+} //namespace ViewModule
diff --git a/src/view/common/view_logic_security_support.h b/src/view/common/view_logic_security_support.h
new file mode 100644 (file)
index 0000000..bcf0e66
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_security_support.h
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @brief   Header file of SecuritySupport API used by ViewLogic
+ */
+
+#ifndef VIEW_LOGIC_SECURITY_SUPPORT_H_
+#define VIEW_LOGIC_SECURITY_SUPPORT_H_
+
+#include <string>
+#include <dpl/string.h>
+
+//Forward declaration
+class WidgetModel;
+
+namespace ViewModule {
+namespace SecuritySupport {
+char const * const PARAM_URL = "param:url";
+bool geolocationACECheck(const DPL::String& tizenId, bool highAccuracy);
+} // namespace SecuritySupport
+} // namespace ViewModule
+
+#endif /* VIEW_LOGIC_SECURITY_SUPPORT_H_ */
diff --git a/src/view/common/view_logic_storage_support.cpp b/src/view/common/view_logic_storage_support.cpp
new file mode 100644 (file)
index 0000000..3136003
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_storage_support.cpp
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @brief   Implementation file of StorageSupport API used by ViewLogic
+ */
+#include "view_logic_storage_support.h"
+
+#include <string>
+#include <ftw.h>
+
+#include <dpl/assert.h>
+#include <dpl/exception.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/string.h>
+#include <widget_model.h>
+#include <boost/filesystem.hpp>
+
+namespace bf = boost::filesystem;
+
+namespace ViewModule {
+namespace StorageSupport {
+namespace { //anonymous
+const bf::perms TEMPORARY_STORAGE_MODE = bf::owner_all;
+static bool rootDirectory = true;
+
+static int removeFile(const char* path, const struct stat* /*sb*/, int tflag)
+{
+    if (path == NULL) {
+        WrtLogE("Wrong input path");
+        return 0;
+    }
+    WrtLogD("%s",path);
+    bf::path inputPath(path);
+
+    if (rootDirectory) {
+        WrtLogD("Skip root directory");
+        rootDirectory = false;
+        return 0;
+    }
+
+    if (tflag == FTW_F || tflag == FTW_D) {
+        try {
+            bf::remove_all(inputPath);
+        } catch (const bf::filesystem_error& ex) {
+            WrtLogE("Fail to remove! %s", ex.what());
+        }
+    } else if (tflag == FTW_DNR) {
+        WrtLogE("This is directory which can't be read");
+    } else if (tflag == FTW_NS) {
+        WrtLogE("Unknow error");
+    }
+    return 0;
+}
+
+bool removeDirectory(const char* path)
+{
+    rootDirectory = true;
+    if (ftw(path, removeFile, 20) != 0) {
+        return false;
+    }
+    return true;
+}
+}
+
+void initializeStorage(WidgetModel *widgetModel)
+{
+    WrtLogD("initializeStorage");
+    AssertMsg(widgetModel, "Passed widgetModel is NULL!");
+
+    // create temporary storage
+    bf::path path(DPL::ToUTF8String(widgetModel->TemporaryStoragePath.Get()));
+    if (!bf::is_directory(path)) {
+        try {
+            bf::create_directories(path);
+            bf::permissions(path,TEMPORARY_STORAGE_MODE);
+        } catch (const bf::filesystem_error& ex) {
+            WrtLogE("boost::filesystem::error: %s",ex.what());
+            ThrowMsg(DPL::CommonException::InternalError,
+                     "Fail to initialize temporary storage");
+        }
+    } else {
+        if (!removeDirectory(path.c_str())) {
+            WrtLogE("Failed to clean temporary storage");
+        }
+    }
+}
+
+void deinitializeStorage(WidgetModel *widgetModel)
+{
+    WrtLogD("deinitializeStorage");
+    AssertMsg(widgetModel, "Passed widgetModel is NULL!");
+
+    // clean-up temporary storage
+    std::string path =
+        DPL::ToUTF8String(widgetModel->TemporaryStoragePath.Get());
+    if (!removeDirectory(path.c_str())) {
+        WrtLogE("Fail to deinitialize temporary storage");
+    }
+}
+} // namespace StorageSupport
+} // namespace ViewModule
diff --git a/src/view/common/view_logic_storage_support.h b/src/view/common/view_logic_storage_support.h
new file mode 100644 (file)
index 0000000..c7c9eb1
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_storage_support.h
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @brief   Header file of StorageSupport API used by ViewLogic
+ */
+
+#ifndef VIEW_LOGIC_STORAGE_SUPPORT_H_
+#define VIEW_LOGIC_STORAGE_SUPPORT_H_
+
+//Forward declaration
+class WidgetModel;
+
+namespace ViewModule {
+namespace StorageSupport {
+void initializeStorage(WidgetModel *widgetModel);
+void deinitializeStorage(WidgetModel *widgetModel);
+} // namespace StorageSupport
+} // namespace ViewModule
+
+#endif /* VIEW_LOGIC_STORAGE_SUPPORT_H_ */
diff --git a/src/view/common/view_logic_uri_support.cpp b/src/view/common/view_logic_uri_support.cpp
new file mode 100644 (file)
index 0000000..30d99fc
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_uri_support.cpp
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @brief   Implementation file of UriSupport API used by ViewLogic
+ */
+
+#include "view_logic_uri_support.h"
+
+#include <list>
+#include <memory>
+#include <string>
+#include <vector>
+#include <stdio.h>
+
+#include <appsvc.h>
+#include <aul.h>
+#include <bundle.h>
+#include <dpl/localization/w3c_file_localization.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/platform.h>
+#include <dpl/string.h>
+#include <iri.h>
+#include <pcrecpp.h>
+#include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
+#include <wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h>
+
+#include <widget_model.h>
+#include <application_data.h>
+
+namespace ViewModule {
+namespace UriSupport {
+namespace {
+struct AppControlCompareData {
+std::string operation;
+std::string uri;
+std::string scheme;
+std::string mime;
+};
+enum ServiceDataType
+{
+    APP_CONTROL_DATA_TYPE_OPERATION,
+    APP_CONTROL_DATA_TYPE_URI,
+    APP_CONTROL_DATA_TYPE_URI_SCHEME,
+    APP_CONTROL_DATA_TYPE_MIME
+};
+
+#if ENABLE(APP_SCHEME)
+char const * const SCHEME_TYPE_APP = "app";
+#endif
+char const * const SCHEME_TYPE_FILE = "file";
+char const * const SCHEME_TYPE_HTTP = "http";
+char const * const SCHEME_TYPE_HTTPS = "https";
+char const * const SCHEME_TYPE_WIDGET = "widget";
+const char * const SCHEME_TYPE_FILE_SLASH = "file://";
+
+bool wildcardCompare(const std::string& wildcardString, const std::string& target)
+{
+    std::string re = wildcardString;
+
+    // replace special character to meaning character
+    pcrecpp::RE("\\\\").GlobalReplace("\\\\\\\\", &re);
+    pcrecpp::RE("\\.").GlobalReplace("\\\\.", &re);
+    pcrecpp::RE("\\+").GlobalReplace("\\\\+", &re);
+    pcrecpp::RE("\\?").GlobalReplace("\\\\?", &re);
+    pcrecpp::RE("\\^").GlobalReplace("\\\\^", &re);
+    pcrecpp::RE("\\$").GlobalReplace("\\\\$", &re);
+    pcrecpp::RE("\\[").GlobalReplace("\\\\[", &re);
+    pcrecpp::RE("\\]").GlobalReplace("\\\\]", &re);
+    pcrecpp::RE("\\{").GlobalReplace("\\\\{", &re);
+    pcrecpp::RE("\\}").GlobalReplace("\\\\}", &re);
+    pcrecpp::RE("\\(").GlobalReplace("\\\\(", &re);
+    pcrecpp::RE("\\)").GlobalReplace("\\\\)", &re);
+    pcrecpp::RE("\\|").GlobalReplace("\\\\|", &re);
+
+    // replace wildcard character to regex type
+    pcrecpp::RE("\\*").GlobalReplace(".*", &re);
+
+    return pcrecpp::RE(re).FullMatch(target);
+}
+
+bool compareServiceData(ServiceDataType type,
+                        std::string origin,
+                        std::string other)
+{
+    if (APP_CONTROL_DATA_TYPE_OPERATION == type)
+    {
+        return origin == other;
+    }
+    else if (APP_CONTROL_DATA_TYPE_URI == type)
+    {
+        return wildcardCompare(origin, other);
+    }
+    else if (APP_CONTROL_DATA_TYPE_URI_SCHEME == type)
+    {
+        return origin == other;
+    }
+    else if (APP_CONTROL_DATA_TYPE_MIME == type)
+    {
+        return wildcardCompare(origin, other);
+    }
+    else
+    {
+        WrtLogE("Wrong data type");
+        return false;
+    }
+}
+
+std::string getAppControlSrc(
+    WrtDB::WidgetAppControlList appControlLost,
+    AppControlCompareData data)
+{
+    WrtLogD(" - operation : %s", data.operation.c_str());
+    WrtLogD(" - uri       : %s", data.uri.c_str());
+    WrtLogD(" - scheme    : %s", data.scheme.c_str());
+    WrtLogD(" - mimetype  : %s", data.mime.c_str());
+
+    FOREACH(appControlIt, appControlLost)
+    {
+        if (compareServiceData(APP_CONTROL_DATA_TYPE_OPERATION, DPL::ToUTF8String(appControlIt->operation), data.operation))
+        {
+            if (compareServiceData(APP_CONTROL_DATA_TYPE_URI_SCHEME, DPL::ToUTF8String(appControlIt->uri), data.scheme) ||
+                compareServiceData(APP_CONTROL_DATA_TYPE_URI, DPL::ToUTF8String(appControlIt->uri), data.uri) )
+            {
+                if (compareServiceData(APP_CONTROL_DATA_TYPE_MIME, DPL::ToUTF8String(appControlIt->mime), data.mime))
+                {
+                    WrtLogD("Matched with : %ls", appControlIt->src.c_str());
+                    WrtLogD(" - operation : %ls", appControlIt->operation.c_str());
+                    WrtLogD(" - uri       : %ls", appControlIt->uri.c_str());
+                    WrtLogD(" - mimetype  : %ls", appControlIt->mime.c_str());
+                    return DPL::ToUTF8String(appControlIt->src);
+                }
+            }
+        }
+    }
+    return std::string();
+}
+
+}
+
+std::string prepareUrl(const std::string &url, const std::string &insert)
+{
+    std::string urlFixed = url;
+    if (urlFixed.find("file://") == 0) {
+        urlFixed.erase(0, 6);
+    }
+    //replace %s in url with given from appservice
+    int size = snprintf(NULL, 0, urlFixed.c_str(), insert.c_str()) + 1;
+    char buffer[size];
+    snprintf(buffer, size, urlFixed.c_str(), insert.c_str());
+    return std::string(buffer);
+}
+
+std::string getCustomHandlerProtocolUri(
+    WidgetModel *widgetModel,
+    const std::string &schemeType,
+    const std::string &schemeValue)
+{
+    CustomHandlerDB::Interface::attachDatabaseRO();
+    CustomHandlerDB::CustomHandlerDAOReadOnly handlersDao(widgetModel->TizenId);
+    CustomHandlerDB::CustomHandlerPtr handler =
+        handlersDao.getActivProtocolHandler(
+            DPL::FromASCIIString(schemeType));
+    CustomHandlerDB::Interface::detachDatabase();
+    if (handler) {
+        WrtLogD("Found handler, url: %ls", handler->url.c_str());
+        return prepareUrl(DPL::ToUTF8String(handler->base_url) +
+                          DPL::ToUTF8String(handler->url), schemeValue);
+    }
+    return "";
+}
+
+std::string getCustomHandlerContentUri(
+    WidgetModel *widgetModel,
+    const std::string &mime,
+    const std::string &mimeValue)
+{
+    CustomHandlerDB::Interface::attachDatabaseRO();
+    CustomHandlerDB::CustomHandlerDAOReadOnly handlersDao(widgetModel->TizenId);
+    CustomHandlerDB::CustomHandlerPtr handler =
+        handlersDao.getActivContentHandler(
+            DPL::FromASCIIString(mime));
+    CustomHandlerDB::Interface::detachDatabase();
+    if (handler) {
+        WrtLogD("Found handler, url: %ls", handler->url.c_str());
+        return prepareUrl(DPL::ToUTF8String(handler->base_url) +
+                          DPL::ToUTF8String(handler->url), mimeValue);
+    }
+    return "";
+}
+
+std::string getAppControlUri(bundle *bundle, WidgetModel *widgetModel)
+{
+    if (!bundle)
+    {
+        WrtLogE("Bundle is empty");
+        return std::string("");
+    }
+
+    AppControlCompareData data;
+    // get operation. Operation is mandatory.
+    const char* value = NULL;
+    value = appsvc_get_operation(bundle);
+    data.operation = value ? value : "";
+    // ignore operation is NULL case
+    if (data.operation.empty()) {
+        WrtLogD("Operation is NULL");
+        return std::string("");
+    }
+
+    // get mime
+    value = appsvc_get_mime(bundle);
+    data.mime = value ? value : "";
+
+    // get uri
+    value = appsvc_get_uri(bundle);
+    data.uri = value ? value : "";
+
+    WrtLogD("Passed AppControl data");
+    WrtLogD(" - operation : %s", data.operation.c_str());
+    WrtLogD(" - uri       : %s", data.uri.c_str());
+    WrtLogD(" - mimetype  : %s", data.mime.c_str());
+
+
+    // get scheme and mime
+    std::string originScheme = "";
+    std::string originPath = "";
+    if (!data.uri.empty()) {
+        std::unique_ptr<iri_t, decltype(&iri_destroy)> iri(iri_parse(data.uri.c_str()), iri_destroy);
+        if (!iri.get()) {
+            WrtLogD("Fail to get iri");
+            originScheme = "";
+            originPath = "";
+        }
+        if (iri->scheme) {
+            originScheme = iri->scheme;
+        }
+        if (iri->path) {
+            originPath = iri->path;
+        }
+
+        // checking condition that mime is empthy and uri is available
+        if (data.mime.empty() && !data.uri.empty()) {
+            // checking passed uri is local file
+            // case 1. uri = file:///xxxx
+            // case 2. uri = /xxxx
+            if (!data.scheme.empty() && data.scheme != SCHEME_TYPE_FILE) {
+                WrtLogD("Passed uri isn't local file");
+            } else {
+                const char* FILE_URI_CASE_1 = "/";
+                const char* FILE_URI_CASE_2 = "file:/";
+                const char* FILE_URI_CASE_3 = "file:///";
+
+                char mimetype[128] = {0,};
+                int ret = AUL_R_EINVAL;
+                const char* uri_c_str = data.uri.c_str();
+
+                if(strncmp(uri_c_str, FILE_URI_CASE_1, 1) == 0){
+                    ret = aul_get_mime_from_file(uri_c_str,
+                                                 mimetype,
+                                                 sizeof(mimetype));
+                } else if(strncmp(uri_c_str, FILE_URI_CASE_2, 6) == 0){
+                    ret = aul_get_mime_from_file(&uri_c_str[5],
+                                                 mimetype,
+                                                 sizeof(mimetype));
+                } else if(strncmp(uri_c_str, FILE_URI_CASE_3, 8) == 0){
+                    ret = aul_get_mime_from_file(&uri_c_str[7],
+                                                 mimetype,
+                                                 sizeof(mimetype));
+                }
+
+                if (AUL_R_OK == ret) {
+                    data.mime = mimetype;
+                }
+            }
+        }
+    }
+
+    WrtDB::WidgetAppControlList appControlList =
+        widgetModel->AppControlList.Get();
+    if (!appControlList.empty()) {
+        // case 0, operation only
+        // scheme =
+        // uri    =
+        if (data.uri.empty()) {
+            WrtLogD("AppControl case 0 (NULL, NULL)");
+            std::string src = getAppControlSrc(appControlList, data);
+            if (!src.empty()) {
+                return src;
+            }
+            return std::string();
+        }
+
+        // case 1
+        // scheme = nfc
+        // uri    = nfc:///xxx/xxx
+        if (!originScheme.empty()) {
+            data.scheme = originScheme;
+            WrtLogD("AppControl case 1 (file, file:///xxx/xxx)");
+            std::string src = getAppControlSrc(appControlList, data);
+            if (!src.empty()) {
+                return src;
+            }
+        }
+
+        // case 2
+        // scheme =
+        // uri    = file:///xxx/xxx
+        data.scheme = "";
+        WrtLogD("AppControl case 2 (NULL, file:///xxx/xxx)");
+        std::string src = getAppControlSrc(appControlList, data);
+        if (!src.empty()) {
+            return src;
+        }
+
+        // case 3
+        // scheme = file
+        // uri    = /xxx/xxx
+        if (!originScheme.empty() && !originPath.empty()) {
+            data.scheme = originScheme;
+            data.uri = originPath;
+            WrtLogD("AppControl case 3 (file, /xxx/xxx)");
+            std::string src = getAppControlSrc(appControlList, data);
+            if (!src.empty()) {
+                return src;
+            }
+        }
+
+        // case 4
+        // scheme =
+        // uri    = /xxx/xxx
+        if (!originPath.empty()) {
+            data.scheme = "";
+            data.uri = originPath;
+            WrtLogD("AppControl case 4 (NULL, /xxx/xxx)");
+            std::string src = getAppControlSrc(appControlList, data);
+            if (!src.empty()) {
+                return src;
+            }
+        }
+    }
+
+    if (!originScheme.empty()) {
+        WrtLogD("Scheme parts: %s, %s", originScheme.c_str(), originPath.c_str());
+        return getCustomHandlerProtocolUri(
+                   widgetModel, originScheme, originPath);
+    }
+    if (data.mime != "") {
+        value = appsvc_get_data(bundle, APPSVC_DATA_SELECTED);
+        if (value != NULL) {
+            WrtLogD("Use mime type for: %s", value);
+            return getCustomHandlerContentUri(
+                       widgetModel, data.mime, std::string(value));
+        } else {
+            WrtLogE("Selected file for mime is null, nothind to do");
+        }
+    }
+    WrtLogD("no matching result");
+    return std::string("");
+}
+
+std::string getUri(WidgetModel *widgetModel, const std::string &defaultUri, bool* isSelfTarget)
+{
+    DPL::String uri;
+    std::string startUri;
+    WrtLogD("default uri: %s", defaultUri.c_str());
+    bundle *originBundle = ApplicationDataSingleton::Instance().getBundle(DPL::ToUTF8String(widgetModel->TizenId));
+
+    // search app-control data
+    startUri = getAppControlUri(originBundle, widgetModel).c_str();
+    WrtLogD("app-control start uri is %s", startUri.c_str());
+    if (startUri == "") {
+        WrtLogD("app-control data doesn't have matched data");
+        startUri = defaultUri;
+    } else if (startUri == SELF_TARGET) {
+        startUri = defaultUri;
+        if (isSelfTarget) {
+            *isSelfTarget = true;
+        }
+    }
+
+    // insert prefix path
+    std::string preFix = DPL::ToUTF8String(widgetModel->PrefixURL.Get());
+    if (strstr(startUri.c_str(), SCHEME_TYPE_HTTP) == startUri.c_str() ||
+        strstr(startUri.c_str(), SCHEME_TYPE_HTTPS) == startUri.c_str() ||
+        strstr(startUri.c_str(), preFix.c_str()) == startUri.c_str())
+    {
+        return startUri;
+    } else {
+        return preFix + startUri;
+    }
+}
+
+DPL::OptionalString localizeURI(const DPL::String& inputURI,
+                                const WidgetModel* model)
+{
+    auto uri = DPL::ToUTF8String(inputURI);
+    WrtLogD("localizing url: %s", uri.c_str());
+
+    auto urlcstr = uri.c_str();
+
+    const char *end = strstr(urlcstr, ":");
+    if (!end) {
+        WrtLogD("no schema in link, return null");
+        // lack of schema
+        return DPL::OptionalString();
+    }
+
+    std::string scheme(urlcstr, end);
+#if ENABLE(APP_SCHEME)
+    if (scheme != SCHEME_TYPE_WIDGET && scheme != SCHEME_TYPE_FILE && scheme != SCHEME_TYPE_APP) {
+#else
+    if (scheme != SCHEME_TYPE_WIDGET && scheme != SCHEME_TYPE_FILE) {
+#endif
+        WrtLogD("scheme doesn't need to localize");
+        return DPL::OptionalString(inputURI);
+    }
+
+    DPL::OptionalString found =
+        W3CFileLocalization::getFilePathInWidgetPackageFromUrl(
+            model->TizenId,
+            DPL::FromUTF8String(uri));
+
+    if (!found) {
+        // In this case, path doesn't need to localize. return input uri
+        WrtLogD("Path not found within current locale in current widget");
+        return DPL::OptionalString(inputURI);
+    } else {
+        DPL::String uri(L"file://" + *found);
+        WrtLogD("Will load resource: %ls", uri.c_str());
+        WrtLogD("finished");
+        return DPL::OptionalString(uri);
+    }
+}
+} // namespace UriSupportImplementation
+} // namespace ViewModule
diff --git a/src/view/common/view_logic_uri_support.h b/src/view/common/view_logic_uri_support.h
new file mode 100644 (file)
index 0000000..4d64de5
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_uri_support.h
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @brief   Header file of UriSupport API used by ViewLogic
+ */
+
+#ifndef VIEW_LOGIC_URI_SUPPORT_H_
+#define VIEW_LOGIC_URI_SUPPORT_H_
+
+#include <string>
+#include <dpl/string.h>
+#include <dpl/optional_typedefs.h>
+
+// Forward declare
+class WidgetModel;
+
+namespace {
+// Special key for supporting app-control service base on event
+const char* const SELF_TARGET = "_self";
+}
+
+namespace ViewModule {
+namespace UriSupport {
+
+std::string getUri(WidgetModel *widgetModel, const std::string &defaultUri, bool* isSelfTarget=NULL);
+DPL::OptionalString localizeURI(const DPL::String& inputURI,
+                                const WidgetModel* model);
+} // namespace UriSupport
+} // namespace ViewModule
+
+#endif /* VIEW_LOGIC_URI_SUPPORT_H_ */
diff --git a/src/view/common/view_logic_vibration_support.cpp b/src/view/common/view_logic_vibration_support.cpp
new file mode 100644 (file)
index 0000000..a1b728c
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_vibration_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "view_logic_vibration_support.h"
+#include <dpl/log/wrt_log.h>
+
+namespace ViewModule {
+VibrationSupport::VibrationSupport() : m_initialized(false),
+    m_handle(NULL),
+    m_effect_handle(NULL)
+{}
+
+VibrationSupport::~VibrationSupport()
+{}
+
+void VibrationSupport::initialize(void)
+{
+    WrtLogD("initialize");
+    initializeVibration();
+}
+
+void VibrationSupport::deinitialize(void)
+{
+    WrtLogD("deinitialize");
+
+    if (m_initialized) {
+        int ret = haptic_close(m_handle);
+
+        if (HAPTIC_ERROR_NONE == ret) {
+            m_initialized = false;
+            WrtLogD("deinitialize success");
+        } else {
+            m_initialized = true;
+            WrtLogD("deinitialize failed - error code : %d", ret);
+        }
+    }
+}
+
+void VibrationSupport::startVibration(const long vibrationTime)
+{
+    WrtLogD("startVibration called");
+
+    if (m_initialized == false) {
+        if (initializeVibration() == false) {
+            return;
+        }
+    }
+
+    int time = static_cast<int>(vibrationTime);
+    int ret = haptic_vibrate_monotone(m_handle, time, &m_effect_handle);
+
+    if (HAPTIC_ERROR_NONE == ret) {
+        WrtLogD("haptic_vibrate_monotone success");
+    } else {
+        WrtLogD("haptic_vibrate_monotone failed - error code : %d", ret);
+    }
+
+    return;
+}
+
+void VibrationSupport::stopVibration(void)
+{
+    WrtLogD("stopVibration called");
+
+    if (m_initialized == false) {
+        if (initializeVibration() == false) {
+            return;
+        }
+    }
+
+    int ret = haptic_stop_all_effects(m_handle);
+
+    if (HAPTIC_ERROR_NONE == ret) {
+        WrtLogD("haptic_stop_all_effects success");
+    } else {
+        WrtLogD("haptic_stop_all_effects failed - error code : %d", ret);
+    }
+
+    return;
+}
+
+bool VibrationSupport::initializeVibration(void)
+{
+    WrtLogD("initializeVibration called");
+
+    if (m_initialized == false) {
+        haptic_device_h handle = NULL;
+        int ret = haptic_open(HAPTIC_DEVICE_0, &handle);
+
+        if (ret == HAPTIC_ERROR_NONE) {
+            WrtLogD("initializeVibration success");
+            m_initialized = true;
+            m_handle = handle;
+        } else {
+            WrtLogD("initializeVibration failed - error code : %d", ret);
+            m_initialized = false;
+            m_handle = NULL;
+        }
+    }
+
+    return m_initialized;
+}
+} // namespace ViewModule
diff --git a/src/view/common/view_logic_vibration_support.h b/src/view/common/view_logic_vibration_support.h
new file mode 100644 (file)
index 0000000..0a99e32
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_vibration_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_VIBRATION_SUPPORT_H_
+#define VIEW_LOGIC_VIBRATION_SUPPORT_H_
+
+#include <dd-haptic.h>
+
+namespace ViewModule {
+class VibrationSupport
+{
+  public:
+    VibrationSupport();
+    virtual ~VibrationSupport();
+
+    void initialize();
+    void deinitialize();
+    void startVibration(const long vibrationTime);
+    void stopVibration(void);
+
+  private:
+    bool m_initialized;
+    haptic_device_h m_handle;
+    haptic_effect_h m_effect_handle;
+
+    bool initializeVibration(void);
+};
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_VIBRATION_SUPPORT_H_
diff --git a/src/view/context_manager.cpp b/src/view/context_manager.cpp
new file mode 100644 (file)
index 0000000..6465bf7
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    context_manager.cpp
+ * @author  Andrzej Surdej (a.surdej@samsung.com)
+ * @version 1.0
+ * @brief   context getter function implementation
+ */
+
+#include "i_context_manager.h"
+#include <ewk_context_manager.h>
+
+namespace ViewModule {
+
+ContextManagerPtr contextManagerFactoryMethod(
+        const std::string& id,
+        Ewk_Context* c,
+        IViewModulePtr view)
+{
+    ContextManagerPtr ptr (new EwkContextManager(id, c, view));
+    return ptr;
+}
+
+ContextManagerFactoryMethod makeContextManagerFactoryMethod()
+{
+    return contextManagerFactoryMethod;
+}
+
+} // namespace ViewModule
diff --git a/src/view/i_context_manager.h b/src/view/i_context_manager.h
new file mode 100644 (file)
index 0000000..8700b90
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    i_context_manager.h
+ * @author  Iwanek Tomasz (t.iwanek@samsung.com)
+ * @version 0.1
+ * @brief   Abstract file for handling operation regarding Ewk_Context.
+ */
+
+#ifndef ABSTRACT_CONTEXT_MANAGER_H
+#define ABSTRACT_CONTEXT_MANAGER_H
+
+#include <memory>
+#include <functional>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+#include <i_view_module.h>
+
+namespace ViewModule {
+
+class IContextManager;
+typedef std::shared_ptr<IContextManager> ContextManagerPtr;
+
+typedef std::function<ContextManagerPtr (const std::string&, Ewk_Context*, ViewModule::IViewModulePtr)> ContextManagerFactoryMethod;
+
+/**
+ * @brief The AbstractContextManager class Factory for ewk context
+ *
+ * This is interface class for ewk context factory.
+ * It's uses tizenId, view module to initialize it approriatly context.
+ *
+ * Constructor should create new context only if ewkContext parameter is NULL.
+ * If ewkContext parameter is not NULL, context should not be destroyed in destructor.
+ * This means used context is managed by manager only if was created internally.
+ *
+ * NOTE: This interface in not visible outside core module and it should not be.
+ *       Reason for this code is not modify RunnableWidgetObject behaviour for mocks.
+ */
+class IContextManager {
+public:
+    IContextManager(
+            const std::string& tizenAppId,
+            Ewk_Context* ewkContext,
+            ViewModule::IViewModulePtr viewModule) :
+            m_appId(tizenAppId), m_ewkContext(ewkContext), m_view(viewModule) {}
+    virtual ~IContextManager() {}
+    /**
+     * @brief getEwkContext returns ewk context
+     * @return ewk context
+     */
+    virtual Ewk_Context* getEwkContext() const = 0;
+    /**
+     * @brief handleLowMemory
+     *
+     * Handles low memory conditions
+     */
+    virtual void handleLowMemory() = 0;
+protected:
+    std::string m_appId;
+    Ewk_Context* m_ewkContext;
+    IViewModulePtr m_view;
+};
+
+ContextManagerPtr contextManagerFactoryMethod(const std::string& id, Ewk_Context* c, IViewModulePtr view);
+
+ContextManagerFactoryMethod makeContextManagerFactoryMethod();
+
+} // namespace ViewModule
+
+#endif // ABSTRACT_CONTEXT_MANAGER_H
diff --git a/src/view/i_view_module.h b/src/view/i_view_module.h
new file mode 100644 (file)
index 0000000..91720c5
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    i_view_module.h
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @version 1.0
+ * @brief   Interface for ViewModule
+ */
+
+#ifndef WRT_SRC_VIEW_I_VIEW_MODULE_H_
+#define WRT_SRC_VIEW_I_VIEW_MODULE_H_
+
+#include <memory>
+#include <string>
+#include <common/evas_object.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <user_delegates.h>
+
+class WidgetModel; //FORWARD DECLARATION
+namespace ViewModule {
+/** \brief Interface to ViewModule. Object of IViewModule type is returned from
+ *  ViewModuleMgr factory.
+ */
+class IViewModule
+{
+  public:
+    virtual bool createWebView(Ewk_Context* context,
+                               Evas_Object* window) = 0;
+    virtual void prepareView(WidgetModel *, const std::string &) = 0;
+    virtual void showWidget() = 0;
+    virtual void hideWidget() = 0;
+    virtual void suspendWidget() = 0;
+    virtual void resumeWidget() = 0;
+    virtual void setWidgetUrl(const std::string &startUrl) = 0;
+    virtual void resetWidgetFromSuspend() = 0;
+    virtual void resetWidgetFromResume() = 0;
+    virtual void backward() = 0;
+    virtual void reloadStartPage() = 0;
+    virtual Evas_Object* getCurrentWebview() = 0;
+    virtual void fireJavascriptEvent(int event, void* data) = 0;
+    virtual void setUserCallbacks(const WRT::UserDelegatesPtr& cbs) = 0;
+    virtual void checkSyncMessageFromBundle(
+            const char* name,
+            const char* body,
+            char** returnData) = 0;
+    virtual void checkAsyncMessageFromBundle(
+            const char* name,
+            const char* body) = 0;
+    virtual void downloadData(const char* url) = 0;
+    virtual void activateVibration(bool on, uint64_t time) = 0;
+};
+
+typedef std::shared_ptr<IViewModule> IViewModulePtr;
+
+/**
+ * \brief This is a function for retrieving View object. It returns a pointer
+ * to IViewModule object.
+ */
+IViewModulePtr createView();
+} //namespace
+
+#endif /* WRT_SRC_VIEW_I_VIEW_MODULE_H_ */
diff --git a/src/view/view_module.cpp b/src/view/view_module.cpp
new file mode 100644 (file)
index 0000000..79f1993
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_module.cpp
+ * @author  Pawel Sikorski (p.sikorski@samsung.com)
+ * @version 1.0
+ * @brief   getView function implementation
+ */
+
+#include "i_view_module.h"
+#include <view_logic.h>
+
+namespace ViewModule {
+IViewModulePtr createView()
+{
+    IViewModulePtr ptr(new ViewLogic());
+    return ptr;
+}
+} //namespace
diff --git a/src/view/webkit/CMakeLists.txt b/src/view/webkit/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9279c77
--- /dev/null
@@ -0,0 +1,117 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+# @file     src/view/webkit/CMakeLists.txt
+# @author   Pawel Sikorski (p.sikorski@samsung.com)
+
+GROUP_DEPS(VIEW_MODULE_DEP DEPS
+    dpl-dbus-efl
+    dpl-utils-efl
+    dpl-wrt-dao-ro
+    notification
+    wrt-commons-custom-handler-dao-rw
+    wrt-dispatch-event
+    wrt-plugins-ipc-message
+    wrt-plugin-js-overlay
+    wrt-popup-wrt-runner
+    security-core
+    security-client
+    deviced
+    capi-system-system-settings
+    efl-assist
+    privacy-manager-client
+    )
+
+GROUP_DEPS(SYS_VIEW_MODULE_DEP DEPS
+     appsvc
+     capi-appfw-app-manager
+     eina
+     ewebkit2
+     )
+
+SET(VIEW_MODULE_SOURCES
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/ewk_context_manager.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_authentication_challenge_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_certificate_confirm_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_geolocation_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_message_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_orientation_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_scheme_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_usermedia_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_web_notification_data.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_web_notification_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_web_notification_permission_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_web_storage_support.cpp
+    ${VIEW_MODULE_SOURCES}
+)
+IF(WRT_USE_WEBKIT_UPVERSION)
+LIST(REMOVE_ITEM VIEW_MODULE_SOURCES
+     ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_authentication_challenge_support.cpp
+)
+LIST(APPEND VIEW_MODULE_SOURCES
+     ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_authentication_request_support.cpp
+)
+ENDIF(WRT_USE_WEBKIT_UPVERSION)
+
+SET(VIEW_MODULE_INCLUDES
+    ${PROJECT_SOURCE_DIR}/src/api_new
+    ${PROJECT_SOURCE_DIR}/src/domain
+    ${PROJECT_SOURCE_DIR}/src/profiling
+    ${PROJECT_SOURCE_DIR}/src/view
+    ${PROJECT_SOURCE_DIR}/src/view/webkit
+    ${VIEW_MODULE_DEP_INCLUDE_DIRS}
+)
+
+ADD_DEFINITIONS(
+    ${VIEW_MODULE_DEP_CFLAGS}
+)
+
+INCLUDE_DIRECTORIES(${VIEW_MODULE_INCLUDES})
+
+INCLUDE_DIRECTORIES(
+    SYSTEM
+    ${SYS_VIEW_MODULE_DEP_INCLUDE_DIRS}
+)
+
+ADD_LIBRARY(${TARGET_VIEW_MODULE_LIB} STATIC
+    ${VIEW_MODULE_SOURCES}
+)
+
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+TARGET_LINK_LIBRARIES(${TARGET_VIEW_MODULE_LIB}
+    ${VIEW_MODULE_DEP_LIBRARIES}
+    ${TARGET_WRT_EVENT_LOOP_LIB}
+    ${PROF_LIB}
+)
+ELSE(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+TARGET_LINK_LIBRARIES(${TARGET_VIEW_MODULE_LIB}
+    ${VIEW_MODULE_DEP_LIBRARIES}
+    ${PROF_LIB}
+)
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+SET_TARGET_PROPERTIES(${TARGET_VIEW_MODULE_LIB} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_VIEW_MODULE_LIB} PROPERTIES
+    VERSION ${PROJECT_VERSION}
+    SOVERSION ${PROJECT_API_VERSION})
+SET_TARGET_PROPERTIES(${TARGET_VIEW_MODULE_LIB} PROPERTIES
+    COMPILE_FLAGS "-include profiling_util.h"
+    OUTPUT_NAME ${TARGET_VIEW_MODULE_LIB}
+)
+
+ADD_SUBDIRECTORY(injected-bundle)
diff --git a/src/view/webkit/ewk_context_manager.cpp b/src/view/webkit/ewk_context_manager.cpp
new file mode 100644 (file)
index 0000000..bbc6c5a
--- /dev/null
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    ewk_context_manager.cpp
+ * @author  Yunchan Cho (yunchan.cho@samsung.com)
+ * @version 0.1
+ * @brief   Implementation of EwkContextManager class.
+ *          This file handles operation regarding Ewk_Context
+ */
+
+#include "ewk_context_manager.h"
+
+#include <map>
+#include <string>
+
+#include <cert-service.h>
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/foreach.h>
+#include <dpl/platform.h>
+#include <dpl/wrt-dao-ro/widget_config.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/wrt-dao-ro/widget_dao_types.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <vconf.h>
+
+#include <i_view_module.h>
+#include <profiling_util.h>
+#include <widget_data_types.h>
+
+namespace ViewModule {
+namespace {
+const std::string bundlePath("/usr/lib/libwrt-injected-bundle.so");
+
+//Tizen Extensible API String
+const char *EXTENSIBLE_API_CSP = "csp";
+const char *EXTENSIBLE_API_BACKGROUND_MUSIC = "background,music";
+const char *EXTENSIBLE_API_SOUND_MODE = "sound,mode";
+const char *EXTENSIBLE_API_VISIBILITY_SUSPEND = "visibility,suspend";
+const char *EXTENSIBLE_API_ROTATION_LOCK = "rotation,lock";
+const char *EXTENSIBLE_API_FULL_SCREEN = "fullscreen";
+const char *EXTENSIBLE_API_BACKGROUND_VIBRATION = "background,vibration";
+
+std::map<const char*, Eina_Bool> defaultExtensibleAPI = {
+    { "mediastream,record",           EINA_TRUE  },
+    { "rotate,camera,view",            EINA_FALSE },
+#if !USE(WEB_PROVIDER_EXCEPTION_IN_EWK_CONTEXT)
+    { "media,volume,control",          EINA_TRUE  },
+#endif
+    { "encrypted,database",           EINA_TRUE  },
+    { "xwindow,for,fullscreen,video", EINA_TRUE  }
+};
+
+
+
+} // anonymous namespace
+
+EwkContextManager::EwkContextManager(
+        const std::string& tizenAppId,
+        Ewk_Context* ewkContext,
+        IViewModulePtr viewModule)
+    : IContextManager(tizenAppId, ewkContext, viewModule),
+      m_initialized(false), m_isInternalContext(false)
+{
+    if (!initialize()) {
+        ThrowMsg(DPL::Exception, "Fail to intialize EwkContextManager");
+    }
+    // set ewk context callbacks
+    setCallbacks();
+}
+
+EwkContextManager::~EwkContextManager()
+{
+    // unset registered ewk context callbacks
+    unsetCallbacks();
+    destroy();
+}
+
+Ewk_Context * EwkContextManager::getEwkContext() const
+{
+    return m_ewkContext;
+}
+
+bool EwkContextManager::initialize()
+{
+    if (!m_ewkContext) {
+        m_ewkContext = ewk_context_new_with_injected_bundle_path(bundlePath.c_str());
+
+        if (!m_ewkContext) {
+            return false;
+        }
+
+        m_isInternalContext = true;
+    }
+
+    // cache model setting
+    ewk_context_cache_model_set(
+        m_ewkContext,
+        EWK_CACHE_MODEL_DOCUMENT_BROWSER);
+    ADD_PROFILING_POINT("WebProcess fork", "start");
+    // To fork a Webprocess as soon as possible,
+    // the following ewk_api is called explicitly.
+    ewk_cookie_manager_accept_policy_set(
+            ewk_context_cookie_manager_get(m_ewkContext),
+            EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
+    ADD_PROFILING_POINT("WebProcess fork", "stop");
+
+    WrtLogD("ewk_context_certificate_file_set() was called.");
+    const char* caCertPath = cert_svc_get_certificate_crt_file_path();
+    if (caCertPath) {
+        ewk_context_certificate_file_set(m_ewkContext, caCertPath);
+    } else {
+        WrtLogE("cert path is null");
+    }
+
+    FOREACH(it, defaultExtensibleAPI) {
+        ewk_context_tizen_extensible_api_string_set(m_ewkContext,
+                                             it->first,
+                                             it->second);
+    }
+
+    // ewk storage_path set
+    ewk_context_storage_path_reset(m_ewkContext);
+
+    // web application dependent settings
+    WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(m_appId));
+    setAutoFullscreenMode();
+#if ENABLE(CONTENT_SECURITY_POLICY)
+    if (dao.getSecurityModelVersion() ==
+        WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V2)
+    {
+        ewk_context_tizen_extensible_api_string_set(m_ewkContext,
+                                             EXTENSIBLE_API_CSP,
+                                             EINA_TRUE);
+    }
+#endif
+
+    // WidgetSettingList dependent settings
+    WrtDB::WidgetSettings widgetSettings;
+    dao.getWidgetSettings(widgetSettings);
+    WidgetSettingList settings(widgetSettings);
+
+    ewk_context_tizen_extensible_api_string_set(
+        m_ewkContext,
+        EXTENSIBLE_API_BACKGROUND_MUSIC,
+        settings.getBackgroundSupport() == BackgroundSupport_Enable ?
+            EINA_TRUE : EINA_FALSE);
+    ewk_context_tizen_extensible_api_string_set(
+        m_ewkContext,
+        EXTENSIBLE_API_SOUND_MODE,
+        settings.getSoundMode() == SoundMode_Exclusive ?
+            EINA_TRUE : EINA_FALSE);
+    ewk_context_tizen_extensible_api_string_set(
+        m_ewkContext,
+        EXTENSIBLE_API_ROTATION_LOCK,
+        settings.getRotationValue() == Screen_AutoRotation ?
+            EINA_FALSE : EINA_TRUE);
+
+    // note: EWK_EXTENSIBLE_API_VISIBILITY_SUSPEND - private package only
+    ewk_context_tizen_extensible_api_string_set(
+        m_ewkContext,
+        EXTENSIBLE_API_VISIBILITY_SUSPEND,
+        settings.getBackgroundSupport() == BackgroundSupport_Enable ?
+            EINA_TRUE : EINA_FALSE);
+
+    ewk_context_tizen_extensible_api_string_set(
+        m_ewkContext,
+        EXTENSIBLE_API_BACKGROUND_VIBRATION,
+        settings.getBackgroundVibration() == BackgroundVibration_Enable ?
+            EINA_TRUE : EINA_FALSE);
+
+    std::string pluginsPath =
+        WrtDB::WidgetConfig::GetWidgetNPRuntimePluginsPath(
+            dao.getTizenPkgId());
+
+    // npruntime plugins path set
+    WrtLogD("ewk_context_additional_plugin_path_set() : %s", pluginsPath.c_str());
+
+    ewk_context_additional_plugin_path_set(m_ewkContext, pluginsPath.c_str());
+
+    m_initialized = true;
+
+    return true;
+}
+
+void EwkContextManager::destroy()
+{
+    // only in the following case, webkit context should be deleted
+    if (m_initialized && m_isInternalContext) {
+#if USE(WEBKIT_UPVERSION)
+        ewk_object_unref(m_ewkContext);
+#else
+        ewk_context_delete(m_ewkContext);
+#endif
+    }
+}
+
+void EwkContextManager::setCallbacks()
+{
+    if (!m_initialized) {
+        return;
+    }
+
+    ewk_context_message_from_injected_bundle_callback_set(
+            m_ewkContext,
+            messageFromInjectedBundleCallback,
+            this);
+
+    ewk_context_did_start_download_callback_set(
+            m_ewkContext,
+            didStartDownloadCallback,
+            this);
+
+    ewk_context_vibration_client_callbacks_set(
+            m_ewkContext,
+            vibrationClientStartCallback,
+            vibrationClientStopCallback,
+            this);
+}
+
+void EwkContextManager::unsetCallbacks()
+{
+    if (!m_initialized) {
+        return;
+    }
+
+    ewk_context_message_from_injected_bundle_callback_set(
+            m_ewkContext, NULL, NULL);
+    ewk_context_did_start_download_callback_set(
+            m_ewkContext, NULL, NULL);
+    ewk_context_vibration_client_callbacks_set(
+            m_ewkContext, NULL, NULL, NULL);
+}
+
+void EwkContextManager::setAutoFullscreenMode()
+{
+    using namespace WrtDB;
+    WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(m_appId));
+    if(!m_ewkContext) {
+        return;
+    }
+    std::list<DPL::String> widgetPrivilege = dao.getWidgetPrivilege();
+    bool fullscreen = false;
+
+    FOREACH(it, widgetPrivilege) {
+        std::map<std::string, Feature>::const_iterator result =
+        g_W3CPrivilegeTextMap.find(DPL::ToUTF8String(*it));
+            if (result != g_W3CPrivilegeTextMap.end()) {
+                if (result->second == FEATURE_FULLSCREEN_MODE) {
+                    fullscreen = true;
+                    break;
+            }
+        }
+    }
+    ewk_context_tizen_extensible_api_string_set(m_ewkContext,
+        EXTENSIBLE_API_FULL_SCREEN,
+        fullscreen);
+}
+
+void EwkContextManager::messageFromInjectedBundleCallback(
+        const char* name,
+        const char* body,
+        char** returnData,
+        void* clientInfo)
+{
+    WrtLogD("enter");
+
+    EwkContextManager* This = static_cast<EwkContextManager*>(clientInfo);
+    if (returnData) {
+        This->m_view->checkSyncMessageFromBundle(name, body, returnData);
+    } else {
+        This->m_view->checkAsyncMessageFromBundle(name, body);
+    }
+}
+
+void EwkContextManager::didStartDownloadCallback(const char* downloadUrl, void* data)
+{
+    WrtLogD("enter");
+
+    EwkContextManager* This = static_cast<EwkContextManager*>(data);
+    This->m_view->downloadData(downloadUrl);
+}
+
+void EwkContextManager::vibrationClientStartCallback(uint64_t time, void* data)
+{
+    WrtLogD("enter");
+
+    EwkContextManager* This = static_cast<EwkContextManager*>(data);
+    This->m_view->activateVibration(true, static_cast<long>(time));
+}
+
+void EwkContextManager::vibrationClientStopCallback(void* data)
+{
+    WrtLogD("enter");
+
+    EwkContextManager* This = static_cast<EwkContextManager*>(data);
+    This->m_view->activateVibration(false, 0);
+}
+
+void EwkContextManager::handleLowMemory()
+{
+    WrtLogD("handleLowMemory");
+
+    if (!m_ewkContext) {
+        return;
+    }
+    ewk_context_cache_clear(m_ewkContext);
+    ewk_context_notify_low_memory(m_ewkContext);
+}
+
+ContextManagerPtr createEwkContextManager(
+        std::string& tizenAppId,
+        Ewk_Context* ewkContext,
+        ViewModule::IViewModulePtr viewModule)
+{
+    return ContextManagerPtr(new EwkContextManager(tizenAppId, ewkContext, viewModule));
+}
+
+} // namespace ViewModule
diff --git a/src/view/webkit/ewk_context_manager.h b/src/view/webkit/ewk_context_manager.h
new file mode 100644 (file)
index 0000000..f643c49
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    ewk_context_manager.h
+ * @author  Yunchan Cho (yunchan.cho@samsung.com)
+ * @version 0.1
+ * @brief   Declaration of EwkContextManager class.
+ *          This file handles operation regarding Ewk_Context.
+ */
+
+#ifndef EWK_CONTEXT_MANAGER_H
+#define EWK_CONTEXT_MANAGER_H
+
+#include <cstdint>
+#include <string>
+
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <vconf.h>
+#include <i_context_manager.h>
+#include <i_view_module.h>
+
+namespace ViewModule {
+
+class EwkContextManager : public IContextManager {
+    public:
+        EwkContextManager(
+            const std::string& tizenAppId,
+            Ewk_Context* ewkContext,
+            ViewModule::IViewModulePtr viewModule);
+        Ewk_Context * getEwkContext() const;
+        void handleLowMemory();
+        ~EwkContextManager();
+
+    private:
+        bool initialize();
+        void destroy();
+        void setCallbacks();
+        void unsetCallbacks();
+        void setAutoFullscreenMode();
+
+        // ewk context callback functions
+        static void messageFromInjectedBundleCallback(
+                const char* name,
+                const char* body,
+                char** returnData,
+                void* clientInfo);
+        static void didStartDownloadCallback(const char* downloadUrl, void* data);
+        static void vibrationClientStartCallback(uint64_t time, void* data);
+        static void vibrationClientStopCallback(void* data);
+
+        // members
+        bool m_initialized;
+        bool m_isInternalContext;
+};
+} // namespace ViewModule
+
+#endif // EWK_CONTEXT_MANAGER_H
diff --git a/src/view/webkit/injected-bundle/CMakeLists.txt b/src/view/webkit/injected-bundle/CMakeLists.txt
new file mode 100644 (file)
index 0000000..350882b
--- /dev/null
@@ -0,0 +1,137 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+# @file     src/view/webkit/injected-bundle/CMakeLists.txt
+# @author   Lukasz Wrzosek (l.wrzosek@samsung.com)
+
+GROUP_DEPS(INJECTED_BUNDLE_DEP DEPS
+    dpl-efl
+    dpl-event-efl
+    dpl-utils-efl
+    dpl-wrt-dao-ro
+    ewebkit2
+    libprivilege-control
+    libiri
+    libpcrecpp
+    wrt-dispatch-event
+    wrt-plugins-ipc-message
+    wrt-plugin-loading
+    wrt-plugin-js-overlay
+    pkgmgr-info
+    appsvc
+)
+
+IF(WRT_ENABLE_BACKGROUND_THREAD_DECRYPTION)
+    # platform's boost does not have pkg-config package,
+    # therefore it is using provided cmake FindBoost module to locate boost
+    FIND_PACKAGE(Boost COMPONENTS system filesystem)
+ENDIF(WRT_ENABLE_BACKGROUND_THREAD_DECRYPTION)
+
+SET(INJECTED_BUNDLE_SOURCES
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/page_global_context_container.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/injected_bundle_decryption_support_impl.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/injected_bundle_plugin_interface.cpp
+    ${PROJECT_SOURCE_DIR}/src/view/common/scheme.cpp
+)
+
+IF(WRT_ENABLE_BACKGROUND_THREAD_DECRYPTION)
+    SET(INJECTED_BUNDLE_SOURCES
+        ${INJECTED_BUNDLE_SOURCES}
+        ${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/injected_bundle_threaded_decryption_support_impl.cpp
+    )
+ENDIF(WRT_ENABLE_BACKGROUND_THREAD_DECRYPTION)
+
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+    SET(INJECTED_BUNDLE_SOURCES
+        ${INJECTED_BUNDLE_SOURCES}
+        ${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/src/app_sock.cpp
+    )
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+SET(INJECTED_BUNDLE_INCLUDES
+    ${INJECTED_BUNDLE_DEP_INCLUDE_DIRS}
+    ${PROJECT_SOURCE_DIR}/src/view/common
+    ${PROJECT_SOURCE_DIR}/src/domain
+)
+
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+    SET(INJECTED_BUNDLE_INCLUDES
+        ${INJECTED_BUNDLE_INCLUDES}
+        ${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/include
+        ${WRT_LAUNCH_PAD_DEPS_INCLUDE_DIRS}
+    )
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+ADD_DEFINITIONS(
+    ${INJECTED_BUNDLE_DEP_CFLAGS}
+)
+INCLUDE_DIRECTORIES(
+    ${INJECTED_BUNDLE_INCLUDES}
+    ${TARGET_SMACK_LABELING_SUPPORT_INCLUDES}
+    )
+
+IF(WRT_ENABLE_BACKGROUND_THREAD_DECRYPTION)
+    INCLUDE_DIRECTORIES(${Boost_INCLUDES})
+ENDIF(WRT_ENABLE_BACKGROUND_THREAD_DECRYPTION)
+
+ADD_LIBRARY(${TARGET_INJECTED_BUNDLE_LIB} SHARED
+    ${INJECTED_BUNDLE_SOURCES}
+)
+
+TARGET_LINK_LIBRARIES(
+    ${TARGET_INJECTED_BUNDLE_LIB}
+    ${INJECTED_BUNDLE_DEP_LIBRARIES}
+    ${TARGET_WRT_ENGINE_STATIC}
+    ${PROF_LIB}
+    ${TARGET_SMACK_LABELING_SUPPORT_STATIC}
+)
+
+IF(WRT_ENABLE_BACKGROUND_THREAD_DECRYPTION)
+    TARGET_LINK_LIBRARIES(${TARGET_INJECTED_BUNDLE_LIB} ${Boost_LIBRARIES})
+ENDIF(WRT_ENABLE_BACKGROUND_THREAD_DECRYPTION)
+
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+    TARGET_LINK_LIBRARIES(${TARGET_INJECTED_BUNDLE_LIB}
+        ${WRT_LAUNCH_PAD_DEPS_LIBRARIES}
+        "-lcap"
+    )
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+# for encryption
+TARGET_LINK_LIBRARIES(${TARGET_INJECTED_BUNDLE_LIB} "-lss-client")
+
+# Overriden log tag!
+SET_TARGET_PROPERTIES(${TARGET_INJECTED_BUNDLE_LIB} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="WRT_BUNDLE")
+
+SET_TARGET_PROPERTIES(${TARGET_INJECTED_BUNDLE_LIB} PROPERTIES
+    VERSION ${PROJECT_VERSION}
+    SOVERSION ${PROJECT_API_VERSION})
+SET_TARGET_PROPERTIES(${TARGET_INJECTED_BUNDLE_LIB} PROPERTIES
+    COMPILE_FLAGS -fPIC)
+SET_TARGET_PROPERTIES(${TARGET_INJECTED_BUNDLE_LIB} PROPERTIES
+    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both -Wl,--version-script=${PROJECT_SOURCE_DIR}/src/view/webkit/injected-bundle/${TARGET_INJECTED_BUNDLE_LIB}.map"
+    OUTPUT_NAME ${TARGET_INJECTED_BUNDLE_LIB}
+)
+
+INSTALL(TARGETS ${TARGET_INJECTED_BUNDLE_LIB}
+    DESTINATION lib/
+    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+    GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+)
diff --git a/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp b/src/view/webkit/injected-bundle/injected_bundle_decryption_support.cpp
new file mode 100644 (file)
index 0000000..f0d5316
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file    injected_bundle_decryption_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+
+#include "injected_bundle_decryption_support.h"
+
+#include <string>
+
+#include <dpl/log/wrt_log.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+
+#if ENABLE(BACKGROUND_THREAD_DECRYPTION)
+#include "injected_bundle_threaded_decryption_support_impl.h"
+#else
+#include "injected_bundle_decryption_support_impl.h"
+#endif
+
+namespace InjectedBundle {
+
+DecryptionSupport::DecryptionSupport() :
+#if ENABLE(BACKGROUND_THREAD_DECRYPTION)
+    m_impl(new BackgroundThreadedDecryptionSupportImpl())
+#else
+    m_impl(new DecryptionSupportImpl())
+#endif
+{
+}
+
+DecryptionSupport::~DecryptionSupport()
+{
+}
+
+void DecryptionSupport::initialize(const WrtDB::TizenAppId & appId)
+{
+    m_impl->initialize(appId);
+}
+
+void DecryptionSupport::deinitialize(void)
+{
+    m_impl->deinitialize();
+}
+
+bool DecryptionSupport::isNeedDecryption(std::string url)
+{
+    return m_impl->isNeedDecryption(url);
+}
+
+std::string DecryptionSupport::decryptResource(std::string url)
+{
+    return m_impl->decryptResource(url);
+}
+
+}  // namespace InjectedBundle
diff --git a/src/view/webkit/injected-bundle/injected_bundle_decryption_support.h b/src/view/webkit/injected-bundle/injected_bundle_decryption_support.h
new file mode 100644 (file)
index 0000000..7d64fc8
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    injected_bundle_decryption_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+#ifndef INJECTED_BUNDLE_DECRYPTION_SUPPORT_H_
+#define INJECTED_BUNDLE_DECRYPTION_SUPPORT_H_
+
+#include <memory>
+#include <string>
+
+#include <dpl/platform.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+
+namespace InjectedBundle {
+#if ENABLE(BACKGROUND_THREAD_DECRYPTION)
+class BackgroundThreadedDecryptionSupportImpl;
+#else
+class DecryptionSupportImpl;
+#endif
+
+class DecryptionSupport
+{
+  public:
+    DecryptionSupport();
+    virtual ~DecryptionSupport();
+    void initialize(const WrtDB::TizenAppId & appId);
+    void deinitialize(void);
+    bool isNeedDecryption(std::string url);
+    std::string decryptResource(std::string url);
+
+  private:
+#if ENABLE(BACKGROUND_THREAD_DECRYPTION)
+    std::unique_ptr<BackgroundThreadedDecryptionSupportImpl> m_impl;
+#else
+    std::unique_ptr<DecryptionSupportImpl> m_impl;
+#endif
+};
+} // namespace InjectedBundle
+
+#endif // INJECTED_BUNDLE_DECRYPTION_SUPPORT_H_
diff --git a/src/view/webkit/injected-bundle/injected_bundle_decryption_support_impl.cpp b/src/view/webkit/injected-bundle/injected_bundle_decryption_support_impl.cpp
new file mode 100644 (file)
index 0000000..9989116
--- /dev/null
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    injected_bundle_decryption_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+#include "injected_bundle_decryption_support_impl.h"
+
+#include <memory>
+#include <string>
+
+#include <sys/stat.h>
+
+#include <ss_manager.h>
+#include <openssl/sha.h>
+#include <openssl/hmac.h>
+#include <openssl/evp.h>
+#include <openssl/bio.h>
+#include <openssl/buffer.h>
+
+#include <pkgmgr-info.h>
+
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/string.h>
+#include <dpl/utils/mime_type_utils.h>
+
+namespace {
+const char * const SCHEME_FILE_SLASH = "file://";
+const char * const DATA_STRING = "data:";
+const char * const BASE64_STRING = ";base64,";
+const char QUESTION_MARK = '?';
+const char ASTERISK_MARK = '#';
+}
+
+namespace InjectedBundle {
+
+std::string DecryptionSupportImpl::getFilePath(const std::string& url)
+{
+    std::string filePath = url;
+
+    size_t pos = filePath.find_first_not_of(SCHEME_FILE_SLASH);
+    if (pos != std::string::npos) {
+        filePath = filePath.substr(pos - 1);
+    }
+
+    pos = filePath.find_first_of(ASTERISK_MARK);
+    if (pos != std::string::npos) {
+        filePath = filePath.substr(0, pos);
+    }
+
+    pos = filePath.find_first_of(QUESTION_MARK);
+    if (pos != std::string::npos) {
+        filePath = filePath.substr(0, pos);
+    }
+
+    return filePath;
+}
+
+std::string DecryptionSupportImpl::doDecrypt(std::string filePath, int size)
+{
+    struct stat buf;
+    if (0 == stat(filePath.c_str(), &buf)) {
+        const std::size_t fileSize = buf.st_size;
+        std::unique_ptr<unsigned char[]> inChunk;
+
+        FILE* fp = fopen(filePath.c_str(), "rb");
+        if (NULL == fp) {
+            WrtLogE("Couldnot open file : %s", filePath.c_str());
+            return std::string();
+        }
+
+        std::unique_ptr<unsigned char[]> DecryptedString(new unsigned
+                char[fileSize]);
+        std::string pkgid(DPL::ToUTF8String(m_appId));
+
+        int writeCount = 0;
+        do {
+            unsigned char getDecSize[4];
+            memset(getDecSize, 0x00, sizeof(getDecSize));
+
+            size_t readSize = fread(getDecSize, sizeof(unsigned char), sizeof(getDecSize), fp);
+            if (0 != readSize) {
+                unsigned int readBufSize = 0;
+                std::istringstream(std::string((char*)getDecSize)) >> readBufSize;
+                if (readBufSize == 0) {
+                    WrtLogE("Failed to read resource");
+                    fclose(fp);
+                    return std::string();
+                }
+                inChunk.reset(new unsigned char[readBufSize]);
+
+                size_t decReadSize = fread(inChunk.get(), sizeof(unsigned char), readBufSize, fp);
+
+                if (0 != decReadSize) {
+                    char *outChunk = NULL;
+                    int outSize =
+                        ssa_decrypt_web_application((char*)inChunk.get(),
+                                (int)decReadSize, &outChunk, m_isPreload ? 1 : 0);
+                    if (0 >= outSize) {
+                        WrtLogE("Failed to get decrypted resource");
+                        fclose(fp);
+                        return std::string();
+                    }
+                    memcpy(DecryptedString.get() + writeCount, outChunk, outSize);
+                    writeCount += outSize;
+                }
+            }
+        } while (0 == std::feof(fp));
+        fclose(fp);
+        memset(DecryptedString.get() + size, '\n', fileSize - size);
+
+        BIO *bmem, *b64;
+        BUF_MEM *bptr;
+
+        b64 = BIO_new(BIO_f_base64());
+        bmem = BIO_new(BIO_s_mem());
+        b64 = BIO_push(b64, bmem);
+        if (BIO_write(b64, DecryptedString.get(), fileSize) <= 0) {
+            WrtLogE("No data has been written");
+        }
+        BIO_flush(b64);
+        BIO_get_mem_ptr(b64, &bptr);
+
+        std::string base64Enc((char *)bptr->data, bptr->length - 1);
+        BIO_free_all(b64);
+
+        return base64Enc;
+    }
+    return std::string();
+}
+
+void DecryptionSupportImpl::initialize(WrtDB::TizenAppId appId)
+{
+    WrtLogD("called");
+    m_initialized = true;
+
+    m_appId = appId;
+    WrtDB::WidgetDAOReadOnly dao(m_appId);
+    dao.getEncryptedFileList(m_encryptedFiles);
+    if (!m_encryptedFiles.empty()) {
+      WrtLogD("encrypted application");
+    }
+
+    bool isPreload = false;
+    bool isUpdate = false;
+    pkgmgrinfo_pkginfo_h handle = NULL;
+    std::string tzPkgId = DPL::ToUTF8String(dao.getTizenPkgId());
+
+    if (PMINFO_R_OK != pkgmgrinfo_pkginfo_get_pkginfo(tzPkgId.c_str(), &handle)) {
+        WrtLogE("Can't get package information : %s", tzPkgId.c_str());
+        return;
+    }
+    if (PMINFO_R_OK != pkgmgrinfo_pkginfo_is_preload(handle, &isPreload)) {
+        WrtLogE("Can't get package information : %s", tzPkgId.c_str());
+        return;
+    }
+    if (PMINFO_R_OK != pkgmgrinfo_pkginfo_is_update(handle, &isUpdate)) {
+        WrtLogE("Can't get package information : %s", tzPkgId.c_str());
+        return;
+    }
+
+    if (isPreload && !isUpdate) {
+        m_isPreload = true;
+        WrtLogD("preload application");
+    }
+}
+
+void DecryptionSupportImpl::deinitialize()
+{
+    WrtLogD("called");
+
+    m_encryptedFiles.clear();
+    m_appId = DPL::String(L"");
+    m_initialized = false;
+}
+
+bool DecryptionSupportImpl::isNeedDecryption(std::string url)
+{
+    if (!m_initialized) {
+        WrtLogE("not initialized");
+        return false;
+    }
+
+    if (0 != strncmp(url.c_str(), SCHEME_FILE_SLASH, strlen(SCHEME_FILE_SLASH))) {
+        return false;
+    }
+
+    std::set<WrtDB::EncryptedFileInfo>::iterator it;
+    WrtDB::EncryptedFileInfo info;
+    std::string filePath = getFilePath(url);
+    info.fileName = DPL::FromUTF8String(filePath);
+    if (m_encryptedFiles.end() != (it = m_encryptedFiles.find(info))) {
+        WrtLogD(" info file name : %s", DPL::ToUTF8String(it->fileName).c_str());
+        WrtLogD(" info file size : %d", it->fileSize);
+        return true;
+    }
+    return false;
+}
+
+std::string DecryptionSupportImpl::decryptResource(const std::string & url)
+{
+    if (!m_initialized) {
+        WrtLogE("not initialized");
+        return std::string();
+    }
+    WrtLogD("Decrypting resource %s...", url.c_str());
+
+    WrtDB::EncryptedFileInfo info;
+    std::string filePath = getFilePath(url);
+    info.fileName = DPL::FromUTF8String(filePath);
+    auto targetIt = m_encryptedFiles.find(info);
+
+    AssertMsg(targetIt != m_encryptedFiles.end(), "Given url is not encrypted resource");
+
+    std::string decryptString =
+        doDecrypt(DPL::ToUTF8String(targetIt->fileName),
+                  targetIt->fileSize);
+    if (!decryptString.empty()) {
+        std::string destString = DATA_STRING;
+
+        std::string mimeString =
+            DPL::ToUTF8String(
+                MimeTypeUtils::identifyFileMimeType(
+                    DPL::FromUTF8String(url)));
+
+        destString += mimeString;
+        destString += BASE64_STRING;
+
+        decryptString.insert(0, destString);
+    }
+    WrtLogD("Decrypted resource %s.", url.c_str());
+    return decryptString;
+}
+
+}
diff --git a/src/view/webkit/injected-bundle/injected_bundle_decryption_support_impl.h b/src/view/webkit/injected-bundle/injected_bundle_decryption_support_impl.h
new file mode 100644 (file)
index 0000000..ffab4ea
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    injected_bundle_decryption_support_impl.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+#ifndef INJECTED_BUNDLE_DECRYPTION_SUPPORT_IMPLEMENTATION_H
+#define INJECTED_BUNDLE_DECRYPTION_SUPPORT_IMPLEMENTATION_H
+
+#include <set>
+#include <string>
+
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+
+namespace InjectedBundle {
+
+class DecryptionSupportImpl
+{
+  protected:
+    bool m_initialized;
+
+    WrtDB::TizenAppId m_appId;
+    WrtDB::EncryptedFileList m_encryptedFiles;
+    bool m_isPreload;
+
+    std::string getFilePath(const std::string& url);
+    std::string doDecrypt(std::string filePath, int size);
+
+  public:
+    DecryptionSupportImpl() :
+        m_initialized(false),
+        m_isPreload(false)
+    {
+    }
+
+    void initialize(WrtDB::TizenAppId appId);
+    void deinitialize();
+    bool isNeedDecryption(std::string url);
+    std::string decryptResource(const std::string & url);
+};
+
+}
+
+#endif // INJECTED_BUNDLE_DECRYPTION_SUPPORT_IMPLEMENTATION_H
diff --git a/src/view/webkit/injected-bundle/injected_bundle_plugin_interface.cpp b/src/view/webkit/injected-bundle/injected_bundle_plugin_interface.cpp
new file mode 100644 (file)
index 0000000..a08b928
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    injected_bundle_plugin_interface.cpp
+ * @author  Lukasz Marek (l.marek@samgsung.com)
+ * @author  Yunchan Cho (yunchan.cho@samgsung.com)
+ * @version
+ * @brief
+ */
+
+#include "injected_bundle_plugin_interface.h"
+
+#include <dpl/log/wrt_log.h>
+#include <dpl/string.h>
+#include <dpl/assert.h>
+#include <plugin_logic.h>
+#include <js_overlay_types.h>
+
+namespace InjectedBundlePluginInterface {
+void init(int widgetHandle)
+{
+    WrtLogD("called");
+    PluginLogicSingleton::Instance().initSession(widgetHandle);
+}
+
+void start(int widgetHandle,
+           JSGlobalContextRef context,
+           double scale,
+           const char *encodedBundle,
+           const char *theme)
+{
+    PluginLogicSingleton::Instance().startSession(widgetHandle,
+                                                  context,
+                                                  scale,
+                                                  encodedBundle,
+                                                  theme);
+}
+
+void shutdown()
+{
+    WrtLogD("called");
+    PluginLogicSingleton::Instance().performLibrariesUnload();
+}
+
+void stop(JSGlobalContextRef context)
+{
+    WrtLogD("called");
+    PluginLogicSingleton::Instance().stopSession(context);
+}
+
+void setCustomProperties(JSGlobalContextRef context,
+                         double scale,
+                         const char* encodedBundle,
+                         const char* theme)
+{
+    WrtLogD("called");
+    PluginLogicSingleton::Instance().setCustomProperties(context,
+                                                         scale,
+                                                         encodedBundle,
+                                                         theme);
+}
+
+void dispatchJavaScriptEvent(JSGlobalContextRef context,
+                             WrtPlugins::W3C::CustomEventType eventType,
+                             void* data)
+{
+    WrtLogD("called");
+    PluginLogicSingleton::Instance().dispatchJavaScriptEvent(context,
+                                                             eventType,
+                                                             data);
+}
+
+void loadFrame(JSGlobalContextRef context)
+{
+    WrtLogD("load frame into web page");
+    PluginLogicSingleton::Instance().loadFrame(context);
+}
+
+void unloadFrame(JSGlobalContextRef context)
+{
+    WrtLogD("unload frame from web page");
+    PluginLogicSingleton::Instance().unloadFrame(context);
+}
+} // namespace InjectedBundlePluginInterface
diff --git a/src/view/webkit/injected-bundle/injected_bundle_plugin_interface.h b/src/view/webkit/injected-bundle/injected_bundle_plugin_interface.h
new file mode 100644 (file)
index 0000000..3ec10cc
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    injected_bundle_plugin_interface.h
+ * @author  Lukasz Marek (l.marek@samgsung.com)
+ * @author  Yunchan Cho (yunchan.cho@samgsung.com)
+ * @version
+ * @brief
+ */
+
+#ifndef INJECTED_BUNDLE_PLUGIN_INTERFACE_H_
+#define INJECTED_BUNDLE_PLUGIN_INTERFACE_H_
+
+#include <cstddef>
+#include <js_overlay_types.h>
+
+extern "C" {
+typedef struct OpaqueJSContext* JSGlobalContextRef;
+}
+
+namespace InjectedBundlePluginInterface {
+//forward declaration
+void init(int widgetHandle);
+void start(int widgetHandle,
+           JSGlobalContextRef context,
+           double scale,
+           const char* encodedBundle,
+           const char* theme);
+void stop(JSGlobalContextRef context);
+void shutdown();
+void setCustomProperties(JSGlobalContextRef context,
+                         double scale,
+                         const char* encodedBundle,
+                         const char* theme);
+void dispatchJavaScriptEvent(JSGlobalContextRef context,
+                             WrtPlugins::W3C::CustomEventType eventType,
+                             void* data);
+void loadFrame(JSGlobalContextRef context);
+void unloadFrame(JSGlobalContextRef context);
+} // namespace InjectedBundlePluginInterface
+
+#endif // INJECTED_BUNDLE_PLUGIN_INTERFACE_H_
\ No newline at end of file
diff --git a/src/view/webkit/injected-bundle/injected_bundle_threaded_decryption_support_impl.cpp b/src/view/webkit/injected-bundle/injected_bundle_threaded_decryption_support_impl.cpp
new file mode 100644 (file)
index 0000000..a7c5280
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    injected_bundle_threaded_decryption_support_impl.cpp
+ * @author  Tomasz Iwanek (t.iwanek@samsung.com)
+ * @version 1.0
+ */
+#include "injected_bundle_threaded_decryption_support_impl.h"
+
+#include <dpl/foreach.h>
+#include <dpl/log/wrt_log.h>
+
+#include <boost/filesystem/path.hpp>
+#include <boost/algorithm/string.hpp>
+
+namespace {
+const char FILE_SCHEME[] = "file://";
+}
+
+namespace InjectedBundle {
+
+void BackgroundThreadedDecryptionSupportImpl::initialize(WrtDB::TizenAppId appId)
+{
+    namespace bfs = boost::filesystem;
+
+    m_stopped = false;
+    DecryptionSupportImpl::initialize(appId);
+
+    sortFilesByExtension();
+    createDecryptionThreads();
+}
+
+void BackgroundThreadedDecryptionSupportImpl::sortFilesByExtension()
+{
+    namespace bfs = boost::filesystem;
+    namespace ba = boost::algorithm;
+
+    FOREACH(file, m_encryptedFiles)
+    {
+        bfs::path pfile(DPL::ToUTF8String(file->fileName));
+        std::string ext = pfile.extension().string();
+        ba::to_lower(ext);
+        auto it = m_extmap.find(ext);
+
+        // if no such an extension in extension map
+        if (it == m_extmap.end()) {
+            it = m_extmap.insert(std::make_pair(ext, FilesPerExtensionMap::mapped_type())).first;
+        }
+
+        it->second.push_back(std::string(FILE_SCHEME) + DPL::ToUTF8String(file->fileName));
+    }
+}
+
+void BackgroundThreadedDecryptionSupportImpl::decryptionLoop(const std::vector<std::string> &exts)
+{
+    std::string url;
+    WrtLogD("Starting decryption thread");
+    FOREACH(ext, exts)
+    {
+        WrtLogD("Running decryption for extention: %s", ext->c_str());
+        while (!m_stopped && nextFileForExtension(*ext, url))
+        {
+            WrtLogD("Decrypting in background url=%s...", url.c_str());
+            decryptResource(url);
+            WrtLogD("Decrypted in background url=%s", url.c_str());
+        }
+
+        if (m_stopped)
+            break;
+    }
+    WrtLogD("Ending decryption thread");
+}
+
+void BackgroundThreadedDecryptionSupportImpl::createDecryptionThreads()
+{
+    std::thread htmlDecryptor(&BackgroundThreadedDecryptionSupportImpl::decryptionLoop, this,
+            std::vector<std::string>({".html", ".htm", ".xhtml", ".svg", ".xht"}));
+
+    std::thread jsDecryptor(&BackgroundThreadedDecryptionSupportImpl::decryptionLoop, this,
+            std::vector<std::string>({".js"}));
+
+    std::thread cssDecryptor(&BackgroundThreadedDecryptionSupportImpl::decryptionLoop, this,
+            std::vector<std::string>({".css"}));
+
+    m_threads.push_back(std::move(htmlDecryptor));
+    m_threads.push_back(std::move(jsDecryptor));
+    m_threads.push_back(std::move(cssDecryptor));
+}
+
+void BackgroundThreadedDecryptionSupportImpl::deinitialize()
+{
+    // ask threads to stop
+    m_stopped = true;
+
+    // wait for them
+    FOREACH(thread, m_threads)
+    {
+        if (thread->joinable())
+            thread->join();
+    }
+
+    DecryptionSupportImpl::deinitialize();
+}
+
+bool BackgroundThreadedDecryptionSupportImpl::findInCacheOrRemoveFromTodo(const std::string & url, std::string & data)
+{
+    std::lock_guard<std::mutex> lock(m_extlock);
+
+    if (findInCache(url, data)) {
+        return true;
+    }
+
+    // remove so it will not be fetch by decryption thread in future
+    removeFromTodoMap(url);
+    return false;
+}
+
+
+std::string BackgroundThreadedDecryptionSupportImpl::decryptResource(const std::string & url)
+{
+    std::string data;
+    if (findInCacheOrRemoveFromTodo(url, data)) {
+        return data;
+    }
+
+    //not found in cache, removed from todo map -> proceed
+    data = DecryptionSupportImpl::decryptResource(url);
+    saveInCache(url, data);
+
+    return data;
+}
+
+bool BackgroundThreadedDecryptionSupportImpl::isNeedDecryption(std::string url)
+{
+    return DecryptionSupportImpl::isNeedDecryption(url);
+}
+
+bool BackgroundThreadedDecryptionSupportImpl::findInCache(const std::string & url, std::string & data)
+{
+    std::lock_guard<std::mutex> lock(m_lock);
+    auto it = m_scache.find(url);
+    if (it == m_scache.end()) {
+        WrtLogD("Decryption cache - file not found: %s", url.c_str());
+        return false;
+    }
+
+    // file found in cache
+    data = it->second;
+    WrtLogD("Decryption cache - file present: %s", url.c_str());
+
+    return true;
+}
+
+void BackgroundThreadedDecryptionSupportImpl::saveInCache(std::string url, std::string data)
+{
+    namespace bfs = boost::filesystem;
+    auto pair = std::make_pair(std::move(url), std::move(data));
+    std::lock_guard<std::mutex> lock(m_lock);
+    m_scache.insert(pair);
+}
+
+void BackgroundThreadedDecryptionSupportImpl::removeFromTodoMap(const std::string & url)
+{
+    namespace bfs = boost::filesystem;
+    namespace ba = boost::algorithm;
+
+    // remove from input positions
+    std::string ext = bfs::path(url).extension().string();
+    ba::to_lower(ext);
+    m_extmap[ext].remove(url);
+}
+
+bool BackgroundThreadedDecryptionSupportImpl::nextFileForExtension(const std::string & ext, std::string & url)
+{
+    std::lock_guard<std::mutex> lock(m_extlock);
+    if (m_extmap[ext].empty()) {
+        return false;
+    }
+
+    FilesPerExtensionMap::mapped_type & list = m_extmap[ext];
+    url = list.front();
+    list.pop_front();
+    return true;
+}
+
+}
diff --git a/src/view/webkit/injected-bundle/injected_bundle_threaded_decryption_support_impl.h b/src/view/webkit/injected-bundle/injected_bundle_threaded_decryption_support_impl.h
new file mode 100644 (file)
index 0000000..b4e1dbc
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    injected_bundle_threaded_decryption_support_impl.h
+ * @author  Tomasz Iwanek (t.iwanek@samsung.com)
+ * @version 1.0
+ */
+#ifndef INJECTED_BUNDLE_THREADED_DECRYPTION_SUPPORT_IMPLEMENTATION_H
+#define INJECTED_BUNDLE_THREADED_DECRYPTION_SUPPORT_IMPLEMENTATION_H
+
+#include <atomic>
+#include <list>
+#include <map>
+#include <mutex>
+#include <string>
+#include <thread>
+#include <vector>
+
+#include "injected_bundle_decryption_support_impl.h"
+
+namespace InjectedBundle {
+
+//decryption support with background threads
+class BackgroundThreadedDecryptionSupportImpl : private DecryptionSupportImpl
+{
+public:
+    void initialize(WrtDB::TizenAppId appId);
+    void deinitialize();
+
+    std::string decryptResource(const std::string & url);
+    bool isNeedDecryption(std::string url);
+
+private:
+    typedef std::map<std::string, std::string> DataSchemeCache;
+    typedef std::map<std::string, std::list<std::string> > FilesPerExtensionMap;
+    typedef std::vector<std::thread> DecryptionThreadWrapperStorage;
+
+    bool findInCacheOrRemoveFromTodo(const std::string & url, std::string & data);
+    bool findInCache(const std::string & url, std::string & data);
+    void saveInCache(std::string url, std::string data);
+    /**
+     * @brief removeFromTodoMap
+     * @param url url (with scheme)
+     */
+    void removeFromTodoMap(const std::string & url);
+    /**
+     * @brief nextFileForExtension
+     *
+     * Returns next file to be decrypted for given extension
+     *
+     * @param ext extension to be checked
+     * @param url url (with scheme) to be decrypted
+     * @return true if output parameter was set
+     */
+    bool nextFileForExtension(const std::string & ext, std::string & url);
+
+    void sortFilesByExtension();
+    void createDecryptionThreads();
+
+    void decryptionLoop(const std::vector<std::string> & exts);
+
+    std::mutex m_lock;                //do not make them locked at same time by one thread
+    std::mutex m_extlock;
+    DataSchemeCache m_scache;         // files that have been cached
+    FilesPerExtensionMap m_extmap;    // files to be cached
+    DecryptionThreadWrapperStorage m_threads;
+    std::atomic<bool> m_stopped;
+};
+
+}
+
+#endif // INJECTED_BUNDLE_THREADED_DECRYPTION_SUPPORT_IMPLEMENTATION_H
diff --git a/src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp b/src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp
new file mode 100644 (file)
index 0000000..e507e18
--- /dev/null
@@ -0,0 +1,323 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file    injected_bundle_uri_handling.cpp
+ * @author  Marcin Kaminski (marcin.ka@samsung.com)
+ * @version 1.0
+ */
+
+#include "injected_bundle_uri_handling.h"
+
+#include <memory>
+#include <string.h>
+#include <sys/stat.h>
+
+#include <dpl/log/wrt_log.h>
+#include <dpl/utils/wrt_global_settings.h>
+#include <dpl/platform.h>
+// For dao creation (widget info fetching)
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/utils/warp_iri.h>
+// URI localization
+#include <dpl/localization/w3c_file_localization.h>
+// WARP check
+#include <widget_data_types.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+// allow-navigation check
+#include <pcrecpp.h>
+#include <iri.h>
+
+namespace {
+char const * const SCHEME_TYPE_FILE = "file";
+char const * const SCHEME_TYPE_WIDGET = "widget";
+char const * const SCHEME_TYPE_APP = "app";
+char const * const SCHEME_TYPE_HTTP = "http";
+char const * const PARAM_URL = "param:url";
+char const * const ACE_IGNORED_SCHEMA[] = {
+    "file://",
+    "widget://",
+#if ENABLE(APP_SCHEME)
+    "app://",
+#endif
+    "data:",
+    "tel:",
+    "sms:",
+    "mmsto:",
+    "mailto:",
+    0 };
+
+bool wildcardCompare(std::string wildcardString, std::string target)
+{
+    std::string re = wildcardString;
+
+    // replace special character to meaning character
+    pcrecpp::RE("\\\\").GlobalReplace("\\\\\\\\", &re);
+    pcrecpp::RE("\\.").GlobalReplace("\\\\.", &re);
+    pcrecpp::RE("\\+").GlobalReplace("\\\\+", &re);
+    pcrecpp::RE("\\?").GlobalReplace("\\\\?", &re);
+    pcrecpp::RE("\\^").GlobalReplace("\\\\^", &re);
+    pcrecpp::RE("\\$").GlobalReplace("\\\\$", &re);
+    pcrecpp::RE("\\[").GlobalReplace("\\\\[", &re);
+    pcrecpp::RE("\\]").GlobalReplace("\\\\]", &re);
+    pcrecpp::RE("\\{").GlobalReplace("\\\\{", &re);
+    pcrecpp::RE("\\}").GlobalReplace("\\\\}", &re);
+    pcrecpp::RE("\\(").GlobalReplace("\\\\(", &re);
+    pcrecpp::RE("\\)").GlobalReplace("\\\\)", &re);
+    pcrecpp::RE("\\|").GlobalReplace("\\\\|", &re);
+
+    // replace wildcard character to regex type
+    pcrecpp::RE("\\*").GlobalReplace(".*", &re);
+
+    return pcrecpp::RE(re).FullMatch(target);
+}
+
+bool checkWARP(const char *url, const DPL::String& tizenId)
+{
+    // ignore WARP in test mode
+    if (GlobalSettings::WarpTestModeEnabled()) {
+        return true;
+    }
+
+    if (WarpIRI::isIRISchemaIgnored(url)) {
+        // scheme is not supported by WARP
+        return true;
+    }
+
+    WrtDB::WidgetDAOReadOnly dao = WrtDB::WidgetDAOReadOnly(tizenId);
+    WrtDB::WidgetAccessInfoList widgetAccessInfoList;
+    dao.getWidgetAccessInfo(widgetAccessInfoList);
+
+    // temporary solution for libiri parsing error
+    // This code will be removed
+    std::string urlstr = url;
+    size_t pos = urlstr.find_first_of("#?");
+    if (pos != std::string::npos) {
+        urlstr = urlstr.substr(0, pos);
+    }
+
+    return (static_cast<WidgetAccessList>(widgetAccessInfoList)).isRequiredIRI(
+               DPL::FromUTF8String(urlstr));
+}
+
+bool checkWhitelist(const char *url)
+{
+    if (url == NULL) {
+        return true;
+    }
+
+    std::unique_ptr<iri_t, decltype(&iri_destroy)> iri(iri_parse(url), iri_destroy);
+    if (!iri->scheme || !iri->host || strlen(iri->host) == 0) {
+        return true;
+    }
+    std::string scheme = iri->scheme;
+    std::string host = iri->host;
+
+    if (scheme.find(SCHEME_TYPE_HTTP) == std::string::npos) {
+        return true;
+    }
+
+    return false;
+}
+
+bool checkAllowNavigation(const char *url, const DPL::String& tizenId)
+{
+    if (url == NULL) {
+        return true;
+    }
+
+    std::unique_ptr<iri_t, decltype(&iri_destroy)> iri(iri_parse(url), iri_destroy);
+    if (!iri->scheme || !iri->host || strlen(iri->host) == 0) {
+        return true;
+    }
+    std::string scheme = iri->scheme;
+    std::string host = iri->host;
+
+    if (scheme.find(SCHEME_TYPE_HTTP) == std::string::npos) {
+        return true;
+    }
+
+    WrtDB::WidgetDAOReadOnly dao = WrtDB::WidgetDAOReadOnly(tizenId);
+    WrtDB::WidgetAllowNavigationInfoList list;
+    dao.getWidgetAllowNavigationInfo(list);
+
+    FOREACH(it, list) {
+        if (wildcardCompare(DPL::ToUTF8String(it->scheme), scheme) &&
+            wildcardCompare(DPL::ToUTF8String(it->host), host))
+        {
+            return true;
+        }
+    }
+    WrtLogE("deny");
+    return false;
+}
+
+bool preventSymlink(const std::string & url)
+{
+    if(0 != strncmp(url.c_str(), SCHEME_TYPE_FILE, strlen(SCHEME_TYPE_FILE)))
+    {
+        return true;
+    }
+
+    if(url.size() >= strlen(SCHEME_TYPE_FILE) + 3)
+    {
+        std::string file = url.substr(strlen(SCHEME_TYPE_FILE) + 3);
+        struct stat st;
+        if(0 != stat(file.c_str(), &st)) return true;
+        return !S_ISLNK(st.st_mode);
+    }
+    else
+    {
+        return true;
+    }
+}
+} // namespace (anonymous)
+
+namespace InjectedBundleURIHandling {
+bool processURI(const std::string& inputURI,
+                const DPL::String& tizenId,
+                WrtDB::WidgetSecurityModelVersion version)
+{
+    if (version == WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V1)
+    {
+        if (!checkWARP(inputURI.c_str(), tizenId)) {
+            WrtLogE("Request was blocked by WARP: %s", inputURI.c_str());
+            return false;
+        }
+    }
+
+    // disable for performance
+    // if (!preventSymlink(inputURI)) {
+    //     WrtLogW("Request for symlink is invalid: %s", inputURI.c_str());
+    //     return false;
+    //}
+
+    return true;
+}
+
+bool processURI(const DPL::String& inputURI,
+                const DPL::String& tizenId,
+                WrtDB::WidgetSecurityModelVersion version)
+{
+    DPL::OptionalString optionalUri(inputURI);
+    if (!optionalUri) {
+        WrtLogD("uri is empty");
+        return true;
+    }
+
+    std::string uri = DPL::ToUTF8String(inputURI);
+    return processURI(uri, tizenId, version);
+}
+
+bool processMainResource(const DPL::String& inputURI,
+                         const DPL::String& tizenId,
+                         WrtDB::WidgetSecurityModelVersion version)
+{
+    DPL::OptionalString optionalUri(inputURI);
+    if (!optionalUri) {
+        WrtLogD("uri is empty");
+        return true;
+    }
+
+    std::string uri = DPL::ToUTF8String(inputURI);
+    if (version ==
+        WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V1)
+    {
+        if (!checkWARP(uri.c_str(), tizenId)) {
+            WrtLogE("Request was blocked by WARP: %s", uri.c_str());
+            return false;
+        }
+    } else if (version ==
+        WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V2)
+    {
+#if ENABLE(ALLOW_NAVIGATION)
+        if (!checkAllowNavigation(uri.c_str(), tizenId)) {
+            WrtLogE("Request was blocked by allow-navigation: %s", uri.c_str());
+            return false;
+        }
+#else
+        return false;
+#endif
+    }
+
+    // disable for performance
+    // if (!preventSymlink(uri)) {
+    //     WrtLogW("Request for symlink is invalid: %s", uri.get().c_str());
+    //     return false;
+    // }
+    return true;
+}
+
+bool processURIForPlugin(const char* url)
+{
+    return checkWhitelist(url);
+}
+
+std::string localizeURI(const std::string& inputURI, const std::string& tizenId)
+{
+    if (inputURI.compare(0, strlen(SCHEME_TYPE_WIDGET), SCHEME_TYPE_WIDGET) &&
+        inputURI.compare(0, strlen(SCHEME_TYPE_FILE), SCHEME_TYPE_FILE) &&
+        inputURI.compare(0, strlen(SCHEME_TYPE_APP), SCHEME_TYPE_APP))
+    {
+        WrtLogD("scheme doesn't need to localize");
+        return inputURI;
+    }
+
+    std::string localizedURI = W3CFileLocalization::getFilePathInWidgetPackageFromUrl(tizenId, inputURI);
+
+    if (localizedURI.empty()) {
+        return inputURI;
+    } else {
+        return std::string("file://") + localizedURI;
+    }
+}
+
+DPL::OptionalString localizeURI(const DPL::String& inputURI,
+                                const DPL::String& tizenId)
+{
+    std::string uri = DPL::ToUTF8String(inputURI);
+    const char* urlcstr = uri.c_str();
+    const char *end = strstr(urlcstr, ":");
+    if (!end) {
+        WrtLogW("no schema in link, return null");
+        return DPL::OptionalString();
+    }
+    std::string scheme(urlcstr, end);
+
+#if ENABLE(APP_SCHEME)
+    if (scheme != SCHEME_TYPE_WIDGET && scheme != SCHEME_TYPE_FILE && scheme != SCHEME_TYPE_APP) {
+#else
+    if (scheme != SCHEME_TYPE_WIDGET && scheme != SCHEME_TYPE_FILE) {
+#endif
+        WrtLogD("scheme doesn't need to localize");
+        return DPL::OptionalString(inputURI);
+    }
+
+    DPL::OptionalString found =
+        W3CFileLocalization::getFilePathInWidgetPackageFromUrl(
+            tizenId,
+            DPL::FromUTF8String(uri));
+
+    if (!found) {
+        // In this case, path doesn't need to localize. return input uri
+        WrtLogW("Path not found within current locale in current widget");
+        return DPL::OptionalString(inputURI);
+    } else {
+        DPL::String uri(L"file://" + *found);
+        WrtLogD("Will load resource: %s", DPL::ToUTF8String(uri).c_str());
+        return DPL::OptionalString(uri);
+    }
+}
+} // namespace InjectedBundleURIHandling
diff --git a/src/view/webkit/injected-bundle/injected_bundle_uri_handling.h b/src/view/webkit/injected-bundle/injected_bundle_uri_handling.h
new file mode 100644 (file)
index 0000000..b981c3d
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    injected_bundle_uri_handling.h
+ * @author  Marcin Kaminski (marcin.ka@samsung.com)
+ * @version 1.0
+ */
+#ifndef INJECTED_BUNDLE_URI_HANDLING_H_
+#define INJECTED_BUNDLE_URI_HANDLING_H_
+
+#include <dpl/string.h>
+#include <dpl/optional_typedefs.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+
+namespace InjectedBundleURIHandling {
+bool processURI(const DPL::String& inputURI,
+                const DPL::String& tizenId,
+                WrtDB::WidgetSecurityModelVersion m_securityModelVersion);
+bool processURI(const std::string& inputURI,
+                const DPL::String& tizenId,
+                WrtDB::WidgetSecurityModelVersion version);
+bool processMainResource(const DPL::String& inputURI,
+                const DPL::String& tizenId,
+                WrtDB::WidgetSecurityModelVersion m_securityModelVersion);
+bool processURIForPlugin(const char* url);
+DPL::OptionalString localizeURI(const DPL::String& inputURI,
+                                const DPL::String& tizenId);
+std::string localizeURI(const std::string& inputURI, const std::string& tizenId);
+}
+
+#endif // INJECTED_BUNDLE_URI_HANDLING_H_
diff --git a/src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.cpp b/src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.cpp
new file mode 100644 (file)
index 0000000..902006a
--- /dev/null
@@ -0,0 +1,231 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file    injected_bundle_viewmodes_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+
+#include "injected_bundle_viewmodes_support.h"
+
+#include <memory>
+#include <map>
+#include <set>
+#include <string>
+
+#include <dpl/log/wrt_log.h>
+#include <dpl/assert.h>
+#include <dpl/string.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+
+#include <WKString.h>
+#include <WKBundlePage.h>
+#include <WKBundlePagePrivate.h>
+
+namespace InjectedBundle {
+namespace {
+const std::string VIEWMODE_TYPE_MAXIMIZED = "maximized";
+const std::string VIEWMODE_TYPE_FULLSCREEN = "fullscreen";
+const std::string VIEWMODE_TYPE_WINDOWED = "windowed";
+
+typedef std::set<std::string> SupportViewmodesSet;
+SupportViewmodesSet g_supportViewmodes = {VIEWMODE_TYPE_MAXIMIZED,
+                                          VIEWMODE_TYPE_FULLSCREEN,
+                                          VIEWMODE_TYPE_WINDOWED};
+}
+
+//Implementation class
+class ViewmodesSupportImplementation
+{
+  private:
+    typedef std::map<WKBundlePageRef, std::string> ViewmodesMap;
+    typedef ViewmodesMap::iterator ViewmodesIt;
+
+    bool m_initialized;
+
+    WrtDB::TizenAppId m_appId;
+    WrtDB::WindowModeList m_modeList;
+    ViewmodesMap m_initialViewmodeMap;
+    ViewmodesMap m_currentViewmodeMap;
+
+    bool isExisted(WKBundlePageRef page)
+    {
+        ViewmodesIt viewmodeIt = m_initialViewmodeMap.find(page);
+        if (viewmodeIt == m_initialViewmodeMap.end()) {
+            return false;
+        }
+        return true;
+    }
+
+    std::string getChangedViewmode(void)
+    {
+        if (!m_currentViewmodeMap.empty()) {
+            ViewmodesIt curIt = m_currentViewmodeMap.begin();
+            ViewmodesIt initIt = m_initialViewmodeMap.begin();
+            if (curIt->second != initIt->second) {
+              return curIt->second;
+            }
+        }
+        return std::string();
+    }
+
+    bool isSupportViewmode(const std::string& mode)
+    {
+        if (g_supportViewmodes.find(mode) == g_supportViewmodes.end()) {
+            return false;
+        }
+        return true;
+    }
+
+  public:
+    ViewmodesSupportImplementation(WrtDB::TizenAppId appId) :
+        m_initialized(false),
+        m_appId(appId)
+    {
+        WrtDB::WidgetDAOReadOnly dao(m_appId);
+        m_modeList = dao.getWindowModes();
+
+        m_initialized = true;
+    }
+
+    void initialize(WKBundlePageRef page)
+    {
+        WrtLogD("initialize");
+        if (!m_initialized) {
+            Assert(false);
+        }
+
+        if (isExisted(page)) {
+            WrtLogW("This page is already initialized");
+            return;
+        }
+
+        // set initial viewmode from manifest
+        std::string initViewmode = VIEWMODE_TYPE_MAXIMIZED;
+        FOREACH(it, m_modeList) {
+            std::string mode = DPL::ToUTF8String(*it);
+            if (g_supportViewmodes.find(mode) != g_supportViewmodes.end()) {
+                initViewmode = mode;
+            }
+        }
+        m_initialViewmodeMap[page] = initViewmode;
+
+        // In case of current viewmode of chrome is changed,
+        // set to changed viewmode
+        std::string currentViewmode = getChangedViewmode();
+        if (currentViewmode.empty()) {
+            currentViewmode = initViewmode;
+        }
+        m_currentViewmodeMap[page] = currentViewmode;
+
+        WKBundlePageSetViewMode(page,
+                                WKStringCreateWithUTF8CString(
+                                currentViewmode.c_str()));
+    }
+
+    void deinitialize(WKBundlePageRef page)
+    {
+        WrtLogD("deinitialize");
+        if (!m_initialized) {
+            Assert(false);
+        }
+        m_initialViewmodeMap.erase(page);
+        m_currentViewmodeMap.erase(page);
+    }
+
+    void setViewmodes(WKBundlePageRef page, const std::string& mode)
+    {
+        if (!m_initialized) {
+            Assert(false);
+        }
+
+        m_currentViewmodeMap[page] = mode;
+        WKBundlePageSetViewMode(page,
+                                WKStringCreateWithUTF8CString(
+                                    mode.c_str()));
+    }
+
+    void enterViewmodesAllPages(const std::string& mode)
+    {
+        WrtLogD("setViewmodesAllPages");
+        if (!m_initialized) {
+            Assert(false);
+        }
+        if (!isSupportViewmode(mode)) {
+            WrtLogW("Wrong viewmode : %s", mode.c_str());
+            return;
+        }
+
+        FOREACH(it, m_currentViewmodeMap) {
+            setViewmodes(it->first, mode);
+        }
+    }
+
+    void exitViewmodes(WKBundlePageRef page)
+    {
+        if (!m_initialized) {
+            Assert(false);
+        }
+
+        std::string mode = m_initialViewmodeMap[page];
+        m_currentViewmodeMap[page] = mode;
+        WKBundlePageSetViewMode(page,
+                                WKStringCreateWithUTF8CString(
+                                    mode.c_str()));
+    }
+
+    void exitViewmodesAllPages(void)
+    {
+        WrtLogD("exitViewmodesAllPages");
+        if (!m_initialized) {
+            Assert(false);
+        }
+
+        FOREACH(it, m_currentViewmodeMap) {
+            exitViewmodes(it->first);
+        }
+    }
+};
+
+ViewmodesSupport::ViewmodesSupport(WrtDB::TizenAppId appId) :
+    m_impl(new ViewmodesSupportImplementation(appId))
+{
+}
+
+ViewmodesSupport::~ViewmodesSupport()
+{
+}
+
+void ViewmodesSupport::initialize(WKBundlePageRef page)
+{
+    m_impl->initialize(page);
+}
+
+void ViewmodesSupport::deinitialize(WKBundlePageRef page)
+{
+    m_impl->deinitialize(page);
+}
+
+void ViewmodesSupport::enterViewmodesAllPages(const std::string& mode)
+{
+    m_impl->enterViewmodesAllPages(mode);
+}
+
+void ViewmodesSupport::exitViewmodesAllPages(void)
+{
+    m_impl->exitViewmodesAllPages();
+}
+}  // namespace InjectedBundle
diff --git a/src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.h b/src/view/webkit/injected-bundle/injected_bundle_viewmodes_support.h
new file mode 100644 (file)
index 0000000..da1521b
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    injected_bundle_viewmodes_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @version 1.0
+ */
+#ifndef INJECTED_BUNDLE_VIEWMODES_SUPPORT_H_
+#define INJECTED_BUNDLE_VIEWMODES_SUPPORT_H_
+
+#include <memory>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+
+#include <WKBundlePage.h>
+
+namespace InjectedBundle {
+class ViewmodesSupportImplementation;
+
+class ViewmodesSupport
+{
+  public:
+    ViewmodesSupport(WrtDB::TizenAppId appId);
+    virtual ~ViewmodesSupport();
+    void initialize(WKBundlePageRef page);
+    void deinitialize(WKBundlePageRef page);
+    void enterViewmodesAllPages(const std::string& mode);
+    void exitViewmodesAllPages(void);
+  private:
+    std::unique_ptr<ViewmodesSupportImplementation> m_impl;
+};
+} // namespace InjectedBundle
+
+#endif // INJECTED_BUNDLE_VIEWMODES_SUPPORT_H_
\ No newline at end of file
diff --git a/src/view/webkit/injected-bundle/page_global_context_container.cpp b/src/view/webkit/injected-bundle/page_global_context_container.cpp
new file mode 100644 (file)
index 0000000..343fb03
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file page_global_context_container.cpp
+ * @author Tomasz Iwanek (t.iwanek@smasung.com)
+ * @brief Declares container for global context that holds its references
+ */
+#include "page_global_context_container.h"
+
+#include <dpl/foreach.h>
+
+PageGlobalContextContainer::PageGlobalContextContainer()
+{
+}
+
+PageGlobalContextContainer::~PageGlobalContextContainer()
+{
+    FOREACH(iter, m_map)
+    {
+        JSGlobalContextRelease(iter->second);
+    }
+}
+
+void PageGlobalContextContainer::insertContextForPage(WKBundlePageRef page, JSGlobalContextRef context)
+{
+    PageGlobalContext::iterator iter = m_map.find(page);
+    if(iter != m_map.end())
+    {
+        JSGlobalContextRelease(m_map[page]);
+    }
+    JSGlobalContextRetain(context);
+    m_map[page] = context;
+}
+
+void PageGlobalContextContainer::removeContextForPage(WKBundlePageRef page)
+{
+    PageGlobalContext::iterator iter = m_map.find(page);
+    if(iter != m_map.end())
+    {
+        JSGlobalContextRelease(m_map[page]);
+    }
+    m_map.erase(iter);
+}
+
+JSGlobalContextRef PageGlobalContextContainer::getContextForPage(WKBundlePageRef page) const
+{
+    return m_map.find(page)->second;
+}
+
+PageGlobalContextContainer::const_iterator PageGlobalContextContainer::begin() const
+{
+    return m_map.begin();
+}
+PageGlobalContextContainer::const_iterator PageGlobalContextContainer::find(WKBundlePageRef ref) const
+{
+    return m_map.find(ref);
+}
+PageGlobalContextContainer::const_iterator PageGlobalContextContainer::end() const
+{
+    return m_map.end();
+}
diff --git a/src/view/webkit/injected-bundle/page_global_context_container.h b/src/view/webkit/injected-bundle/page_global_context_container.h
new file mode 100644 (file)
index 0000000..1ef3499
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file page_global_context_container.h
+ * @author Tomasz Iwanek (t.iwanek@smasung.com)
+ * @brief Declares container for global context that holds its references
+ */
+#ifndef PAGE_GLOBAL_CONTEXT_CONTAINER_H
+#define PAGE_GLOBAL_CONTEXT_CONTAINER_H
+
+#include <map>
+
+#include <JavaScriptCore/JSContextRef.h>
+#include <WKBundlePage.h>
+
+/**
+ * @brief The PageGlobalContextContainer class
+ *
+ * Container for global contexts that increments reference for holded elements
+ */
+class PageGlobalContextContainer
+{
+public:
+    typedef std::map<WKBundlePageRef, JSGlobalContextRef> PageGlobalContext;
+    typedef PageGlobalContext::iterator iterator;
+    typedef PageGlobalContext::const_iterator const_iterator;
+    typedef PageGlobalContext::value_type value_type;
+
+    PageGlobalContextContainer();
+    ~PageGlobalContextContainer();
+
+    PageGlobalContextContainer(const PageGlobalContextContainer&) = delete;
+    PageGlobalContextContainer& operator=(const PageGlobalContextContainer&) = delete;
+
+    void insertContextForPage(WKBundlePageRef page, JSGlobalContextRef context);
+    void removeContextForPage(WKBundlePageRef page);
+    /**
+     * @brief getContextForPage gets context for given page
+     * @param page wk page
+     * Page should be valid for container.
+     * If you don't know if page is present in container use find
+     *
+     * @return context
+     */
+    JSGlobalContextRef getContextForPage(WKBundlePageRef page) const;
+
+    const_iterator begin() const;
+    const_iterator find(WKBundlePageRef ref) const;
+    const_iterator end() const;
+private:
+    PageGlobalContext m_map;
+};
+
+#endif // PAGE_GLOBAL_CONTEXT_CONTAINER_H
diff --git a/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp b/src/view/webkit/injected-bundle/wrt-injected-bundle.cpp
new file mode 100644 (file)
index 0000000..c6f1425
--- /dev/null
@@ -0,0 +1,1260 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    wrt-injected-bundle.cpp
+ * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @brief   Implementation file for injected bundle
+ */
+#include "wrt-injected-bundle.h"
+
+#include <WKBundle.h>
+#include <WKBundleInitialize.h>
+#include <WKBundlePage.h>
+#include <WKBundleFrame.h>
+#include <WKURLRequest.h>
+#include <WKString.h>
+#include <WKType.h>
+#include <WKURL.h>
+#include <WKError.h>
+#include <WKURLResponseTizen.h>
+#include <WKBundlePagePrivate.h>
+#include <WKBundlePrivate.h>
+
+#include <string>
+#include <cstdio>
+#include <sstream>
+#include <set>
+#include <memory>
+
+#include <dpl/foreach.h>
+#include <dpl/assert.h>
+#include <dpl/wrt-dao-ro/WrtDatabase.h>
+#include <dpl/localization/localization_utils.h>
+#include <dpl/string.h>
+#include <dpl/wrt-dao-ro/global_config.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include <dpl/localization/LanguageTagsProvider.h>
+#include <dpl/event/main_event_dispatcher.h>
+#include <dpl/platform.h>
+#include <dpl/log/wrt_log.h>
+#include <profiling_util.h>
+
+#include <appcore-efl.h>
+
+#include <message_support.h>
+
+#include <scheme.h>
+#include <scheme_action_map_type.h>
+#include <scheme_action_map_data.h>
+
+#include <js_overlay_types.h>
+#include <dispatch_event_support.h>
+#include <plugins-ipc-message/ipc_message_support.h>
+
+#include <sys/prctl.h>
+#include <sys/resource.h>
+#include <privilege-control.h>
+#include <smack_labeling_support.h>
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+#include <app_sock.h>
+#include <appsvc.h>
+#include <sys/smack.h>
+#include <sys/capability.h>
+#endif
+
+// URI localization on WebProcess side
+#include "injected_bundle_uri_handling.h"
+#include "injected_bundle_decryption_support.h"
+#include "injected_bundle_plugin_interface.h"
+#include "injected_bundle_viewmodes_support.h"
+
+namespace {
+const char SCHEME_HTTP[] = "http";
+const char SCHEME_HTTPS[] = "https";
+const char SCHEME_FILE[] = "file";
+const char SCHEME_FILE_SLASH[] = "file://";
+const char SCHEME_BOX_SLASH[] = "box://";
+const char BLANK_PAGE_URL[] = "about:blank";
+const char SRC_DOC_PAGE_URL[] = "about:srcdoc";
+const char HTML_MIME[] = "text/html";
+const char PHP_MIME[] = "application/x-php";
+const char WRT_WILL_SEND_REQUEST_LOG_ENABLE[] = "WRT_WILL_SEND_REQUEST_LOG_ENABLE";
+const std::size_t FILE_BUF_MAX_SIZE = 1024; // bytes
+const std::size_t PLAIN_CHUNK_SIZE = 1008; // bytes
+const unsigned int UID_ROOT = 0;
+const unsigned int DEFAULT_PRIORITY = 0;
+const char PRIVILEGE_APP_TYPE[] = "wgt";
+#if ENABLE(CORS_WHITELISTING)
+const char * const warpAllowProtocolsForWildcard[] = { "http", "https" };
+#endif
+}
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+extern "C" void aul_finalize();
+#endif // ENABLE(ONE_UI_PROCESS_MODEL)
+
+Bundle::Bundle(WKBundleRef bundle) :
+    m_bundle(bundle),
+    m_scale(0),
+    m_encodedBundle(""),
+    m_theme(""),
+    m_willRemoveContext(NULL),
+    m_securityModelVersion(
+        WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V1),
+    m_initialized(false),
+    m_decryptionSupport(new InjectedBundle::DecryptionSupport())
+{
+    Try {
+        LOG_PROFILE_START("Bundle attachToThread");
+        WrtDB::WrtDatabase::attachToThreadRO();
+        LOG_PROFILE_STOP("Bundle attachToThread");
+    } Catch (DPL::DB::SqlConnection::Exception::Base) {
+        WrtLogE("## Db attach was failed! Terminate WebProcess by force. ##");
+        exit(-1);
+    }
+}
+
+Bundle::~Bundle()
+{
+    m_decryptionSupport->deinitialize();
+
+    WrtDB::WrtDatabase::detachFromThread();
+
+    if (!m_pagesList.empty()) {
+        WrtLogE("There are not closed pages!");
+    }
+    WKRelease(m_bundle);
+}
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+int Bundle::aul_handler(aul_type type,
+                        bundle *b,
+                        void *data)
+{
+    WrtLogD("aul_handler called");
+    int ret;
+    int dataLen;
+
+    if (b) {
+        if (!bundle_get_val(b, AUL_K_PKG_NAME)) {
+            Bundle *This = (Bundle *)data;
+            bundle_add(b, AUL_K_PKG_NAME, DPL::ToUTF8String(This->m_widgetTizenId).c_str());
+        }
+    } else {
+        b = bundle_create();
+        Bundle *This = (Bundle *)data;
+        bundle_add(b, AUL_K_PKG_NAME, DPL::ToUTF8String(This->m_widgetTizenId).c_str());
+    }
+
+    bundle_raw *bundleData;
+    bundle_encode(b, &bundleData, &dataLen);
+    switch (type) {
+    case AUL_START:
+        WrtLogD("Aul_handler AUL_START");
+        ret = SendMessagetoUI(APP_START, bundleData, dataLen);
+        break;
+    case AUL_RESUME:
+        WrtLogD("Aul_handler AUL_RESUME");
+        ret = SendMessagetoUI(APP_RESUME, bundleData, dataLen);
+        break;
+    case AUL_TERMINATE:
+        WrtLogD("Aul_handler AUL_TERMINATE");
+        ret = SendMessagetoUI(APP_TERM_BY_PID, bundleData, dataLen);
+        break;
+    default:
+        WrtLogD("Aul_handler Invalid Message");
+        /* do nothing */
+        break;
+    }
+    return 0;
+}
+
+void Bundle::initAULCommunication(std::string appPath, int argc, char** argv)
+{
+    WrtLogD("initAULCommunication");
+    if (aul_launch_init(aul_handler, this) < 0) {
+        WrtLogE("aul_launch_init() failed");
+    } else {
+        free(argv[0]);
+        argv[0] = strdup(appPath.c_str());
+        aul_launch_argv_handler(argc, argv);
+    }
+}
+
+void Bundle::dropProcessPoolCapability()
+{
+    WrtLogD("called");
+    cap_user_header_t header;
+    cap_user_data_t data;
+
+    header = static_cast<cap_user_header_t>(malloc(sizeof(*header)));
+    data = static_cast<cap_user_data_t>(calloc(sizeof(*data), _LINUX_CAPABILITY_U32S_3));
+
+    // check if header and data is allocated normally
+    Assert(header && data);
+
+    header->pid = getpid();
+    header->version = _LINUX_CAPABILITY_VERSION_3;
+
+    // read already granted capabilities of this process
+    if (capget(header, data) < 0) {
+        free(header);
+        free(data);
+        WrtLogE("capget failed!");
+        return;
+    }
+
+    // remove process capability for CAP_MAC_ADMIN
+    data[CAP_TO_INDEX(CAP_MAC_ADMIN)].inheritable &= ~CAP_TO_MASK(CAP_MAC_ADMIN);
+    data[CAP_TO_INDEX(CAP_MAC_ADMIN)].permitted &= ~CAP_TO_MASK(CAP_MAC_ADMIN);
+    data[CAP_TO_INDEX(CAP_MAC_ADMIN)].effective &= ~CAP_TO_MASK(CAP_MAC_ADMIN);
+
+    if (capset(header, data) < 0)
+        WrtLogE("capset failed!");
+
+    free(header);
+    free(data);
+}
+
+void Bundle::changeProcessPoolSmackLabel(const std::string& appPath)
+{
+    // check if this process is launched as abnormal way
+    char *currentExecutablePath = (char *)appPath.c_str();
+    WrtLogD("currentExecutablePath: %s", currentExecutablePath);
+    char* newLabel = NULL;
+    if (smack_lgetlabel(currentExecutablePath, &newLabel, SMACK_LABEL_EXEC) < 0){
+        WrtLogE("smack_lgetlabel failed");
+        dropProcessPoolCapability();
+        return;
+    }
+
+    if (smack_set_label_for_self(newLabel) < 0)
+        WrtLogE("smack_set_label_for_self failed");
+
+    free(newLabel);
+    dropProcessPoolCapability();
+}
+#endif // ENABLE(ONE_UI_PROCESS_MODEL)
+
+void Bundle::didCreatePageCallback(
+    WKBundleRef /*bundle*/,
+    WKBundlePageRef page,
+    const void* clientInfo)
+{
+    LOG_PROFILE_START("didCreatePageCallback");
+    Bundle* This = static_cast<Bundle*>(const_cast<void*>(clientInfo));
+    This->didCreatePage(page);
+    LOG_PROFILE_STOP("didCreatePageCallback");
+}
+
+void Bundle::didReceiveMessageCallback(
+    WKBundleRef /*bundle*/,
+    WKStringRef messageName,
+    WKTypeRef messageBody,
+    const void *clientInfo)
+{
+    Bundle* bundle = static_cast<Bundle*>(const_cast<void*>(clientInfo));
+    bundle->didReceiveMessage(messageName, messageBody);
+}
+
+void Bundle::willDestroyPageCallback(
+    WKBundleRef /*bundle*/,
+    WKBundlePageRef page,
+    const void* clientInfo)
+{
+    Bundle* This = static_cast<Bundle*>(const_cast<void*>(clientInfo));
+    This->willDestroyPage(page);
+}
+
+void Bundle::didCreatePage(WKBundlePageRef page)
+{
+    if (!m_initialized)
+    {
+        WrtLogE("## Injected-bundle was not initialized! Terminate WebProcess by force. ##");
+        willDestroyPage(page);
+        exit(-1);
+    }
+
+    auto mainFrame = WKBundlePageGetMainFrame(page);
+    auto context = WKBundleFrameGetJavaScriptContext(mainFrame);
+    m_pagesList.push_back(page);
+    m_pageGlobalContext.insertContextForPage(page, context);
+    WrtLogD("created Page and JSContext");
+    m_viewmodesSupport->initialize(page);
+
+    WKBundlePageResourceLoadClient resourceLoadClient = {
+        kWKBundlePageResourceLoadClientCurrentVersion,  /* version */
+        this, /* clientinfo */
+        0, /* didInitiateLoadForResource */
+        willSendRequestForFrameCallback, /* willSendRequestForFrame */
+        0, /* didReceiveResponseForResource */
+        0, /* didReceiveContentLengthForResource */
+        0, /* didFinishLoadForResource */
+        0, /* didFailLoadForResource */
+        0, /* shouldCacheResponse */
+        0, /* shouldUseCredentialStorage */
+    };
+    WKBundlePageSetResourceLoadClient(page, &resourceLoadClient);
+
+    WKBundlePageLoaderClient loaderClient = {
+        kWKBundlePageLoaderClientCurrentVersion,
+        this, /* clientinfo */
+        didStartProvisionalLoadForFrameCallback, /* didStartProvisionalLoadForFrame */
+        0, /* didReceiveServerRedirectForProvisionalLoadForFrame */
+        0, /* didFailProvisionalLoadWithErrorForFrame */
+        didCommitLoadForFrameCallback, /* didCommitLoadForFrame */
+        0, /* didFinishDocumentLoadForFrame */
+        0, /* didFinishLoadForFrame */
+        0, /* didFailLoadWithErrorForFrame */
+        0, /* didSameDocumentNavigationForFrame */
+        0, /* didReceiveTitleForFrame */
+        0, /* didFirstLayoutForFrame */
+        0, /* didFirstVisuallyNonEmptyLayoutForFrame */
+        didRemoveFrameFromHierarchyCallback, /* didRemoveFrameFromHierarchy */
+        0, /* didDisplayInsecureContentForFrame */
+        0, /* didRunInsecureContentForFrame */
+        0, /* didClearWindowObjectForFrame */
+        0, /* didCancelClientRedirectForFrame */
+        0, /* willPerformClientRedirectForFrame */
+        0, /* didHandleOnloadEventsForFrame */
+        0, /* didLayoutForFrame */
+        0, /* didNewFirstVisuallyNonEmptyLayout */
+        0, /* didDetectXSSForFrame */
+        0, /* shouldGoToBackForwardListItem */
+        0, /* globalObjectIsAvailableForFrame */
+        0, /* willDisconnectDOMWindowExtensionFromGlobalObject */
+        0, /* didReconnectDOMWindowExtensionToGlobalObject */
+        0, /* willDestroyGlobalObjectForDOMWindowExtension */
+        0, /* didFinishProgress */
+        0, /* shouldForceUniversalAccessFromLocalURL */
+        0, /* didReceiveIntentForFrame */
+        0, /* registerIntentServiceForFrame */
+    };
+    WKBundlePageSetPageLoaderClient(page, &loaderClient);
+
+
+    WKBundlePagePolicyClient policyClient = {
+        kWKBundlePagePolicyClientCurrentVersion, /* version */
+        this,                                    /* clientInfo */
+        decidePolicyForNavigationActionCallback, /* decidePolicyForNavigationAction */
+        decidePolicyForNewWindowActionCallback,  /* decidePolicyForNavigationAction */
+        decidePolicyForResponseCallback,         /* decidePolicyForResponse */
+        0,                                       /* unableToImplementPolicy */
+    };
+    WKBundlePageSetPolicyClient(page, &policyClient);
+}
+
+void Bundle::willDestroyPage(WKBundlePageRef page)
+{
+    WrtLogD("Destroyed page");
+
+    auto context = m_pageGlobalContext.getContextForPage(page);
+    m_pagesList.remove(page);
+    m_pageGlobalContext.removeContextForPage(page);
+    m_pageContext[page].erase(context);
+    m_viewmodesSupport->deinitialize(page);
+
+    InjectedBundlePluginInterface::unloadFrame(context);
+    InjectedBundlePluginInterface::stop(context);
+}
+
+void Bundle::fixWKMessageArgs(std::string & argScale,
+                              std::string & argEncodedBundle,
+                              std::string & argTheme)
+{
+    if (argScale != "null" && argScale[0] == '_') {
+        argScale.erase(0, 1);
+
+        std::stringstream ssScale(argScale);
+        ssScale >> m_scale;
+    }
+
+    if (argEncodedBundle != "null" && argEncodedBundle[0] == '_') {
+        argEncodedBundle.erase(0, 1);
+
+        m_encodedBundle = argEncodedBundle;
+    }
+
+    if (argTheme != "null" && argTheme[0] == '_') {
+        argTheme.erase(0, 1);
+
+        m_theme = argTheme;
+    }
+}
+
+#if ENABLE(CORS_WHITELISTING)
+void Bundle::bypassCORSforWARPAccessList(WrtDB::WidgetDAOReadOnly & dao)
+{
+    // bypassing CORS using origin whitelist
+    WrtDB::WidgetAccessInfoList WAList;
+    dao.getWidgetAccessInfo(WAList);
+    FOREACH(it, WAList)
+    {
+        const WrtDB::WidgetAccessInfo & access = *it;
+        WKURLRef url = WKURLCreateWithUTF8CString(DPL::ToUTF8String(access.strIRI).c_str());
+
+#if ENABLE(APP_SCHEME)
+        std::string source = std::string("app://") + DPL::ToUTF8String(m_widgetTizenId) + "/";
+#else
+        std::string source = DPL::ToUTF8String(dao.getFullPath());
+#endif
+
+        WrtLogD("WARP to WK whitelist position: %s for %s subDomains: %d",
+           source.c_str(),
+           DPL::ToUTF8String(access.strIRI).c_str(),
+           access.bSubDomains);
+
+        WKStringRef wkSource = WKStringCreateWithUTF8CString(source.c_str());
+        WKStringRef wkHost;
+        WKStringRef wkProtocol;
+        if(access.strIRI == L"*")
+        {
+            //wildcard force to explicitly say which protocol is used
+            // passed wkHost if empty means wildcard -> allow everything but protocol has to be set.
+            for(unsigned i = 0; i < sizeof(warpAllowProtocolsForWildcard) / sizeof(char*); i++)
+            {
+                wkHost = WKStringCreateWithUTF8CString("");
+                wkProtocol = WKStringCreateWithUTF8CString(warpAllowProtocolsForWildcard[i]);
+                WKBundleAddOriginAccessWhitelistEntry(m_bundle,
+                    wkSource, wkProtocol, wkHost, access.bSubDomains);
+            }
+        }
+        else
+        {
+            wkHost = WKURLCopyHostName(url);
+            wkProtocol = WKURLCopyScheme(url);
+            WKBundleAddOriginAccessWhitelistEntry(m_bundle,
+                wkSource, wkProtocol, wkHost, access.bSubDomains);
+        }
+
+        WKRelease(wkHost);
+        WKRelease(wkProtocol);
+        WKRelease(wkSource);
+    }
+}
+#endif
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+static int getInitMessage(std::string inputBuffer, char ***argv)
+{
+    std::stringstream ssMsg(inputBuffer);
+    std::string argcStr;
+    ssMsg >> argcStr;
+    std::string::size_type sz;
+    int argc = std::stoi(argcStr, &sz);
+
+    std::string output;
+    *argv = (char**)calloc(argc + 1, sizeof(char*));
+    for (int ittr = 0; ittr < argc; ++ittr) {
+        ssMsg >> output;
+        (*argv)[ittr] = strdup(output.c_str());
+    }
+    return argc;
+}
+
+static void decodeAndSendReply(std::string inputBuffer)
+{
+    if (inputBuffer.empty()) {
+        return;
+    }
+    WrtLogD("Input = %s", inputBuffer.c_str());
+    std::stringstream ssMsg(inputBuffer);
+    // Extract port number
+    std::string portNum;
+    ssMsg >> portNum;
+
+    // Extract the argv count
+    std::string argcStr;
+    ssMsg >> argcStr;
+    std::string::size_type sz;
+    int argc = std::stoi(argcStr, &sz);
+
+    // Generate argv from string buffer to create bundle
+    std::string output;
+    char **argv;
+    argv = (char**)calloc(argc + 1, sizeof(char*));
+    for (int ittr = 0; ittr < argc; ++ittr) {
+        ssMsg >> output;
+        argv[ittr] = strdup(output.c_str());
+    }
+    bundle* b = bundle_import_from_argv(argc, argv);
+
+    // Free argv as bundle got created
+    if (argv) {
+        for (int ittr = 0; ittr < argc; ++ittr) {
+            free(argv[ittr]);
+        }
+        free(argv);
+    }
+
+    bundle* request = NULL;
+    if (appsvc_create_result_bundle(b, &request) != APPSVC_RET_OK) {
+        WrtLogW("Fail to create result bundle");
+        return;
+    }
+
+    if (appsvc_add_data(request, "port", portNum.c_str()) != APPSVC_RET_OK) {
+        WrtLogW("Fail to add data");
+        bundle_free(request);
+        return;
+    }
+
+    if (appsvc_send_result(request, APPSVC_RES_OK) != APPSVC_RET_OK) {
+        WrtLogW("Fail to send result");
+        bundle_free(request);
+        return;
+    }
+
+    bundle_free(request);
+    return;
+}
+#endif
+
+void Bundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
+{
+    WrtLogD("message name: %s", toString(messageName).c_str());
+    if (WKStringIsEqualToUTF8CString(messageName,
+                                     Message::ToInjectedBundle::START))
+    {
+        if (!messageBody || WKStringGetTypeID() != WKGetTypeID(messageBody)) {
+            WrtLogE("Wrong message format received, ignoring");
+            return;
+        }
+
+        std::string msgString =
+            toString(static_cast<WKStringRef>(messageBody));
+        WrtLogD("message body: %s", msgString.c_str());
+        // set information from ui process
+        std::stringstream ssMsg(msgString);
+        std::string argScale;
+        std::string argEncodedBundle;
+        std::string argTheme;
+
+        std::string id;
+        ssMsg >> id;
+        m_widgetTizenId = DPL::FromASCIIString(id);
+
+        ssMsg >> argScale;
+        ssMsg >> argEncodedBundle;
+        ssMsg >> argTheme;
+
+        // ** Language tags setting completed **
+        fixWKMessageArgs(argScale, argEncodedBundle, argTheme);
+    } else if (WKStringIsEqualToUTF8CString(messageName,
+                                            Message::ToInjectedBundle::SHUTDOWN))
+    {
+        if (m_pagesList.empty()) {
+            WrtLogD("shutdown plugins");
+            InjectedBundlePluginInterface::shutdown();
+        } else {
+            WrtLogD("InjectedBundlePluginInterface shutdown ignored, there are still alive pages!");
+        }
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+        // TODO: WebProcess does not disappear even Ewk_Context is removed
+        // Need to check by Webkit team
+        ecore_main_loop_quit();
+#endif
+    }
+    else if (WKStringIsEqualToUTF8CString(messageName,
+                                          Message::ToInjectedBundle::SET_CUSTOM_PROPERTIES))
+    {
+        // set information from ui process
+        std::string msgString =
+            toString(static_cast<WKStringRef>(messageBody));
+        WrtLogD("message body: %s", msgString.c_str());
+        std::string argScale;
+        std::string argEncodedBundle;
+        std::string argTheme;
+
+        std::stringstream ssMsg(msgString);
+        ssMsg >> argScale;
+        ssMsg >> argEncodedBundle;
+        ssMsg >> argTheme;
+
+        fixWKMessageArgs(argScale, argEncodedBundle, argTheme);
+
+        //apply for each context
+        PageGlobalContextContainer::const_iterator it = m_pageGlobalContext.begin();
+        for (; it != m_pageGlobalContext.end(); ++it) {
+            InjectedBundlePluginInterface::setCustomProperties(it->second,
+                                              m_scale,
+                                              m_encodedBundle.c_str(),
+                                              m_theme.c_str());
+        }
+    } else if (WKStringIsEqualToUTF8CString(
+                   messageName,
+                   Message::ToInjectedBundle::DISPATCH_JS_EVENT))
+    {
+        WrtLogD("dispatch javascript event to created frames");
+        using namespace WrtPlugins::W3C;
+
+        // set information from ui process
+        std::string text = toString(static_cast<WKStringRef>(messageBody));
+        int eventType;
+        SoftKeyboardChangeArgs softKeyboardArgs;
+
+        std::stringstream ss(text);
+        ss >> eventType;
+
+        if (eventType == SoftKeyboardChangeCustomEvent)
+        {
+            ss >> softKeyboardArgs.state;
+            ss >> softKeyboardArgs.width;
+            ss >> softKeyboardArgs.height;
+        }
+
+        //apply for each context
+        PageGlobalContextContainer::const_iterator it = m_pageGlobalContext.begin();
+
+        for (; it != m_pageGlobalContext.end(); ++it)
+        {
+            if (eventType == SoftKeyboardChangeCustomEvent)
+            {
+                DispatchEventSupport::dispatchSoftKeyboardChangeEvent(it->second,
+                                                    softKeyboardArgs.state,
+                                                    softKeyboardArgs.width,
+                                                    softKeyboardArgs.height);
+            }
+        }
+    } else if (WKStringIsEqualToUTF8CString(
+                   messageName,
+                   Message::ToInjectedBundle::INIT))
+    {
+        if (!m_initialized) {
+            WrtLogD("initialize");
+            std::string msgString = toString(static_cast<WKStringRef>(messageBody));
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+            char **argv;
+            int argc = getInitMessage(msgString, &argv);
+            m_widgetTizenId = DPL::FromASCIIString(std::string(argv[0]));
+#else
+            m_widgetTizenId = DPL::FromASCIIString(msgString);
+#endif
+            WrtDB::WidgetDAOReadOnly dao(m_widgetTizenId);
+
+            using namespace WrtDB::GlobalConfig;
+
+            std::string appPath;
+            std::string tzAppId = DPL::ToUTF8String(dao.getTizenAppId());
+            std::string tzPkgId = DPL::ToUTF8String(dao.getTizenPkgId());
+            DPL::OptionalString installedPath = dao.getWidgetInstalledPath();
+            if (!installedPath) {
+                appPath = std::string(GetUserInstalledWidgetPath()) + "/" +
+                    tzPkgId + GetUserWidgetExecPath() + "/" + tzAppId;
+            } else {
+                appPath = DPL::ToUTF8String(*installedPath) +
+                    GetUserWidgetExecPath() + "/" + tzAppId;
+            }
+
+            // process pool - set app_privilige
+            if (UID_ROOT == getuid()) {
+
+                WrtLogD("set_app_smack_label(%s)", appPath.c_str());
+                if (set_app_smack_label(appPath.c_str()) != 0) {
+                    WrtLogE("set_app_smack_label() failed");
+                }
+
+                WrtLogD("perm_app_set_privilege(%s)", appPath.c_str());
+                perm_app_set_privilege(tzPkgId.c_str(), PRIVILEGE_APP_TYPE, appPath.c_str());
+
+                // set process name
+                const int PR_NAME_LENGTH = 16;
+                std::string processName = tzAppId.substr(0, PR_NAME_LENGTH);
+                prctl(PR_SET_NAME, processName.c_str());
+            } else {
+                char procName[17];
+                prctl(PR_GET_NAME, procName, 0L, 0L, 0L);
+                if (!strcmp(procName,"WebProcess")) {
+                    // set process name
+                    const int PR_NAME_LENGTH = 16;
+                    std::string tzAppId = DPL::ToUTF8String(dao.getTizenAppId());
+                    std::string processName = tzAppId.substr(0, PR_NAME_LENGTH);
+                    prctl(PR_SET_NAME, processName.c_str());
+                }
+            }
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+            changeProcessPoolSmackLabel(appPath);
+            initAULCommunication(appPath, argc, argv);
+            if (argv) {
+                for (int ittr = 0; ittr < argc; ++ittr) {
+                    free(argv[ittr]);
+                }
+                free(argv);
+            }
+#endif
+            /* This type of message is received when widget is restarting
+             * (proably in other situation too). Widget restart can be
+             * called after system language change so language tags have to
+             * be recreated here.
+             * Do NOT MOVE LanguageTags reset before m_widgetHandle initialization
+             */
+            // reset language tags (create new tags based on system locales)
+            LanguageTagsProviderSingleton::Instance().resetLanguageTags();
+            DPL::OptionalString defaultLocale = dao.getDefaultlocale();
+            if (!!defaultLocale) {
+                LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(
+                    *defaultLocale);
+            }
+            LanguageTags tags =
+                LanguageTagsProviderSingleton::Instance().getLanguageTags();
+            WrtLogD("Current widget locales (language tags):");
+            FOREACH(it, tags) {
+                WrtLogD("Locale: %s", DPL::ToUTF8String(*it).c_str());
+            }
+
+            WrtLogD("Preload PluginLogicSingleton");
+            InjectedBundlePluginInterface::init(WrtDB::WidgetDAOReadOnly::getHandle(m_widgetTizenId));
+            WrtLogD("Preload PluginLogicSingleton_end");
+
+            m_securityModelVersion = dao.getSecurityModelVersion();
+#if ENABLE(CORS_WHITELISTING)
+            bypassCORSforWARPAccessList(dao);
+#endif
+            m_decryptionSupport->initialize(m_widgetTizenId);
+            m_viewmodesSupport.reset(
+                new InjectedBundle::ViewmodesSupport(m_widgetTizenId));
+            m_initialized = true;
+        } else {
+            WrtLogD("already initalized");
+        }
+    } else if (WKStringIsEqualToUTF8CString(
+                   messageName,
+                   Message::ToInjectedBundle::SET_XWINDOW_HANDLE))
+    {
+            std::string msgString =
+                toString(static_cast<WKStringRef>(messageBody));
+#if 0 // sub mode disable
+            WrtLogD("set x window handle [%s]", msgString.c_str());
+            IPCMessageSupport::setXwindowHandle(atoi(msgString.c_str()));
+#else
+            WrtLogD("sub mode is disabled, set x window handle [NULL]");
+#endif
+
+    } else if (WKStringIsEqualToUTF8CString(
+                   messageName,
+                   Message::ToInjectedBundle::SET_VIEWMODES))
+    {
+        std::string msgBody =
+            toString(static_cast<WKStringRef>(messageBody));
+        WrtLogD("set viewmode to [%s]", msgBody.c_str());
+        if (msgBody == Message::ToInjectedBundle::SET_VIEWMODES_MSGBODY_EXIT) {
+            m_viewmodesSupport->exitViewmodesAllPages();
+        } else {
+            m_viewmodesSupport->enterViewmodesAllPages(msgBody);
+        }
+    }
+    else if (WKStringIsEqualToUTF8CString(messageName, IPCMessageSupport::REPLY_ASYNC))
+    {
+        using namespace IPCMessageSupport;
+
+        std::string msgBody = toString(static_cast<WKStringRef>(messageBody));
+
+        if (msgBody.find_first_of('_') != std::string::npos) {
+            std::string strHandle = msgBody.substr(0, msgBody.find_first_of('_'));
+            std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1);
+
+            WrtLogD("handle: %s, , Body: %s", strHandle.c_str(), strBody.c_str());
+
+            int handle = atoi(strHandle.c_str());
+
+            AsyncConnectionPtr connection = AsyncConnectionManager::instance().getConnection(handle);
+
+            if (connection) {
+                if (connection->replyCallback) {
+                    WrtLogD("connection->replyCallback()");
+                    (connection->replyCallback)(handle, connection->data, strBody.c_str());
+                }
+
+                AsyncConnectionManager::instance().removeConnection(handle);
+            } else {
+                WrtLogD("Connection is not available. Ignored.");
+            }
+        }
+    }
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    else if (WKStringIsEqualToUTF8CString(messageName, Message::ToInjectedBundle::RESET_AUL_CONNECTION))
+    {
+        WrtLogD("reset aul connection");
+        aul_finalize();
+        aul_launch_init(aul_handler, this);
+    } else if (WKStringIsEqualToUTF8CString(messageName, Message::ToInjectedBundle::REPLY_CLIENT)) {
+        WrtLogD("Send Reply to ide client");
+        std::string msgBody = toString(static_cast<WKStringRef>(messageBody));
+        decodeAndSendReply(msgBody);
+    }
+#endif
+}
+
+WKURLRequestRef Bundle::willSendRequestForFrameCallback(
+    WKBundlePageRef /*page*/,
+    WKBundleFrameRef /*frame*/,
+    uint64_t /*resourceIdentifier*/,
+    WKURLRequestRef request,
+    WKURLResponseRef /*response*/,
+    const void *clientInfo)
+{
+    Bundle* This = static_cast<Bundle*>(const_cast<void*>(clientInfo));
+    WKURLRequestRef ret = This->willSendRequestForFrame(request);
+
+    return ret;
+}
+
+void Bundle::didStartProvisionalLoadForFrameCallback(
+    WKBundlePageRef page,
+    WKBundleFrameRef frame,
+    WKTypeRef* /*userData*/,
+    const void *clientInfo)
+{
+    WrtLogD("called");
+    Bundle* This = static_cast<Bundle*>(const_cast<void*>(clientInfo));
+
+    if (This->m_pageGlobalContext.find(page) == This->m_pageGlobalContext.end()) {
+        return;
+    }
+    if (This->m_pageContext.count(page) == 0) {
+        return;
+    }
+
+    JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+
+    ContextSet::iterator i = This->m_pageContext[page].find(context);
+
+    if (i == This->m_pageContext[page].end()) {
+        WrtLogD("Initially attached frame");
+        return;
+    }
+
+    This->m_pageContext[page].erase(i);
+    This->m_willRemoveContext = context;
+}
+
+void Bundle::didRemoveFrameFromHierarchyCallback(
+    WKBundlePageRef page,
+    WKBundleFrameRef frame,
+    WKTypeRef* /*userData*/,
+    const void *clientInfo)
+{
+    WrtLogD("called");
+    Bundle* This = static_cast<Bundle*>(const_cast<void*>(clientInfo));
+
+    if (This->m_pageContext.count(page) == 0) {
+        WrtLogD("his->m_pageContext.count(page) == 0");
+        return;
+    }
+
+    JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+
+    ContextSet::iterator i = This->m_pageContext[page].find(context);
+
+    if (i == This->m_pageContext[page].end()) {
+        WrtLogW("Tried to unload frame which has never been loaded");
+        return;
+    }
+
+    This->m_pageContext[page].erase(i);
+
+    InjectedBundlePluginInterface::unloadFrame(context);
+}
+
+void Bundle::didFinishLoadForResourceCallback(
+    WKBundlePageRef /*page*/,
+    WKBundleFrameRef /*frame*/,
+    uint64_t /*resourceIdentifier*/,
+    const void* /*clientInfo*/)
+{
+    WrtLogD("called");
+}
+
+void Bundle::didCommitLoadForFrameCallback(
+    WKBundlePageRef page,
+    WKBundleFrameRef frame,
+    WKTypeRef* /*userData*/,
+    const void *clientInfo)
+{
+    WrtLogD("called");
+    LOG_PROFILE_START("didCommitLoadForFrameCallback");
+    Bundle* This = static_cast<Bundle*>(const_cast<void*>(clientInfo));
+
+    WKURLRef url = WKBundleFrameCopyURL(frame);
+
+    if (url == NULL) {
+        WrtLogW("url is NULL");
+        return;
+    }
+
+    if (This->m_willRemoveContext) {
+        InjectedBundlePluginInterface::unloadFrame(This->m_willRemoveContext);
+        This->m_willRemoveContext = NULL;
+    }
+
+    JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+
+    This->m_pageContext[page].insert(context);
+    std::string urlStr = toString(url);
+
+    if (WKBundleFrameIsMainFrame(frame)) {
+        WrtLogD("Main frame");
+        if(This->m_pageGlobalContext.find(page) != This->m_pageGlobalContext.end())
+        {
+            WrtLogD("Previous context: %p", This->m_pageGlobalContext.getContextForPage(page));
+            InjectedBundlePluginInterface::stop(This->m_pageGlobalContext.getContextForPage(page));
+        }
+        WrtLogD("New context: %p", context);
+        //note that since we need old context for unloading plugins it must be sotred
+        //custom container take care of increamenting and decrementing references
+        This->m_pageGlobalContext.insertContextForPage(page, context);
+    }
+
+    if(InjectedBundleURIHandling::processURIForPlugin(urlStr.c_str())){
+        WrtLogD("start plugin");
+        LOG_PROFILE_START("InjectedBundlePluginInterface start");
+        InjectedBundlePluginInterface::start(
+            WrtDB::WidgetDAOReadOnly::getHandle(This->m_widgetTizenId),
+            context,
+            This->m_scale,
+            This->m_encodedBundle.c_str(),
+            This->m_theme.c_str() );
+        LOG_PROFILE_STOP("InjectedBundlePluginInterface start");
+
+        InjectedBundlePluginInterface::loadFrame(context);
+    }
+    LOG_PROFILE_STOP("didCommitLoadForFrameCallback");
+}
+
+WKBundlePagePolicyAction Bundle::decidePolicyForNavigationActionCallback(
+    WKBundlePageRef page,
+    WKBundleFrameRef frame,
+    WKBundleNavigationActionRef navigationAction,
+    WKURLRequestRef request,
+    WKTypeRef* userData,
+    const void* clientInfo)
+{
+    WrtLogD("called");
+    Bundle* This = static_cast<Bundle*>(const_cast<void*>(clientInfo));
+    return This->decidePolicyForAction(false,
+                                       page,
+                                       frame,
+                                       navigationAction,
+                                       request,
+                                       userData);
+}
+
+WKBundlePagePolicyAction Bundle::decidePolicyForNewWindowActionCallback(
+    WKBundlePageRef page,
+    WKBundleFrameRef frame,
+    WKBundleNavigationActionRef navigationAction,
+    WKURLRequestRef request,
+    WKStringRef /*frameName*/,
+    WKTypeRef* userData,
+    const void* clientInfo)
+{
+    WrtLogD("called");
+    Bundle* This = static_cast<Bundle*>(const_cast<void*>(clientInfo));
+    return This->decidePolicyForAction(true,
+                                       page,
+                                       frame,
+                                       navigationAction,
+                                       request,
+                                       userData);
+}
+
+WKBundlePagePolicyAction Bundle::decidePolicyForResponseCallback(
+    WKBundlePageRef /* page */,
+    WKBundleFrameRef /* frame */,
+    WKURLResponseRef response,
+    WKURLRequestRef /* request */,
+    WKTypeRef*          /* userData */,
+    const void*         /* clientInfo */)
+{
+    WrtLogD("called");
+    Assert(response);
+    WKStringRef contentTypeRef = WKURLResponseEflCopyContentType(response);
+
+    std::string contentType = toString(contentTypeRef);
+    WrtLogD("contentTypeRef : %s", contentType.c_str());
+    WKRelease(contentTypeRef);
+
+    if (contentType == HTML_MIME) {
+        WrtLogD("Accepting HTML_MIME type");
+        return WKBundlePagePolicyActionUse;
+    }
+    if (contentType == PHP_MIME) {
+        WrtLogD("Accepting php type");
+        return WKBundlePagePolicyActionUse;
+    }
+
+    return WKBundlePagePolicyActionPassThrough;
+}
+
+WKURLRequestRef Bundle::willSendRequestForFrame(WKURLRequestRef request)
+{
+    static bool logEnable = (getenv(WRT_WILL_SEND_REQUEST_LOG_ENABLE) != NULL);
+
+    WKURLRef    wkUrl   = WKURLRequestCopyURL(request);
+    WKStringRef wkStr   = WKURLCopyString(wkUrl);
+
+    std::string stdUrl  = Bundle::toString(wkStr);
+    std::string localizedUrl;
+
+    WKRelease(wkStr);
+    WKRelease(wkUrl);
+
+    if (logEnable){ WrtLogD("willSendRequestForFrame : %s", stdUrl.c_str()); }
+
+    std::string scheme = stdUrl.substr(0, stdUrl.find_first_of(':'));
+
+#if ENABLE(APP_SCHEME)
+    if (scheme == SCHEME_FILE) {
+        WrtLogE("File schema blocked for: %s", stdUrl.c_str());
+        return NULL;
+    }
+#endif
+
+    // "about:blank"/"about:srcdoc" uri doesn't need uri processing.
+    if (stdUrl == BLANK_PAGE_URL || stdUrl == SRC_DOC_PAGE_URL) {
+        WKRetain(request);
+        return request;
+    }
+
+    localizedUrl = InjectedBundleURIHandling::localizeURI(stdUrl, DPL::ToUTF8String(m_widgetTizenId));
+    bool ret = InjectedBundleURIHandling::processURI(localizedUrl, m_widgetTizenId, m_securityModelVersion);
+
+    if (!ret) {
+        WrtLogD("Not permitted resource: %s", localizedUrl.c_str());
+        return NULL;
+    }
+
+    // log disabled for performance
+    scheme = localizedUrl.substr(0, localizedUrl.find_first_of(':'));
+
+    // Return value must contain details information of input
+    // WKURLRequestRef. Current webkit2 doesn't support api that
+    // copy WKURLRequestRef or change url only. Before webkit2
+    // support api, callback return original WKURLRequestRef in the
+    // case of external scheme
+
+    // external scheme also need to send message to UI process for
+    // checking roaming and security
+
+    if (scheme == SCHEME_HTTP || scheme == SCHEME_HTTPS) {
+        if (logEnable){ WrtLogD("external scheme return original WKURLRequestRef"); }
+        WKRetain(request);
+
+        return request;
+    } else {
+        std::string checkUrl = localizedUrl;
+
+        if (m_decryptionSupport->isNeedDecryption(checkUrl)) {
+            std::string decryptString =
+                m_decryptionSupport->decryptResource(checkUrl);
+
+            if (logEnable){ WrtLogD("return value : %s", decryptString.c_str()); }
+
+            WKURLRef destUrl =
+                WKURLCreateWithUTF8CString(decryptString.c_str());
+            WKURLRequestRef req = WKURLRequestCreateWithWKURL(destUrl);
+            WKRelease(destUrl);
+
+            return req;
+        }
+    }
+
+    WKURLRef newUrl = WKURLCreateWithUTF8CString(localizedUrl.c_str());
+    WKURLRequestRef req = WKURLRequestCreateWithWKURL(newUrl);
+    WKRelease(newUrl);
+
+    if (logEnable){ WrtLogD("return value : %s", localizedUrl.c_str()); }
+
+    return req;
+}
+
+WKBundlePagePolicyAction Bundle::decidePolicyForAction(
+    bool isNewWindow,
+    WKBundlePageRef /* page */,
+    WKBundleFrameRef frame,
+    WKBundleNavigationActionRef /* navigationAction */,
+    WKURLRequestRef request,
+    WKTypeRef* /* userData */)
+{
+    using namespace ViewModule;
+    using namespace ViewModule::SchemeActionMap;
+
+    char const * const TIZEN_SCHEME = "tizen";
+
+    std::string request_uri = toString(request);
+
+    WrtLogD("request uri : %s", request_uri.c_str());
+
+    // exception uri
+    if (request_uri == BLANK_PAGE_URL) {
+        return WKBundlePagePolicyActionUse;
+    }
+
+    // in case of box scheme, unconditionally PassThrough should be returned
+    if (!request_uri.compare(0, 6, SCHEME_BOX_SLASH)) {
+        return WKBundlePagePolicyActionPassThrough;
+    }
+
+    DPL::String dplUrl = DPL::FromUTF8String(request_uri);
+    bool ret =
+        InjectedBundleURIHandling::processMainResource(dplUrl,
+                                                       m_widgetTizenId,
+                                                       m_securityModelVersion);
+    if (!ret) {
+        std::string blockedUrl = DPL::ToUTF8String(dplUrl);
+        WrtLogD("URI is blocked: %s", blockedUrl.c_str());
+
+        // Send information about blocked URI to UIProcess
+        WKStringRef urlStr = WKStringCreateWithUTF8CString(blockedUrl.c_str());
+        WKStringRef blockMessage =
+            WKStringCreateWithUTF8CString(Message::ToUIProcess::BLOCKED_URL);
+        WKBundlePostMessage(m_bundle, blockMessage, urlStr);
+        WKRelease(urlStr);
+        WKRelease(blockMessage);
+        return WKBundlePagePolicyActionPassThrough;
+    }
+
+    // get scheme string
+    std::string request_scheme = getScheme(request_uri);
+
+    // is tizen schem?
+    if (request_scheme == TIZEN_SCHEME) {
+        return WKBundlePagePolicyActionPassThrough;
+    }
+
+    // scheme action
+    Scheme scheme(request_scheme);
+    Scheme::Type type = scheme.GetType();
+    if (type < Scheme::FILE || type >= Scheme::COUNT) {
+        WrtLogD("Unknown scheme : %s", request_scheme.c_str());
+        return WKBundlePagePolicyActionPassThrough;
+    }
+
+    bool mainFrame = WKBundleFrameIsMainFrame(frame);
+    NavigationContext ctx = mainFrame ? TOP_LEVEL : FRAME_LEVEL;
+    if (isNewWindow) {
+        ctx = NEW_WINDOW;
+    }
+
+    UriAction action = g_tizenActionMap[type][ctx];
+    WrtLogD("Scheme type: %d, Navigation context: %d, Action: %d",
+       type,
+       ctx,
+       action);
+
+    if (action != URI_ACTION_WRT) {
+        return WKBundlePagePolicyActionPassThrough;
+    }
+
+    return WKBundlePagePolicyActionUse;
+}
+
+std::string Bundle::toString(WKStringRef str)
+{
+    if (WKStringIsEmpty(str)) {
+        return "";
+    } else {
+        size_t size = WKStringGetMaximumUTF8CStringSize(str);
+
+        char buffer[size + 1];
+        WKStringGetUTF8CString(str, buffer, sizeof(buffer));
+
+        return buffer;
+    }
+}
+
+std::string Bundle::toString(WKURLRef url)
+{
+    WKStringRef urlStr = WKURLCopyString(url);
+    std::string str = toString(urlStr);
+    WKRelease(urlStr);
+    return str;
+}
+
+std::string Bundle::toString(WKURLRequestRef req)
+{
+    WKURLRef reqUrl = WKURLRequestCopyURL(req);
+    std::string str = toString(reqUrl);
+    WKRelease(reqUrl);
+    return str;
+}
+
+std::string Bundle::toString(WKErrorRef err)
+{
+    WKStringRef domErr = WKErrorCopyDomain(err);
+    WKStringRef desc = WKErrorCopyLocalizedDescription(err);
+    std::string str = toString(domErr) + "\n" + toString(desc);
+    WKRelease(domErr);
+    WKRelease(desc);
+    return str;
+}
+
+std::string Bundle::getScheme(std::string uri)
+{
+    std::size_t found = uri.find(':');
+    std::string str;
+
+    if (found != std::string::npos) {
+        str = uri.substr(0, found);
+    }
+
+    return str;
+}
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+int Bundle::SendMessagetoUI(int cmd, unsigned char *data, int dataLen)
+{
+    int uiProcessPid = getppid();
+    WrtLogD("SendMessagetoUI uiProcessPid = %d cmd = %d, datalen = %d", uiProcessPid, cmd, dataLen);
+    return __app_send_raw(WRT_LAUNCHPAD_PID, cmd, data, dataLen);
+}
+#endif
+
+extern "C"
+{
+WK_EXPORT
+void WKBundleInitialize(WKBundleRef bundle,
+                        WKTypeRef)
+{
+    WrtLogD("Bundle initialized");
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    if (0 != setpgid(0, getpid())) {
+        WrtLogE("Fail to set PGID");
+    }
+#endif
+    DPL::Event::GetMainEventDispatcherInstance().ResetCrossEventCallHandler();
+    WrtLogD("ResetCrossEventCallHandler()");
+
+    static Bundle s_bundle(bundle);
+
+    WKBundleClient client = {
+        kWKBundleClientCurrentVersion,
+        &s_bundle,
+        &Bundle::didCreatePageCallback,
+        &Bundle::willDestroyPageCallback,
+        0,     /* didInitializePageGroup */
+        &Bundle::didReceiveMessageCallback
+    };
+    WKBundleSetClient(bundle, &client);
+
+    // process pool - restore process priority
+    if (UID_ROOT == getuid()) {
+        setpriority(PRIO_PROCESS, 0, DEFAULT_PRIORITY);
+    }
+    IPCMessageSupport::setWKBundleRef(bundle);
+}
+}
diff --git a/src/view/webkit/injected-bundle/wrt-injected-bundle.h b/src/view/webkit/injected-bundle/wrt-injected-bundle.h
new file mode 100644 (file)
index 0000000..5d6e287
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file wrt-injected-bundle.h
+ * @author Jihoon Chung (jihoon.chung@samsung.com)
+ * @brief declare injected bundle
+ */
+#ifndef WRT_SRC_VIEW_WEBKIT_WRT_INJECTED_BUNDLE_H_
+#define WRT_SRC_VIEW_WEBKIT_WRT_INJECTED_BUNDLE_H_
+
+#include <map>
+#include <memory>
+#include <set>
+#include <list>
+#include <string>
+#include <WKBundle.h>
+#include <WKPageLoadTypes.h>
+#include <WKBundlePage.h>
+#include <dpl/platform.h>
+#include <dpl/string.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include "page_global_context_container.h"
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+#include <aul.h>
+#endif
+
+extern "C" {
+WK_EXPORT void WKBundleInitialize(WKBundleRef bundle, WKTypeRef);
+}
+
+namespace InjectedBundle {
+class DecryptionSupport;
+class ViewmodesSupport;
+}
+
+class Bundle
+{
+  public:
+    Bundle(WKBundleRef bundle);
+    ~Bundle();
+
+    Bundle(const Bundle&) = delete;
+    Bundle& operator=(const Bundle&) = delete;
+
+    // WKBundleClient callback
+    static void didCreatePageCallback(
+        WKBundleRef bundle,
+        WKBundlePageRef page,
+        const void* clientInfo);
+    static void willDestroyPageCallback(
+        WKBundleRef bundle,
+        WKBundlePageRef page,
+        const void* clientInfo);
+    static void didReceiveMessageCallback(
+        WKBundleRef,
+        WKStringRef messageName,
+        WKTypeRef messageBody,
+        const void *clientInfo);
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    static int aul_handler(aul_type type,
+        bundle *b,
+        void *data);
+    static int SendMessagetoUI(int cmd,
+        unsigned char *data,
+        int dataLen);
+#endif
+
+  private:
+    WKBundleRef m_bundle;
+
+    typedef std::list<WKBundlePageRef> PagesList;
+    PagesList m_pagesList;
+    typedef std::set<JSGlobalContextRef> ContextSet;
+    typedef std::map<WKBundlePageRef, ContextSet> PageContextList;
+    PageContextList m_pageContext;
+    PageGlobalContextContainer m_pageGlobalContext;
+    DPL::String m_widgetTizenId;
+    double m_scale;
+    std::string m_encodedBundle;
+    std::string m_theme;
+    std::set<JSGlobalContextRef> m_loadedContext;
+    JSGlobalContextRef m_willRemoveContext;
+    WrtDB::WidgetSecurityModelVersion m_securityModelVersion;
+    bool m_initialized;
+
+    std::unique_ptr<InjectedBundle::DecryptionSupport> m_decryptionSupport;
+    std::unique_ptr<InjectedBundle::ViewmodesSupport> m_viewmodesSupport;
+
+    // WKBundlePageResourceLoadClient callback
+    static WKURLRequestRef willSendRequestForFrameCallback(
+        WKBundlePageRef,
+        WKBundleFrameRef,
+        uint64_t resourceIdentifier,
+        WKURLRequestRef request,
+        WKURLResponseRef,
+        const void *clientInfo);
+    static void didFinishLoadForResourceCallback(
+        WKBundlePageRef page,
+        WKBundleFrameRef frame,
+        uint64_t resourceIdentifier,
+        const void* clientInfo);
+
+    // WKBundlePageDidStartProvisionalLoadForFrame callback
+    static void didStartProvisionalLoadForFrameCallback(
+        WKBundlePageRef page,
+        WKBundleFrameRef frame,
+        WKTypeRef* userData,
+        const void *clientInfo);
+
+    // WKBundlePageDidRemoveFrameFromHierarchy callback
+    static void didRemoveFrameFromHierarchyCallback(
+        WKBundlePageRef page,
+        WKBundleFrameRef frame,
+        WKTypeRef* userData,
+        const void *clientInfo);
+
+    // WKBundlePageLoaderClient callback
+    static void didCommitLoadForFrameCallback(
+        WKBundlePageRef page,
+        WKBundleFrameRef frame,
+        WKTypeRef*,
+        const void *clientInfo);
+
+    // WKBundlePageDecidePolicyForNavigationActionCallback
+    static WKBundlePagePolicyAction decidePolicyForNavigationActionCallback(
+        WKBundlePageRef page,
+        WKBundleFrameRef frame,
+        WKBundleNavigationActionRef navigationAction,
+        WKURLRequestRef request,
+        WKTypeRef* userData,
+        const void* clientInfo);
+
+    // WKBundlePageDecidePolicyForNewWindowActionCallback
+    static WKBundlePagePolicyAction decidePolicyForNewWindowActionCallback(
+        WKBundlePageRef page,
+        WKBundleFrameRef frame,
+        WKBundleNavigationActionRef navigationAction,
+        WKURLRequestRef request,
+        WKStringRef frameName,
+        WKTypeRef* userData,
+        const void* clientInfo);
+
+    // WKBundlePageDecidePolicyForResponseCallback
+    static WKBundlePagePolicyAction decidePolicyForResponseCallback(
+        WKBundlePageRef page,
+        WKBundleFrameRef frame,
+        WKURLResponseRef response,
+        WKURLRequestRef request,
+        WKTypeRef* userData,
+        const void* clientInfo);
+
+    // WKBundleClient
+    void didCreatePage(WKBundlePageRef page);
+    void willDestroyPage(WKBundlePageRef page);
+    void didReceiveMessage(
+        WKStringRef messageName,
+        WKTypeRef messageBody);
+
+    // WKBundlePageResourceLoadClient
+    WKURLRequestRef willSendRequestForFrame(WKURLRequestRef request);
+    WKBundlePagePolicyAction decidePolicyForAction(
+        bool isNewWindow,
+        WKBundlePageRef page,
+        WKBundleFrameRef frame,
+        WKBundleNavigationActionRef navigationAction,
+        WKURLRequestRef request,
+        WKTypeRef* userData);
+
+    // basic
+    inline static std::string toString(WKStringRef str);
+    inline static std::string toString(WKURLRef url);
+    inline static std::string toString(WKURLRequestRef req);
+    inline static std::string toString(WKErrorRef err);
+    static std::string getScheme(std::string uri);
+
+    bool isEncryptedResource(std::string Url, int &size);
+    std::string DecryptResource(std::string resource, int size);
+
+    void fixWKMessageArgs(std::string & argScale,
+                          std::string & argEncodedBundle,
+                          std::string & argTheme);
+
+#if ENABLE(CORS_WHITELISTING)
+    void bypassCORSforWARPAccessList(WrtDB::WidgetDAOReadOnly &dao);
+#endif
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    void dropProcessPoolCapability();
+    void changeProcessPoolSmackLabel(const std::string& appPath);
+    void initAULCommunication(std::string appPath, int argc, char** argv);
+#endif
+};
+
+#endif // WRT_SRC_VIEW_WEBKIT_WRT_INJECTED_BUNDLE_H_
diff --git a/src/view/webkit/injected-bundle/wrt-injected-bundle.map b/src/view/webkit/injected-bundle/wrt-injected-bundle.map
new file mode 100644 (file)
index 0000000..e236c95
--- /dev/null
@@ -0,0 +1,17 @@
+{
+    global:
+        WKBundleInitialize;
+        _Jv_RegisterClasses;
+        __bss_end__;
+        __bss_start;
+        __bss_start__;
+        __cxa_finalize;
+        __end__;
+        __gmon_start__;
+        _bss_end__;
+        _edata;
+        _end;
+        _fini;
+        _init;
+    local: *;
+};
diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp
new file mode 100644 (file)
index 0000000..860a7b8
--- /dev/null
@@ -0,0 +1,2500 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic.cpp
+ * @author  Pawel Sikorski (p.sikorsk@samsung.com)
+ * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @author  Yunchan Cho (yunchan.cho@samsung.com)
+ * @brief   View logic for Webkit2
+ */
+#include "view_logic.h"
+
+#include <cstring>
+#include <string>
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/optional_typedefs.h>
+#include <dpl/string.h>
+#include <dpl/foreach.h>
+#include <dpl/availability.h>
+#include <dpl/platform.h>
+
+#include <Elementary.h>
+#include <efl_assist.h>
+#include <pcrecpp.h>
+#include <dd-deviced.h>
+#include <widget_model.h>
+#include <system_settings.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/utils/wrt_global_settings.h>
+
+#include <application_data.h>
+#include <message_support.h>
+
+#include <common/application_launcher.h>
+#include <common/scheme.h>
+#include <common/view_logic_apps_support.h>
+#include <common/view_logic_certificate_support.h>
+#include <common/view_logic_custom_header_support.h>
+#include <common/view_logic_privilege_support.h>
+#include <common/view_logic_security_origin_support.h>
+#include <common/view_logic_security_support.h>
+#include <common/view_logic_storage_support.h>
+#include <common/view_logic_uri_support.h>
+#include <common/view_logic_vibration_support.h>
+#if USE(WEBKIT_UPVERSION)
+#include <view_logic_authentication_request_support.h>
+#else
+#include <view_logic_authentication_challenge_support.h>
+#endif
+#include <view_logic_certificate_confirm_support.h>
+#include <view_logic_geolocation_support.h>
+#include <view_logic_message_support.h>
+#include <view_logic_orientation_support.h>
+#include <view_logic_scheme_support.h>
+#include <view_logic_usermedia_support.h>
+#include <view_logic_web_notification_data.h>
+#include <view_logic_web_notification_support.h>
+#include <view_logic_web_notification_permission_support.h>
+#include <view_logic_web_storage_support.h>
+
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <dpl/localization/w3c_file_localization.h>
+#include <js_overlay_types.h>
+#include <dispatch_event_support.h>
+#include <i_runnable_widget_object.h>
+#include <profiling_util.h>
+#include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
+#include <wrt-commons/custom-handler-dao-rw/custom_handler_dao.h>
+#include <popup-runner/PopupInvoker.h>
+#include <plugins-ipc-message/ipc_message_support.h>
+#include <appsvc.h>
+
+#if ENABLE(PRE_LAUNCH)
+#include <pre_launching_support.h>
+#endif
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+#include <web_internal_eventloop.h>
+#endif
+
+namespace {
+// IME State value
+const char * const IME_STATE_ON = "on";
+const char * const IME_STATE_OFF = "off";
+
+const char PROTOCOL_HANDLER_ASK_MSG[] = "Add protocol?";
+const char PROTOCOL_HANDLER_ASK_TITLE[] = "Add protocol";
+const char PROTOCOL_HANDLER_ASK_REMEMBER[] = "Remember dicision";
+const char CONTENT_HANDLER_ASK_MSG[] = "Add content?";
+const char CONTENT_HANDLER_ASK_TITLE[] = "Add content";
+const char CONTENT_HANDLER_AKS_REMEMBER[] = "Remember dicision";
+
+const char* const DEFAULT_ENCODING = "UTF-8";
+#if ENABLE(CONTENT_SECURITY_POLICY)
+const char* const DEFAULT_CSP_POLICY =
+    "default-src *; script-src 'self'; style-src 'self'; object-src 'none';";
+#endif
+// SCHEME
+const char * const SCHEME_BOX_SLASH = "box://";
+const double ORIENTATION_THRESHOLD = 0.5;
+
+//Tizen Extensible API String
+const char *EXTENSIBLE_API_ROTATION_LOCK = "rotation,lock";
+
+} // anonymous namespace
+
+std::map<const std::string,
+         const Evas_Smart_Cb> ViewLogic::m_ewkCallbacksMap = {
+    { "load,started", &ViewLogic::loadStartedCallback },
+    { "load,finished", &ViewLogic::loadFinishedCallback },
+    { "load,progress,started", &ViewLogic::loadProgressStartedCallback },
+    { "load,progress", &ViewLogic::loadProgressCallback },
+    { "load,progress,finished", &ViewLogic::loadProgressFinishedCallback },
+    { "webprocess,crashed", &ViewLogic::webProcessCrashedCallback },
+    { "process,crashed", &ViewLogic::processCrashedCallback },
+    // WKPageUIClient
+    { "create,window", &ViewLogic::createWindowCallback },
+    { "close,window", &ViewLogic::closeWindowCallback },
+    // WKPagePolicyClient
+    { "policy,navigation,decide", &ViewLogic::policyNavigationDecideCallback },
+    { "policy,newwindow,decide", &ViewLogic::policyNewWindowDecideCallback },
+    { "policy,response,decide", &ViewLogic::pageResponseDecideCallback },
+    // WKPageContextMenuClient
+    { "contextmenu,customize", &ViewLogic::contextmenuCustomizeCallback },
+    // EWK Notification Callback
+    { "notification,show", &ViewLogic::notificationShowCallback },
+    { "notification,cancel", &ViewLogic::notificationCancelCallback },
+    { "fullscreen,enterfullscreen", &ViewLogic::enterFullscreenCallback },
+    { "fullscreen,exitfullscreen", &ViewLogic::exitFullscreenCallback },
+    // IME Callback
+    // when ime start to be showed on the webview,
+    // this callback will be called
+    { "inputmethod,changed", &ViewLogic::imeChangedCallback },
+    // this callback will be called
+    //  when ime finishes to be showed on the webview
+    // "event_info" arg of this callback is always NULL point
+    // if web content should know size of ime,
+    //  use "inputmethod,changed" instead of this.
+    //
+    { "editorclient,ime,opened", &ViewLogic::imeOpenedCallback },
+    // when ime finished to be hidden,
+    // this callback will be called
+    { "editorclient,ime,closed", &ViewLogic::imeClosedCallback },
+    // Custom handlers
+    { "protocolhandler,registration,requested",
+      &ViewLogic::protocolHandlerRegistrationCallback },
+    { "protocolhandler,isregistered",
+      &ViewLogic::protocolHandlerIsRegisteredCallback },
+    { "protocolhandler,unregistration,requested",
+      &ViewLogic::protocolHandlerUnregistrationCallback },
+    { "contenthandler,registration,requested",
+      &ViewLogic::contentHandlerRegistrationCallback },
+    { "contenthandler,isregistered",
+      &ViewLogic::contentHandlerIsRegisteredCallback },
+    { "contenthandler,unregistration,requested",
+      &ViewLogic::contentHandlerUnregistrationCallback },
+    { "request,certificate,confirm",
+      &ViewLogic::certificateConfirmRequestCallback },
+#if USE(WEBKIT_UPVERSION)
+    { "authentication,request",
+      &ViewLogic::authenticationRequestCallback },
+#else
+    { "authentication,challenge",
+      &ViewLogic::authenticationChallengeRequestCallback },
+#endif
+    { "frame,rendered",
+      &ViewLogic::viewFrameRenderedCallback },
+    { "mediacontrol,rotate,horizontal",
+      &ViewLogic::mediacontrolRotateHorizontal },
+    { "mediacontrol,rotate,vertical",
+      &ViewLogic::mediacontrolRotateVertical },
+    { "mediacontrol,rotate,exit",
+      &ViewLogic::mediacontrolRotateExit },
+    { "popup,reply,wait,start",
+      &ViewLogic::popupReplyWaitStart },
+    { "popup,reply,wait,finish",
+      &ViewLogic::popupReplyWaitFinish },
+    { "console,message",
+      &ViewLogic::consoleMessageCallback },
+    { "rotate,prepared", &ViewLogic::rotatePreparedCallback },
+    { "video,hwoverlay,enabled",
+      &ViewLogic::enabledVideoHwOverlayCallback },
+    { "video,hwoverlay,disabled",
+      &ViewLogic::disabledVideoHwOverlayCallback },
+};
+
+ViewLogic::ViewLogic() :
+    m_ewkContext(0),
+    m_attachedToCustomHandlerDao(false),
+    m_currentEwkView(0),
+    m_closedEwkView(NULL),
+    m_window(NULL),
+    m_model(0),
+    m_cbs(new WRT::UserDelegates),
+    m_imeWidth(0),
+    m_imeHeight(0),
+    m_isBackgroundReload(false),
+    m_isBackgroundSupport(false),
+    m_rotateAngle(0),
+    m_deferredRotateAngle(
+        ViewModule::OrientationSupport::DEFERRED_ORIENTATION_EMPTY),
+    m_orientationThresholdTimer(NULL),
+    m_isPopupReplyWait(false),
+    m_isFullscreenByPlatform(false),
+    m_appsSupport(new ViewModule::AppsSupport()),
+    m_vibrationSupport(new ViewModule::VibrationSupport()),
+    m_webNotificationSupport(new ViewModule::WebNotificationSupport())
+{
+    ApplicationLauncherSingleton::Instance().Touch();
+}
+
+ViewLogic::~ViewLogic()
+{
+    detachFromCustomHandlersDao();
+}
+
+bool ViewLogic::createWebView(Ewk_Context* context,
+                              Evas_Object* window)
+{
+    WrtLogD("enter");
+    if (!context || !window) {
+        return false;
+    }
+
+    // theme setting
+    const char *theme = elm_theme_get(NULL);
+    if (theme) {
+        m_theme = theme;
+        WrtLogD("theme is %s", m_theme.c_str());
+    }
+
+    // set members
+    m_ewkContext = context;
+    m_window = window;
+
+    Evas* canvas = evas_object_evas_get(m_window);
+
+    if (!createEwkView(canvas)) {
+        return false;
+    }
+
+    return true;
+}
+
+void ViewLogic::prepareView(WidgetModel* m, const std::string &startUrl)
+{
+    WrtLogD("View prepare");
+
+    Assert(m);
+    m_model = m;
+    m_startUrl = startUrl;
+    Assert(NULL != m_ewkContext);
+    Assert(m_window);
+
+    ADD_PROFILING_POINT("initializeSupport", "start");
+    initializeSupport();
+    ADD_PROFILING_POINT("initializeSupport", "stop");
+    ewkClientInit(m_currentEwkView);
+    ADD_PROFILING_POINT("prepareEwkView", "start");
+    prepareEwkView(m_currentEwkView);
+    ADD_PROFILING_POINT("prepareEwkView", "stop");
+    initializePluginLoading();
+    initializeXwindowHandle();
+}
+
+void ViewLogic::showWidget()
+{
+    WrtLogD("showing widget");
+    AssertMsg(NULL != m_currentEwkView, "ewk_view not created at this point");
+    std::string url =
+        ViewModule::UriSupport::getUri(m_model, m_startUrl);
+    if (url.empty()) {
+        WrtLogE("Localized current URI doesn't exist");
+        return;
+    }
+    WrtLogD("url : %s", url.c_str());
+
+    if (m_cbs->setWebviewCallback) {
+        m_cbs->setWebviewCallback(m_currentEwkView);
+    }
+
+    // load page
+    ewk_view_url_set(m_currentEwkView, url.c_str());
+}
+
+void ViewLogic::setWidgetUrl(const std::string &startUrl)
+{
+    WrtLogD("reload widget");
+    std::string url =
+        ViewModule::UriSupport::getUri(m_model, startUrl);
+    if (url.empty()) {
+        WrtLogE("Localized current URI doesn't exist");
+        return;
+    }
+
+    m_startUrl = startUrl;
+    WrtLogD("url : %s ", url.c_str());
+
+    if (m_cbs->setWebviewCallback) {
+        m_cbs->setWebviewCallback(m_currentEwkView);
+    }
+    ewk_view_url_set(m_currentEwkView, url.c_str());
+}
+
+void ViewLogic::hideWidget()
+{
+    WrtLogD("hiding widget");
+    ViewModule::StorageSupport::deinitializeStorage(m_model);
+    m_appsSupport->deinitialize();
+    m_vibrationSupport->deinitialize();
+    m_webNotificationSupport->deinitialize();
+    system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE);
+
+    while (!m_ewkViewList.empty()) {
+        WrtLogD("pop webview");
+        removeEwkView(m_ewkViewList.back());
+    }
+    m_ewkViewList.clear();
+}
+
+void ViewLogic::suspendWidget()
+{
+    WrtLogD("Pausing widget");
+    Assert(m_model);
+
+    if (!m_currentEwkView) {
+        WrtLogW("Cannot suspend widget without view");
+    } else {
+        setEwkViewInvisible(m_currentEwkView);
+
+        if (!m_isBackgroundSupport) {
+            FOREACH(it, m_ewkViewList) {
+                if (*it != m_currentEwkView) {
+                    suspendWebkit(*it);
+                }
+            }
+
+            suspendWebkit(m_currentEwkView);
+        }
+#if ENABLE(PRE_LAUNCH)
+        else if(PreLaunchingSupportSingleton::Instance().isPreLaunching())
+        {
+             suspendWebkit(m_currentEwkView);
+             PreLaunchingSupportSingleton::Instance().setEwkViewSuspended(true);
+        }
+#endif
+    }
+}
+
+void ViewLogic::resumeWidget()
+{
+    WrtLogD("Resume widget");
+    Assert(m_model);
+
+    if (m_currentEwkView)
+    {
+        setEwkViewVisible(m_currentEwkView);
+
+        if (!m_isBackgroundSupport) {
+            FOREACH(it, m_ewkViewList) {
+                if (*it != m_currentEwkView) {
+                    resumeWebkit(*it);
+                }
+            }
+
+            resumeWebkit(m_currentEwkView);
+        }
+#if ENABLE(PRE_LAUNCH)
+        else if(PreLaunchingSupportSingleton::Instance().isEwkViewSuspended()) {
+            resumeWebkit(m_currentEwkView);
+            PreLaunchingSupportSingleton::Instance().setEwkViewSuspended(false);
+        }
+
+        PreLaunchingSupportSingleton::Instance().setJavascriptExecuteFlag(false);
+#endif
+    }
+}
+
+void ViewLogic::resetWidgetFromSuspend()
+{
+    WrtLogD("Reset widget from suspend");
+    Assert(m_currentEwkView);
+
+    if (m_isPopupReplyWait) {
+        setEwkViewVisible(m_currentEwkView);
+
+        if (!m_isBackgroundSupport) {
+            FOREACH(it, m_ewkViewList) {
+                if (*it != m_currentEwkView) {
+                    resumeWebkit(*it);
+                }
+            }
+
+            resumeWebkit(m_currentEwkView);
+        }
+    }
+#if ENABLE(JAVASCRIPT_ONBEFOREUNLOAD_EVENT)
+    else {
+        setEwkViewVisible(m_currentEwkView);
+
+        if (!m_isBackgroundSupport) {
+            FOREACH(it, m_ewkViewList) {
+                if (*it != m_currentEwkView) {
+                    resumeWebkit(*it);
+                }
+            }
+
+            resumeWebkit(m_currentEwkView);
+        }
+    }
+#endif
+    resetWidgetCommon();
+}
+
+void ViewLogic::resetWidgetFromResume()
+{
+    WrtLogD("Reset widget from resume");
+
+    resetWidgetCommon();
+}
+
+void ViewLogic::resetWidgetCommon()
+{
+    Assert(m_currentEwkView);
+
+    if (m_isPopupReplyWait) {
+        // Current WebProcess is blocked by some reason, js alert.
+        // This case "reset" event cannot pass to application(javascript layer).
+        // Free bundle data to use next "reset" event.
+        WrtLogD("Webkit is blocked. do resume");
+        ApplicationDataSingleton::Instance().freeBundleData(DPL::ToUTF8String(m_model->TizenId));
+    } else {
+        bool isSelfTarget = false;
+        std::string url = ViewModule::UriSupport::getUri(m_model, m_startUrl, &isSelfTarget);
+
+        if (isSelfTarget) {
+            ViewLogicMessageSupport::setCustomProperties(m_ewkContext, NULL,
+                ApplicationDataSingleton::Instance().getEncodedBundle(DPL::ToUTF8String(m_model->TizenId)));
+            DispatchEventSupport::dispatchAppControlEvent(m_currentEwkView);
+        }
+        else
+        {
+#if ENABLE(JAVASCRIPT_ONBEFOREUNLOAD_EVENT)
+            initializePluginLoading();
+            ewk_view_url_set(m_currentEwkView, url.c_str());
+#else
+            while (!m_ewkViewList.empty()) {
+                removeEwkView(m_ewkViewList.back());
+            }
+            m_currentEwkView = NULL;
+
+            createEwkView(evas_object_evas_get(m_window));
+            ewkClientInit(m_currentEwkView);
+            prepareEwkView(m_currentEwkView);
+
+            initializePluginLoading();
+
+            if (m_cbs->setWebviewCallback) {
+                 m_cbs->setWebviewCallback(m_currentEwkView);
+            }
+            ewk_view_url_set(m_currentEwkView, url.c_str());
+#endif
+        }
+    }
+
+    elm_win_activate(m_window);
+}
+
+void ViewLogic::backward()
+{
+    if (ewk_view_back_possible(m_currentEwkView)) {
+        ewk_view_back(m_currentEwkView);
+    } else {
+        if (1 >= m_ewkViewList.size()) {
+            // If there is no previous page, widget move to backgroud.
+            WrtLogD("Widget move to backgroud");
+            elm_win_lower(m_window);
+        } else {
+            // Back to previous webview
+            WrtLogD("Widget move to previous webview");
+            m_closedEwkView = m_currentEwkView;
+            ecore_idler_add(windowCloseIdlerCallback, this);
+        }
+    }
+}
+
+void ViewLogic::reloadStartPage()
+{
+    WrtLogD("Reload Start Page");
+    // prevent fail to load plugin bundle side
+    m_isBackgroundReload = true;
+
+    if (!m_ewkViewList.empty()) {
+        while (!m_ewkViewList.empty()) {
+            if (m_cbs->unsetWebviewCallback) {
+                m_cbs->unsetWebviewCallback(m_currentEwkView);
+            }
+            removeEwkView(m_currentEwkView);
+        }
+    }
+
+    // create new webview
+    createEwkView(evas_object_evas_get(m_window));
+    ewkClientInit(m_currentEwkView);
+
+    prepareEwkView(m_currentEwkView);
+    initializePluginLoading();
+
+    // load page
+    std::string url = ViewModule::UriSupport::getUri(m_model, m_startUrl);
+
+    // show ewkView
+    if (m_cbs->setWebviewCallback) {
+        m_cbs->setWebviewCallback(m_currentEwkView);
+    }
+    ewk_view_url_set(m_currentEwkView, url.c_str());
+    WrtLogD("Reloading Start Page is done!");
+}
+
+Evas_Object* ViewLogic::getCurrentWebview()
+{
+    WrtLogD("get current webview");
+    return m_currentEwkView;
+}
+
+void ViewLogic::fireJavascriptEvent(int event, void* data)
+{
+    ViewLogicMessageSupport::dispatchJavaScriptEvent(
+        m_ewkContext,
+        static_cast<WrtPlugins::W3C::CustomEventType>(event),
+        data);
+}
+
+void ViewLogic::setUserCallbacks(const WRT::UserDelegatesPtr& cbs)
+{
+    m_cbs = cbs;
+}
+
+void ViewLogic::checkSyncMessageFromBundle(
+        const char* name,
+        const char* /*body*/,
+        char** returnData)
+{
+    WrtLogD("didReceiveSynchronousMessage called");
+    Assert(name);
+
+    WrtLogD("received : %s", name);
+    if (!strcmp(name, Message::TizenScheme::GET_WINDOW_HANDLE)) {
+        if (m_window) {
+            Ecore_X_Window handle = elm_win_xwindow_get(m_window);
+            if (handle != 0) {
+                std::stringstream ss;
+                ss << handle;
+                std::string ret  = ss.str();
+                if (returnData) {
+                    *returnData = strdup(ret.c_str());
+                }
+            } else {
+                WrtLogD("X window isn't exist");
+            }
+        }
+    }
+}
+
+void ViewLogic::checkAsyncMessageFromBundle(const char* name, const char* body)
+{
+    Assert(name);
+    WrtLogD("received : %s", name);
+
+    if (!strcmp(name, Message::ToUIProcess::BLOCKED_URL)) {
+        // Currently WebProcess informs obly about blocked
+        // URI - URI localization and security chekcs are
+        // done by WebProcess itself (see: wrt-injected-bundle.cpp
+        // and bundle_uri_handling.cpp)
+        std::string msgBody = (body) ? (body) : "";
+        if (!msgBody.empty() && m_cbs->blockedUrlPolicyCallback) {
+            m_cbs->blockedUrlPolicyCallback(msgBody);
+            m_blockedUri = msgBody;
+        }
+    } else if (!strcmp(name, Message::TizenScheme::CLEAR_ALL_COOKIES)) {
+        Ewk_Cookie_Manager* cookieManager =
+            ewk_context_cookie_manager_get(m_ewkContext);
+        if (!cookieManager) {
+            WrtLogE("Fail to get cookieManager");
+            return;
+        }
+        ewk_cookie_manager_cookies_clear(cookieManager);
+    } else if (!strcmp(name, IPCMessageSupport::TIZEN_CHANGE_USERAGENT)) {
+        std::string msgBody = (body) ? (body) : "";
+
+        std::string strId = msgBody.substr(0, msgBody.find_first_of('_'));
+        std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1);
+        WrtLogD("Id: %s , Body %s", strId.c_str(), strBody.c_str());
+
+        ewk_view_user_agent_set(m_currentEwkView, strBody.c_str());
+        WrtLogD("get UA: %s", ewk_view_user_agent_get(m_currentEwkView));
+
+        IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext,
+                                                         atoi(strId.c_str()),
+                                                         "success");
+        return;
+    } else if (!strcmp(name, IPCMessageSupport::TIZEN_DELETE_ALL_COOKIES)) {
+        std::string msgBody = (body) ? (body) : "";
+        std::string strId = msgBody.substr(0, msgBody.find_first_of('_'));
+        std::string strBody = msgBody.substr(msgBody.find_first_of('_')+1);
+
+        Ewk_Cookie_Manager* cookieManager =
+            ewk_context_cookie_manager_get(m_ewkContext);
+        if (!cookieManager) {
+            WrtLogE("Fail to get cookieManager");
+            IPCMessageSupport::replyAsyncMessageToWebProcess(
+                m_ewkContext,
+                atoi(strId.c_str()),
+                "error");
+            return;
+        }
+        ewk_cookie_manager_cookies_clear(cookieManager);
+        IPCMessageSupport::replyAsyncMessageToWebProcess(m_ewkContext,
+                                                         atoi(strId.c_str()),
+                                                         "success");
+        return;
+    }
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    else if (!strcmp(name, IPCMessageSupport::TIZEN_HIDE))
+#else
+    else if (!strcmp(name, IPCMessageSupport::TIZEN_EXIT) ||
+             !strcmp(name, IPCMessageSupport::TIZEN_HIDE))
+#endif
+    {
+        bool ret =
+            ViewModule::SchemeSupport::HandleTizenScheme(name,
+                                                         m_window,
+                                                         m_currentEwkView);
+        if (ret == false) {
+            WrtLogE("Fail to handle tizen scheme %s", name);
+        }
+        // Not need to send reply
+        return;
+    }
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    else if (!strcmp(name, IPCMessageSupport::TIZEN_EXIT)) {
+        WrtLogE("PSM exit called %s", name);
+        char *appId = strdup(DPL::ToUTF8String(m_model->TizenId).c_str());
+        WebInternalEventSingleton::Instance().sendEvent(WebInternalEventSingleton::Instance().WEB_APP_TERMINATE, appId);
+    }
+#endif
+    else {
+        WrtLogW("Not defined message");
+    }
+}
+
+void ViewLogic::downloadData(const char* url)
+{
+    WrtLogD("enter");
+    if (!url) {
+        return;
+    }
+    m_appsSupport->downloadRequest(url, NULL, NULL);
+}
+
+void ViewLogic::activateVibration(bool on, uint64_t time)
+{
+    WrtLogD("enter");
+    if (on) {
+        m_vibrationSupport->startVibration(static_cast<long>(time));
+    } else {
+        m_vibrationSupport->stopVibration();
+    }
+}
+
+void ViewLogic::initializeSupport()
+{
+    // background support
+    if (m_model->SettingList.Get().getBackgroundSupport()
+        == BackgroundSupport_Enable)
+    {
+        WrtLogD("Background support enabled, set process active");
+        deviced_inform_active(getpid());
+        m_isBackgroundSupport = true;
+    }
+    system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE,
+                                   systemSettingsChangedCallback,
+                                   this);
+
+    ViewModule::StorageSupport::initializeStorage(m_model);
+    m_appsSupport->initialize(m_model, elm_win_xwindow_get(m_window));
+    m_securityOriginSupport.reset(new ViewModule::SecurityOriginSupport(m_model));
+    m_certificateSupport.reset(new ViewModule::CertificateSupport(m_model));
+    m_privilegeSupport.reset(new ViewModule::PrivilegeSupport(m_model));
+    m_webNotificationSupport->initialize(m_model->TzPkgId.Get());
+}
+
+void ViewLogic::initializePluginLoading()
+{
+    // inform wrt information for plugin loading to web process
+    ViewLogicMessageSupport::start(
+        m_ewkContext,
+        m_model->TizenId,
+        elm_config_scale_get(),
+        ApplicationDataSingleton::Instance().getEncodedBundle(DPL::ToUTF8String(m_model->TizenId)),
+        m_theme.c_str());
+}
+
+void ViewLogic::initializeXwindowHandle()
+{
+    if (m_window) {
+        unsigned int handle = elm_win_xwindow_get(m_window);
+        ViewLogicMessageSupport::setXwindowHandle(
+            m_ewkContext,
+            handle);
+    }
+}
+
+void ViewLogic::ewkClientInit(Evas_Object *wkView)
+{
+    AssertMsg(NULL != wkView, "ewk_view not created at this point");
+
+    FOREACH(it, m_ewkCallbacksMap)
+    {
+        evas_object_smart_callback_add(
+            wkView,
+            it->first.c_str(),
+            it->second,
+            this);
+    }
+    // EWK Orientation Callback
+#if !USE(WEBKIT_UPVERSION)
+    ewk_view_orientation_lock_callback_set(
+        wkView,
+        orientationLockCallback,
+        this);
+#endif
+    ewk_view_exceeded_database_quota_callback_set(
+        wkView,
+        exceededDatabaseQuotaCallback,
+        this);
+    ewk_view_exceeded_indexed_database_quota_callback_set(
+        wkView,
+        exceededIndexedDatabaseQuotaCallback,
+        this);
+    ewk_view_exceeded_local_file_system_quota_callback_set(
+        wkView,
+        exceededLocalFileSystemQuotaCallback,
+        this);
+    ewk_view_geolocation_permission_callback_set(
+        wkView,
+        geolocationPermissionRequestCallback,
+        this);
+    ewk_view_user_media_permission_callback_set(
+        wkView,
+        usermediaPermissionRequestCallback,
+        this);
+    ewk_view_notification_permission_callback_set(
+        wkView,
+        notificationPermissionRequestCallback,
+        this);
+    ea_object_event_callback_add(wkView,
+                                 EA_CALLBACK_BACK,
+                                 eaKeyCallback,
+                                 this);
+    ea_object_event_callback_add(wkView,
+                                 EA_CALLBACK_MORE,
+                                 eaKeyCallback,
+                                 this);
+    // Always register access object even application doesn't support
+    // accessibility. In case of accessibility isn't supported, efl_assist
+    // shows warning message by syspopup.
+    // initScreenReaderSupport is related method. (window_data.cpp)
+#if USE(EA_SCREEN_READER)
+    elm_access_object_register(wkView, m_window);
+#endif
+}
+
+void ViewLogic::ewkClientDeinit(Evas_Object *wkView)
+{
+    WrtLogD("ewkClientDeinit");
+    AssertMsg(NULL != wkView, "ewk_view not created at this point");
+
+    FOREACH(it, m_ewkCallbacksMap)
+    {
+        evas_object_smart_callback_del(
+            wkView,
+            it->first.c_str(),
+            it->second);
+    }
+#if !USE(WEBKIT_UPVERSION)
+    ewk_view_orientation_lock_callback_set(wkView, NULL, NULL);
+#endif
+    ewk_view_exceeded_database_quota_callback_set(wkView, NULL, NULL);
+    ewk_view_exceeded_indexed_database_quota_callback_set(wkView, NULL, NULL);
+    ewk_view_exceeded_local_file_system_quota_callback_set(wkView, NULL, NULL);
+    ewk_view_geolocation_permission_callback_set(wkView, NULL, NULL);
+    ewk_view_user_media_permission_callback_set(wkView, NULL, NULL);
+    ewk_view_notification_permission_callback_set(wkView, NULL, NULL);
+    ea_object_event_callback_del(wkView,
+                                 EA_CALLBACK_BACK,
+                                 eaKeyCallback);
+    ea_object_event_callback_del(wkView,
+                                 EA_CALLBACK_MORE,
+                                 eaKeyCallback);
+    if (m_orientationThresholdTimer) {
+        ecore_timer_del(m_orientationThresholdTimer);
+        m_orientationThresholdTimer = NULL;
+    }
+#if USE(EA_SCREEN_READER)
+    elm_access_object_unregister(wkView);
+#endif
+}
+
+bool ViewLogic::createEwkView(Evas* canvas)
+{
+    WrtLogD("createEwkView");
+    Assert(canvas);
+    ADD_PROFILING_POINT("ewk_view_add_with_context", "start");
+    Evas_Object* newEwkView = ewk_view_add_with_context(
+            canvas,
+            m_ewkContext);
+    ADD_PROFILING_POINT("ewk_view_add_with_context", "stop");
+
+    if (!newEwkView) {
+        WrtLogE("View creation failed");
+        Wrt::Popup::PopupInvoker().showInfo(
+            "Info", "View creation failed", "close");
+        return false;
+    }
+
+    // set cookie policy
+    // even arguments pass the ewkContext, this API should be called
+    // after webkit Evas_Object is created
+    Ewk_Cookie_Manager *ewkCookieManager;
+    ewkCookieManager =
+        ewk_context_cookie_manager_get(m_ewkContext);
+    ewk_cookie_manager_accept_policy_set(ewkCookieManager,
+                                         EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
+
+    if (m_currentEwkView) {
+        setEwkViewInvisible(m_currentEwkView);
+    }
+
+    WrtLogD("push webview");
+    m_ewkViewList.push_back(newEwkView);
+    m_currentEwkView = newEwkView;
+    return true;
+}
+
+void ViewLogic::prepareEwkView(Evas_Object *wkView)
+{
+    WrtLogD("prepareEwkView called");
+    Assert(wkView);
+    Ewk_Settings* settings = ewk_view_settings_get(wkView);
+
+    // set user agent
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+    std::string customUserAgent = m_model->SettingList.Get().getUserAgent();
+    if (!customUserAgent.empty()) {
+        WrtLogD("Setting  custom user agent as: %s", customUserAgent.c_str());
+        ewk_view_user_agent_set(wkView, customUserAgent.c_str());
+    } else
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+    {
+        WrtLogD("Setting user agent as: default");
+        ewk_view_user_agent_set(wkView, NULL);
+        std::string defaultUA = ewk_view_user_agent_get(wkView);
+        WrtLogD("webkit's UA: %s", defaultUA.c_str());
+    }
+
+    // set custom header : language
+    using namespace ViewModule::CustomHeaderSupport;
+    std::string customHeaderString = getValueByField(ACCEPT_LANGUAGE);
+    if (!customHeaderString.empty()) {
+        WrtLogD("custom field=[%s]", ACCEPT_LANGUAGE.c_str());
+        WrtLogD("custom value=[%s]", customHeaderString.c_str());
+        ewk_view_custom_header_add(wkView,
+                                   ACCEPT_LANGUAGE.c_str(),
+                                   customHeaderString.c_str());
+    }
+
+    // webkit NPAPI plugins is always on in wrt
+    ewk_settings_plugins_enabled_set(settings, EINA_TRUE);
+    ewk_settings_javascript_enabled_set(settings, EINA_TRUE);
+    ewk_settings_loads_images_automatically_set(settings, EINA_TRUE);
+    // WRT should not fit web contents to device width automatically as default.
+    // Fitting to device width should be handled by web content using viewport meta tag.
+    ewk_settings_auto_fitting_set(settings, EINA_FALSE);
+    ewk_settings_autofill_password_form_enabled_set(settings, EINA_TRUE);
+    ewk_settings_form_candidate_data_enabled_set(settings, EINA_TRUE);
+    ewk_settings_uses_keypad_without_user_action_set(settings, EINA_TRUE);
+
+#if ENABLE(PRE_LAUNCH)
+    if (PreLaunchingSupportSingleton::Instance().isPreLaunching())
+    {
+        ewk_view_page_visibility_state_set(wkView,
+                                           EWK_PAGE_VISIBILITY_STATE_HIDDEN,
+                                           EINA_FALSE);
+    }
+    else
+    {
+        ewk_view_page_visibility_state_set(wkView,
+                                           EWK_PAGE_VISIBILITY_STATE_VISIBLE,
+                                           EINA_TRUE);
+    }
+#else
+    ewk_view_page_visibility_state_set(wkView,
+                                       EWK_PAGE_VISIBILITY_STATE_VISIBLE,
+                                       EINA_TRUE);
+#endif
+
+    std::string encoding = DEFAULT_ENCODING;
+    OptionalWidgetStartFileInfo fileInfo =
+        W3CFileLocalization::getStartFileInfo(m_model->TizenId);
+    if (!!fileInfo) {
+            std::string file_encoding = DPL::ToUTF8String((*fileInfo).encoding);
+
+            if(EINA_TRUE == ewk_settings_is_encoding_valid(
+                                                        file_encoding.c_str())){
+                encoding = file_encoding;
+                WrtLogD("Found custom encoding in DB: %s", encoding.c_str());
+            }
+
+    }
+    WrtLogD("Setting encoding: %s", encoding.c_str());
+    if (ewk_settings_default_encoding_set(settings,encoding.c_str())) {
+        WrtLogD("Encoding set properly");
+    } else {
+        WrtLogE("Error while setting encoding");
+    }
+
+#if ENABLE(CONTENT_SECURITY_POLICY)
+    if (m_model->SecurityModelVersion.Get() ==
+         WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V2)
+    {
+        // setting CSP policy rules
+        DPL::OptionalString policy = m_model->CspReportOnlyPolicy.Get();
+        if (!!policy) {
+            WrtLogD("CSP report only policy present in manifest: %ls", (*policy).c_str());
+            ewk_view_content_security_policy_set(
+                wkView,
+                DPL::ToUTF8String(*policy).c_str(),
+                EWK_REPORT_ONLY);
+        }
+
+        policy = m_model->CspPolicy.Get();
+        if (!!policy) {
+            WrtLogD("CSP policy present in manifest: %ls", (*policy).c_str());
+            ewk_view_content_security_policy_set(
+                wkView,
+                DPL::ToUTF8String(*policy).c_str(),
+                EWK_ENFORCE_POLICY);
+        } else {
+            ewk_view_content_security_policy_set(
+                wkView,
+                DEFAULT_CSP_POLICY,
+                EWK_ENFORCE_POLICY);
+        }
+    }
+#endif
+}
+
+void ViewLogic::removeEwkView(Evas_Object *wkView)
+{
+    WrtLogD("removeEwkView called");
+    Assert(wkView);
+    Assert(0 != m_ewkViewList.size());
+
+    // unregister webview callbacks
+    ewkClientDeinit(wkView);
+
+    // suspend NPAPI plugin - Not implemented by Webkit2
+    //    ewk_view_pause_or_resume_plugins();
+    evas_object_del(wkView);
+    m_ewkViewList.remove(wkView);
+}
+
+void ViewLogic::setEwkViewInvisible(Evas_Object *wkView)
+{
+    WrtLogD("setEwkViewInvisible called");
+    Assert(wkView);
+
+    ewk_view_page_visibility_state_set(wkView,
+                                       EWK_PAGE_VISIBILITY_STATE_HIDDEN,
+                                       EINA_FALSE);
+    ewk_view_visibility_set(wkView, EINA_FALSE);
+}
+
+void ViewLogic::setEwkViewVisible(Evas_Object *wkView)
+{
+    WrtLogD("setEwkViewVisible called");
+    Assert(wkView);
+
+    ewk_view_page_visibility_state_set(wkView,
+                                       EWK_PAGE_VISIBILITY_STATE_VISIBLE,
+                                       EINA_FALSE);
+    ewk_view_visibility_set(wkView, EINA_TRUE);
+}
+
+void ViewLogic::resumeWebkit(Evas_Object *wkView)
+{
+    WrtLogD("resumeWebkit");
+    Assert(wkView);
+
+    ewk_view_resume(wkView);
+    ewk_view_foreground_set(wkView, true);
+
+    return;
+}
+
+void ViewLogic::suspendWebkit(Evas_Object *wkView)
+{
+    WrtLogD("suspendWebkit");
+    Assert(wkView);
+
+    ewk_view_suspend(wkView);
+    ewk_view_foreground_set(wkView, false);
+
+    return;
+}
+
+void ViewLogic::loadStartedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->loadStartedCallback) {
+        This->m_cbs->loadStartedCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::loadFinishedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+
+    // Fill id/password
+    const char* url = ewk_view_url_get(This->m_currentEwkView);
+    if (NULL == url || strlen(url) == 0) {
+        WrtLogE("url is empty");
+        return;
+    }
+
+    if (This->m_cbs->loadFinishedCallback) {
+        This->m_cbs->loadFinishedCallback(obj, eventInfo);
+    }
+
+    // set only encoded bundle
+    double scale = elm_config_scale_get();
+    ViewLogicMessageSupport::setCustomProperties(
+        This->m_ewkContext,
+        &scale,
+        ApplicationDataSingleton::Instance().getEncodedBundle(DPL::ToUTF8String(This->m_model->TizenId)));
+
+    // In this case, widget is reloaded in the background.
+    // After finished load, bundle should disconnent callback.
+    if (This->m_isBackgroundReload) {
+        ewk_view_suspend(This->m_currentEwkView);
+        This->m_isBackgroundReload = false;
+    }
+}
+
+void ViewLogic::loadProgressStartedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->loadProgressStartedCallback) {
+        This->m_cbs->loadProgressStartedCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::loadProgressCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+    Assert(eventInfo);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    double* progress = static_cast<double*>(eventInfo);
+    WrtLogD("progress = %f", *progress);
+    if (This->m_cbs->loadProgressCallback) {
+        This->m_cbs->loadProgressCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::loadProgressFinishedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->loadProgressFinishedCallback) {
+        This->m_cbs->loadProgressFinishedCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::processCrashedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->processCrashedCallback) {
+        This->m_cbs->processCrashedCallback(obj, eventInfo);
+    }
+
+    // This flag will prevent  exit() call in the Webkit side
+    if (NULL != eventInfo) {
+        *(static_cast<Eina_Bool*>(eventInfo)) = EINA_TRUE;
+    }
+}
+
+void ViewLogic::webProcessCrashedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->webProcessCrashedCallback) {
+        This->m_cbs->webProcessCrashedCallback(obj, eventInfo);
+    }
+
+    // This flag will prevent recreation of webProces
+    if (NULL != eventInfo) {
+        *(static_cast<Eina_Bool*>(eventInfo)) = EINA_TRUE;
+    }
+}
+
+void ViewLogic::createWindowCallback(
+    void* data,
+    Evas_Object* obj,
+    void* eventInfo)
+{
+    WrtLogD("createWindowCallback");
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+
+    // Blocks "window.open" and "target='_blank'"
+    // defined for href link in anchor element in case of Dynamic box
+    if (This->m_cbs->isCreateNewWindowAllowedCallback) {
+        if (!This->m_cbs->isCreateNewWindowAllowedCallback()) {
+            WrtLogD("Returning from window create callback");
+            return;
+        }
+    }
+
+    // First, current webview should be handled by user callback
+    if (This->m_cbs->unsetWebviewCallback) {
+        This->m_cbs->unsetWebviewCallback(obj);
+    }
+
+    // create new ewkview
+    This->createEwkView(evas_object_evas_get(This->m_window));
+    Evas_Object* newEwkView = This->m_currentEwkView;
+
+    // initialize new ewkview
+    This->ewkClientInit(newEwkView);
+    This->prepareEwkView(newEwkView);
+
+    // Lastly, new webview should be handled by user callback
+    if (This->m_cbs->setWebviewCallback) {
+        This->m_cbs->setWebviewCallback(newEwkView);
+    }
+    *(static_cast<Evas_Object **>(eventInfo)) = newEwkView;
+}
+
+void ViewLogic::closeWindowCallback(
+    void* data,
+    Evas_Object* obj,
+    void* /*eventInfo*/)
+{
+    WrtLogD("closeWindowCallback");
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    This->m_closedEwkView = obj;
+    ecore_idler_add(windowCloseIdlerCallback, This);
+}
+
+void ViewLogic::policyNavigationDecideCallback(
+    void* data,
+    Evas_Object* obj,
+    void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+    Assert(obj);
+    Assert(eventInfo);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    Ewk_Policy_Decision* policyDecision =
+        static_cast<Ewk_Policy_Decision*>(eventInfo);
+
+    // handle blocked url
+    const char* url = ewk_policy_decision_url_get(policyDecision);
+
+    // call user delegate callback
+    if (This->m_cbs->policyNavigationDecideCallback) {
+        if(!This->m_cbs->policyNavigationDecideCallback(obj, eventInfo)) {
+            WrtLogD(" URI is blocked for DynamicBox");
+            ewk_policy_decision_ignore(policyDecision);
+            return;
+        }
+        std::string navigationUri(url);
+        if (!navigationUri.compare(0, 6, SCHEME_BOX_SLASH)) {
+            ewk_policy_decision_ignore(policyDecision);
+            return;
+        }
+    }
+
+    if (url && strlen(url) != 0) {
+        if (This->m_blockedUri == url) {
+            WrtLogD("Blocked url = %s", url);
+            This->m_blockedUri = std::string();
+            ewk_policy_decision_ignore(policyDecision);
+            return;
+        }
+    }
+
+    if (ViewModule::SchemeSupport::filterURIByScheme(policyDecision,
+                                                     false,
+                                                     This->m_window,
+                                                     This->m_currentEwkView))
+    {
+        WrtLogD("use");
+        ewk_policy_decision_use(policyDecision);
+    } else {
+        // check whether this is new empty window
+        const char* activeUrl = ewk_view_url_get(This->m_currentEwkView);
+        if (!activeUrl || 0 == strlen(activeUrl)) {
+            /*
+             * The view is empty and scheme has been handled externally. When
+             * user gets back from the external application he'd see blank page
+             * and won't be able to navigate back. This happens when window.open
+             * is used to handle schemes like sms/mms/mailto (for example in
+             * WAC web standards tests: WS-15XX).
+             *
+             * To solve the problem, the empty view is removed from the stack
+             * and the previous one is shown. This is not an elegant solution
+             * but we don't have a better one.
+             */
+            WrtLogD("Scheme has been handled externally. Removing empty view.");
+            if (ewk_view_back_possible(This->m_currentEwkView)) {
+                // go back to previous WKPage
+                ewk_view_back(This->m_currentEwkView);
+            } else {
+                // stop current WKPage
+                ewk_view_stop(This->m_currentEwkView);
+                This->m_closedEwkView = This->m_currentEwkView;
+                ecore_idler_add(windowCloseIdlerCallback, This);
+            }
+        }
+
+        WrtLogD("ignore");
+        ewk_policy_decision_ignore(policyDecision);
+    }
+}
+
+void ViewLogic::policyNewWindowDecideCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* eventInfo)
+{
+    WrtLogD("policyNewWindowDecideCallback called");
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    Assert(eventInfo);
+    Ewk_Policy_Decision* policyDecision =
+        static_cast<Ewk_Policy_Decision*>(eventInfo);
+
+    // handle blocked url
+    const char* url = ewk_policy_decision_url_get(policyDecision);
+    if (url && strlen(url) != 0) {
+        if (This->m_blockedUri == url) {
+            WrtLogD("Blocked url = %s", url);
+            This->m_blockedUri = std::string();
+            ewk_policy_decision_ignore(policyDecision);
+            return;
+        }
+    }
+
+    if (ViewModule::SchemeSupport::filterURIByScheme(policyDecision,
+                                                     true,
+                                                     This->m_window,
+                                                     This->m_currentEwkView))
+    {
+        ewk_policy_decision_use(policyDecision);
+    } else {
+        // scheme handled
+        ewk_policy_decision_ignore(policyDecision);
+    }
+}
+
+void ViewLogic::pageResponseDecideCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* eventInfo)
+{
+    WrtLogD("pageResponseDecideCallback called");
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    Assert(eventInfo);
+    Ewk_Policy_Decision* policyDecision =
+        static_cast<Ewk_Policy_Decision*>(eventInfo);
+    Ewk_Policy_Decision_Type policyDecisionType =
+        ewk_policy_decision_type_get(policyDecision);
+
+    if (policyDecisionType == EWK_POLICY_DECISION_USE) {
+        WrtLogD("use");
+        ewk_policy_decision_use(policyDecision);
+    } else if (policyDecisionType == EWK_POLICY_DECISION_DOWNLOAD) {
+        WrtLogD("download");
+        ewk_policy_decision_suspend(policyDecision);
+
+        // get uri information
+        const char* url = ewk_policy_decision_url_get(policyDecision);
+        if (NULL == url || strlen(url) == 0) {
+            WrtLogD("url data is empty");
+            ewk_policy_decision_use(policyDecision);
+            return;
+        }
+        WrtLogD("url = [%s]", url);
+
+        // get content information
+        const char* content =
+            ewk_policy_decision_response_mime_get(policyDecision);
+        WrtLogD("content type = [%s]", content);
+
+        // get cookie information
+        const char* cookie = ewk_policy_decision_cookie_get(policyDecision);
+        WrtLogD("cookie = [%s]", cookie);
+
+        WrtLogD("Content not supported, will be opened in external app");
+        This->m_appsSupport->downloadRequest(
+            url,
+            content,
+            cookie);
+        ewk_policy_decision_ignore(policyDecision);
+    } else if (policyDecisionType == EWK_POLICY_DECISION_IGNORE) {
+        WrtLogD("ignore");
+        ewk_policy_decision_ignore(policyDecision);
+    } else {
+        WrtLogD("Type isn't handled");
+        ewk_policy_decision_ignore(policyDecision);
+    }
+}
+
+void ViewLogic::contextmenuCustomizeCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* eventInfo)
+{
+    WrtLogD("contextmenuCustomizeCallback called");
+    Assert(data);
+    Assert(eventInfo);
+    ViewLogic* This = static_cast<ViewLogic*>(const_cast<void*>(data));
+    Ewk_Context_Menu* menu = static_cast<Ewk_Context_Menu*>(eventInfo);
+    if ((This->m_model->Type.Get().appType == WrtDB::APP_TYPE_TIZENWEBAPP) &&
+        (This->m_model->SettingList.Get().getContextMenu()
+         == ContextMenu_Disable))
+    {
+        WrtLogD("ContextMenu Disable!!");
+        for (unsigned int idx = 0; idx < ewk_context_menu_item_count(menu);) {
+            Ewk_Context_Menu_Item* item = ewk_context_menu_nth_item_get(menu,
+                                                                        idx);
+            Assert(item);
+            ewk_context_menu_item_remove(menu, item);
+        }
+    } else {
+        WrtLogD("ContextMenu Enable!!");
+        if(This->m_cbs->createContextMenuCallback)
+            This->m_cbs->createContextMenuCallback(eventInfo);
+    }
+}
+
+Eina_Bool ViewLogic::geolocationPermissionRequestCallback(
+    Evas_Object* obj,
+    Ewk_Geolocation_Permission_Request* geolocationPermissionRequest,
+    void* userData)
+{
+    Assert(userData);
+    Assert(geolocationPermissionRequest);
+
+    ViewLogic* This = static_cast<ViewLogic*>(userData);
+    DPL::OptionalBool ret =
+        This->m_privilegeSupport->getPrivilegeStatus(ViewModule::PrivilegeSupport::Privilege::LOCATION);
+    if (ret) {
+        ewk_geolocation_permission_reply(geolocationPermissionRequest, (*ret) ? EINA_TRUE : EINA_FALSE);
+        return EINA_TRUE;
+    }
+
+    ViewModule::GeolocationSupport::GeoLocationData geoData;
+    geoData.data = userData;
+    geoData.permissionRequest = geolocationPermissionRequest;
+    geoData.pkgId = This->m_model->TzPkgId.Get();
+    ViewModule::GeolocationSupport::geolocationPermissionRequest(
+        This->m_currentEwkView,
+        This->m_securityOriginSupport->getSecurityOriginDAO(),
+        &geoData);
+    return EINA_TRUE;
+}
+
+void ViewLogic::notificationShowCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* eventInfo)
+{
+    Assert(eventInfo);
+    Ewk_Notification* ewkNotification =
+        static_cast<Ewk_Notification*>(eventInfo);
+    ViewModule::WebNotificationDataPtr notiData(
+        new ViewModule::WebNotificationData(ewkNotification));
+
+    WrtLogD("notification id : %llu", notiData->getEwkNotiId());
+    WrtLogD("notification iconURL : %s", notiData->getIconUrl());
+    WrtLogD("notification title : %s", notiData->getTitle());
+    WrtLogD("notification body : %s", notiData->getBody());
+
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_webNotificationSupport->show(notiData)) {
+        ewk_notification_showed(This->m_ewkContext, notiData->getEwkNotiId());
+    }
+}
+
+void ViewLogic::notificationCancelCallback(
+    void* data,
+    Evas_Object* obj,
+    void* eventInfo)
+{
+    Assert(eventInfo);
+    uint64_t ewkNotiId = *static_cast<uint64_t*>(eventInfo);
+
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    Ewk_Notification* ewkNotification =
+        static_cast<Ewk_Notification*>(
+            This->m_webNotificationSupport->hide(ewkNotiId));
+    if (ewkNotification) {
+        Assert(obj);
+        Eina_List* list = NULL;
+        list = eina_list_append(list, ewkNotification);
+        ewk_view_notification_closed(obj, list);
+        eina_list_free(list);
+    }
+}
+
+Eina_Bool ViewLogic::notificationPermissionRequestCallback(
+    Evas_Object* obj,
+    Ewk_Notification_Permission_Request* request,
+    void* userData)
+{
+    WrtLogD("notificationPermissionRequestCallback called");
+    Assert(userData);
+    ViewLogic* This = static_cast<ViewLogic*>(userData);
+
+    Assert(request);
+    ViewModule::WebNotificationPermissionSupport::permissionRequest(
+        This->m_currentEwkView,
+        This->m_securityOriginSupport->getSecurityOriginDAO(),
+        request);
+    return EINA_TRUE;
+}
+
+// EWK Orientation Callback
+Eina_Bool ViewLogic::orientationLockCallback(
+    Evas_Object*,
+    Eina_Bool needLock,
+    int orientation,
+    void* data)
+{
+    WrtLogD("orientationLockCallback called");
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+
+    if (This->m_orientationThresholdTimer) {
+        WrtLogD("previous orientationLock isn't finished");
+        // Previous API call isn't finished. Keep angle and run it.
+        if (needLock == EINA_TRUE) {
+            // Screen.lockOrientation
+            This->m_deferredRotateAngle = orientation;
+        } else {
+            // Screen.unlockOrientation
+            This->m_deferredRotateAngle =
+                ViewModule::OrientationSupport::DEFERRED_ORIENTATION_UNLOCK;
+        }
+        return EINA_TRUE;
+    }
+
+    This->m_rotateAngle = orientation;
+
+    if (needLock == EINA_TRUE) {
+        // Screen.lockOrientation
+        int winAngle =
+            ViewModule::OrientationSupport::getWinOrientationAngle(orientation);
+        if (This->m_cbs->orientationLockCallback) {
+            This->m_cbs->orientationLockCallback(winAngle);
+        }
+        ewk_context_tizen_extensible_api_string_set(
+           This->m_ewkContext,
+           EXTENSIBLE_API_ROTATION_LOCK,
+           EINA_TRUE);
+        This->m_orientationThresholdTimer =
+            ecore_timer_add(ORIENTATION_THRESHOLD,
+                            orientationThresholdTimerCallback,
+                            This);
+    } else {
+        // Screen.unlockOrientation
+        if (This->m_model->SettingList.Get().getRotationValue() ==
+            Screen_AutoRotation)
+        {
+            if (This->m_cbs->orientationLockCallback) {
+                This->m_cbs->orientationLockCallback(OrientationAngle::Window::UNLOCK);
+            }
+            This->m_rotateAngle = 0;
+            ewk_context_tizen_extensible_api_string_set(
+               This->m_ewkContext,
+               EXTENSIBLE_API_ROTATION_LOCK,
+               EINA_FALSE);
+        }
+    }
+    return EINA_TRUE;
+}
+
+// Fullscreen API callbacks
+void ViewLogic::enterFullscreenCallback(
+    void* data,
+    Evas_Object* obj,
+    void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    ViewLogicMessageSupport::setViewmodes(
+        This->m_ewkContext,
+        "fullscreen");
+
+    if (eventInfo) {
+        This->m_isFullscreenByPlatform =
+            *static_cast<Eina_Bool*>(eventInfo) == EINA_TRUE;
+    }
+    if (This->m_cbs->enterFullscreenCallback) {
+        This->m_cbs->enterFullscreenCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::exitFullscreenCallback(
+    void* data,
+    Evas_Object* obj,
+    void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    ViewLogicMessageSupport::setViewmodes(
+        This->m_ewkContext,
+        Message::ToInjectedBundle::SET_VIEWMODES_MSGBODY_EXIT);
+
+    This->m_isFullscreenByPlatform = false;
+    if (This->m_cbs->exitFullscreenCallback) {
+        This->m_cbs->exitFullscreenCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::enabledVideoHwOverlayCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->enableVideoHwOverlayCallback) {
+        This->m_cbs->enableVideoHwOverlayCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::disabledVideoHwOverlayCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->disableVideoHwOverlayCallback) {
+        This->m_cbs->disableVideoHwOverlayCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::imeChangedCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* eventInfo)
+{
+    WrtLogD("enter");
+    Assert(data);
+    Assert(eventInfo);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    Eina_Rectangle *rect = static_cast<Eina_Rectangle *>(eventInfo);
+    This->m_imeWidth = rect->w;
+    This->m_imeHeight = rect->h;
+}
+
+void ViewLogic::imeOpenedCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* /*eventInfo*/)
+{
+    WrtLogD("enter");
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+
+    using namespace WrtPlugins::W3C;
+    SoftKeyboardChangeArgs args;
+    args.state = IME_STATE_ON;
+    args.width = This->m_imeWidth;
+    args.height = This->m_imeHeight;
+    This->fireJavascriptEvent(
+        static_cast<int>(SoftKeyboardChangeCustomEvent),
+        &args);
+}
+
+void ViewLogic::imeClosedCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* /*eventInfo*/)
+{
+    WrtLogD("enter");
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+
+    using namespace WrtPlugins::W3C;
+    SoftKeyboardChangeArgs args;
+    args.state = IME_STATE_OFF;
+    This->fireJavascriptEvent(
+        static_cast<int>(SoftKeyboardChangeCustomEvent),
+        &args);
+}
+
+Eina_Bool ViewLogic::usermediaPermissionRequestCallback(
+    Evas_Object* /*obj*/,
+    Ewk_User_Media_Permission_Request* request,
+    void* userData)
+{
+    WrtLogD("called");
+
+    Assert(userData);
+
+    ViewLogic* This = static_cast<ViewLogic*>(userData);
+    DPL::OptionalBool ret =
+        This->m_privilegeSupport->getPrivilegeStatus(ViewModule::PrivilegeSupport::Privilege::MEDIACAPTURE);
+    if (ret) {
+        ewk_user_media_permission_reply(request, (*ret) ? EINA_TRUE : EINA_FALSE);
+        return EINA_TRUE;
+    }
+
+    ViewModule::UsermediaSupport::usermediaPermissionRequest(
+        This->m_currentEwkView,
+        This->m_securityOriginSupport->getSecurityOriginDAO(),
+        request);
+    return EINA_TRUE;
+}
+
+// helper method
+CustomHandlerDB::CustomHandlerPtr getCustomHandlerFromData(void* data)
+{
+    Assert(data);
+    Ewk_Custom_Handlers_Data* handler =
+        static_cast<Ewk_Custom_Handlers_Data*>(data);
+    CustomHandlerDB::CustomHandlerPtr customHandler(
+        new CustomHandlerDB::CustomHandler());
+    const char* base_url = ewk_custom_handlers_data_base_url_get(handler);
+    if (base_url) {
+        WrtLogD("base url: %s", base_url);
+        customHandler->base_url = DPL::FromASCIIString(string(base_url));
+    }
+    const char* url = ewk_custom_handlers_data_url_get(handler);
+    if (url) {
+        WrtLogD("url: %s", url);
+        customHandler->url = DPL::FromASCIIString(string(url));
+    }
+    const char* target = ewk_custom_handlers_data_target_get(handler);
+    if (target) {
+        WrtLogD("target: %s", target);
+        customHandler->target = DPL::FromASCIIString(string(target));
+    }
+    const char* title = ewk_custom_handlers_data_title_get(handler);
+    if (title) {
+        WrtLogD("title: %s", title);
+        customHandler->title = DPL::FromASCIIString(string(title));
+    }
+    return customHandler;
+}
+
+void ViewLogic::attachToCustomHandlersDao()
+{
+    if (!m_attachedToCustomHandlerDao) {
+        CustomHandlerDB::Interface::attachDatabaseRW();
+    }
+}
+
+void ViewLogic::detachFromCustomHandlersDao()
+{
+    if (m_attachedToCustomHandlerDao) {
+        CustomHandlerDB::Interface::detachDatabase();
+    }
+}
+
+const int protocolWhiteListLenth = 15;
+char const * const protocolWhiteList[protocolWhiteListLenth] = {
+    "irc",
+    "geo",
+    "mailto",
+    "magnet",
+    "mms",
+    "news",
+    "nntp",
+    "sip",
+    "sms",
+    "smsto",
+    "ssh",
+    "tel",
+    "urn",
+    "webcal",
+    "xmpp"
+};
+
+const int contentBlackListLenth = 14;
+char const * const contentBlackList[contentBlackListLenth] = {
+    "application/x-www-form-urlencoded",
+    "application/xhtml+xml",
+    "application/xml",
+    "image/gif",
+    "image/jpeg",
+    "image/png",
+    "image/svg+xml",
+    "multipart/x-mixed-replace",
+    "text/cache-manifest",
+    "text/css",
+    "text/html",
+    "text/ping",
+    "text/plain",
+    "text/xml"
+};
+
+/**
+ * Saves user's response from popup to custom handler. Saves Yes/No and remember
+ * state.
+ * @param response
+ * @param customHandler
+ */
+void saveUserResponse(Wrt::Popup::PopupResponse response,
+                      CustomHandlerDB::CustomHandlerPtr customHandler)
+{
+    switch (response) {
+    case Wrt::Popup::YES_DO_REMEMBER:
+        WrtLogD("User allowed, remember");
+        customHandler->user_decision =
+            static_cast<CustomHandlerDB::HandlerState>
+            (CustomHandlerDB::Agreed | CustomHandlerDB::DecisionSaved);
+        break;
+    case Wrt::Popup::YES_DONT_REMEMBER:
+        WrtLogD("User allowed, don't remember");
+        customHandler->user_decision = CustomHandlerDB::Agreed;
+        break;
+    case Wrt::Popup::NO_DO_REMEMBER:
+        WrtLogD("User didn't allow, remember");
+        customHandler->user_decision =
+            static_cast<CustomHandlerDB::HandlerState>
+            (CustomHandlerDB::Declined | CustomHandlerDB::DecisionSaved);
+        break;
+    case Wrt::Popup::NO_DONT_REMEMBER:
+        WrtLogD("User didn't allow, don't remember");
+        customHandler->user_decision = CustomHandlerDB::Declined;
+        break;
+    }
+}
+
+//TODO registration, checking if registered and unregistration can be done in
+//common functions for both types of handlers. Only white and black lists
+//have to be separated
+//TODO attach database only one at the start (not in every callback?)
+void ViewLogic::protocolHandlerRegistrationCallback(void* data,
+                                                    Evas_Object* /*obj*/,
+                                                    void* eventInfo)
+{
+    Assert(data);
+    WrtLogD("enter");
+    CustomHandlerDB::CustomHandlerPtr customHandler =
+        getCustomHandlerFromData(eventInfo);
+
+    std::string scheme = DPL::ToUTF8String(customHandler->target);
+    if (scheme.empty()) {
+        WrtLogE("No scheme provided");
+        //TODO what about securityError?
+        return;
+    }
+    bool matched = false;
+    //scheme on whiteList
+    for (int i = 0; i < protocolWhiteListLenth; ++i) {
+        if (0 == strcmp(protocolWhiteList[i], scheme.c_str())) {
+            WrtLogD("Match found, protocol can be handled");
+            matched = true;
+        }
+    }
+    if (!matched) {
+        //starts with web+ and have at least 5 chars (lowercase ASCII)
+        if (strncmp("web+", scheme.c_str(), 4) || scheme.length() < 5) {
+            WrtLogW("Scheme neither on whitelist nor starts with \"web+\"");
+            //throw SecurityException
+            return;
+        }
+        int l = 4;
+        char c = scheme[l];
+        while (c != '\0') {
+            if (c < 'a' || c > 'z') {
+                WrtLogW("Wrong char inside scheme. Only lowercase ASCII letters accepted");
+                //throw SecurityException
+                return;
+            }
+            c = scheme[++l];
+        }
+    }
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    WrtLogD("Creating handlers dao");
+    This->attachToCustomHandlersDao();
+    CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
+    CustomHandlerDB::CustomHandlerPtr handler =
+        handlersDao.getProtocolHandler(customHandler->target,
+                                       customHandler->url,
+                                       customHandler->base_url);
+    if (handler && (handler->user_decision & CustomHandlerDB::DecisionSaved)) {
+        WrtLogD("Protocol already registered - nothing to do");
+    } else {
+        WrtLogD("Protocol handler not found");
+        Wrt::Popup::PopupResponse response =
+            GlobalSettings::PopupsTestModeEnabled() ? Wrt::Popup::
+                YES_DO_REMEMBER :
+            Wrt::Popup::PopupInvoker().askYesNoCheckbox(
+                PROTOCOL_HANDLER_ASK_TITLE,
+                PROTOCOL_HANDLER_ASK_MSG,
+                PROTOCOL_HANDLER_ASK_REMEMBER);
+        saveUserResponse(response, customHandler);
+        if (customHandler->user_decision == CustomHandlerDB::Declined) {
+            return;
+        }
+        if (customHandler->user_decision & CustomHandlerDB::Agreed) {
+            //TODO remove old default handler somehow from appsvc
+            WrtLogD("Registering appservice entry");
+            int ret = appsvc_set_defapp(APPSVC_OPERATION_VIEW,
+                                        NULL,
+                                        DPL::ToUTF8String(
+                                            customHandler->target).c_str(),
+                                        DPL::ToUTF8String(This->m_model->
+                                                              TizenId).c_str());
+            if (APPSVC_RET_OK != ret) {
+                WrtLogW("Appsvc entry failed: %d", ret);
+                //no database change
+                return;
+            }
+        }
+        handlersDao.registerProtocolHandler(*(customHandler.get()));
+
+        WrtLogD("Protocal saved");
+    }
+
+    This->detachFromCustomHandlersDao();
+}
+
+void ViewLogic::protocolHandlerIsRegisteredCallback(void* data,
+                                                    Evas_Object* /*obj*/,
+                                                    void* eventInfo)
+{
+    WrtLogD("enter");
+    CustomHandlerDB::CustomHandlerPtr customHandler = getCustomHandlerFromData(
+            eventInfo);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    WrtLogD("Creating handlers dao");
+    This->attachToCustomHandlersDao();
+    CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
+    CustomHandlerDB::CustomHandlerPtr handler =
+        handlersDao.getProtocolHandler(customHandler->target,
+                                       customHandler->url,
+                                       customHandler->base_url);
+    if (handler) {
+        if (handler->user_decision & CustomHandlerDB::Agreed) {
+            ewk_custom_handlers_data_result_set(
+                static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
+                EWK_CUSTOM_HANDLERS_REGISTERED);
+        } else {
+            ewk_custom_handlers_data_result_set(
+                static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
+                EWK_CUSTOM_HANDLERS_DECLINED);
+        }
+    } else {
+        ewk_custom_handlers_data_result_set(
+            static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
+            EWK_CUSTOM_HANDLERS_NEW);
+    }
+    This->detachFromCustomHandlersDao();
+}
+
+void ViewLogic::protocolHandlerUnregistrationCallback(void* data,
+                                                      Evas_Object* /*obj*/,
+                                                      void* eventInfo)
+{
+    WrtLogD("enter");
+    CustomHandlerDB::CustomHandlerPtr customHandler =
+        getCustomHandlerFromData(eventInfo);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    WrtLogD("Creating handlers dao");
+    This->attachToCustomHandlersDao();
+    CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
+    CustomHandlerDB::CustomHandlerPtr handlerCheck =
+        handlersDao.getProtocolHandler(customHandler->target,
+                                       customHandler->url,
+                                       customHandler->base_url);
+    This->detachFromCustomHandlersDao();
+    if (handlerCheck) {
+        if (handlerCheck->user_decision & CustomHandlerDB::Agreed) {
+            int ret = appsvc_unset_defapp(
+                    DPL::ToUTF8String(This->m_model->TizenId).c_str());
+            if (APPSVC_RET_OK != ret) {
+                WrtLogW("Failed to unregister appsvc entry");
+                return;
+            }
+        }
+        //if appsvc ok change custom_handlers_db
+        handlersDao.unregisterProtocolHandler(customHandler->target,
+                                              customHandler->url,
+                                              customHandler->base_url);
+    } else {
+        WrtLogD("Nothing to unregister");
+    }
+}
+
+void ViewLogic::contentHandlerRegistrationCallback(void* data,
+                                                   Evas_Object* /*obj*/,
+                                                   void* eventInfo)
+{
+    Assert(data);
+    WrtLogD("enter");
+    CustomHandlerDB::CustomHandlerPtr customHandler =
+        getCustomHandlerFromData(eventInfo);
+
+    std::string mimeType = DPL::ToUTF8String(customHandler->target);
+    if (mimeType.empty()) {
+        WrtLogE("No mimeType provided.");
+        return;
+    }
+    for (int i = 0; i < contentBlackListLenth; ++i) {
+        if (0 == strcmp(contentBlackList[i], mimeType.c_str())) {
+            WrtLogW("mimeType blacklisted");
+            //throw SecurityException
+            return;
+        }
+    }
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    WrtLogD("Creating handlers dao");
+    This->attachToCustomHandlersDao();
+    CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
+    CustomHandlerDB::CustomHandlerPtr handler =
+        handlersDao.getContentHandler(customHandler->target,
+                                      customHandler->url,
+                                      customHandler->base_url);
+    if (handler && (handler->user_decision & CustomHandlerDB::DecisionSaved)) {
+        WrtLogD("Protocol already registered - nothing to do");
+    } else {
+        WrtLogD("Protocol handler not found");
+        Wrt::Popup::PopupResponse response =
+            GlobalSettings::PopupsTestModeEnabled() ? Wrt::Popup::
+                YES_DO_REMEMBER :
+            Wrt::Popup::PopupInvoker().askYesNoCheckbox(
+                CONTENT_HANDLER_ASK_TITLE,
+                CONTENT_HANDLER_ASK_MSG,
+                CONTENT_HANDLER_AKS_REMEMBER);
+        saveUserResponse(response, customHandler);
+        if (customHandler->user_decision == CustomHandlerDB::Declined) {
+            return;
+        }
+        if (customHandler->user_decision & CustomHandlerDB::Agreed) {
+            //TODO remove old default handler somehow from appsvc
+            WrtLogD("Registering appservice entry");
+            int ret = appsvc_set_defapp(APPSVC_OPERATION_VIEW,
+                                        DPL::ToUTF8String(
+                                            customHandler->target).c_str(),
+                                        NULL,
+                                        DPL::ToUTF8String(This->m_model->
+                                                              TizenId).c_str());
+            if (APPSVC_RET_OK != ret) {
+                WrtLogW("Appsvc entry failed: %d", ret);
+                return;
+            }
+        }
+        handlersDao.registerContentHandler(*(customHandler.get()));
+        WrtLogD("Content saved");
+    }
+    This->detachFromCustomHandlersDao();
+}
+
+void ViewLogic::contentHandlerIsRegisteredCallback(void* data,
+                                                   Evas_Object* /*obj*/,
+                                                   void* eventInfo)
+{
+    WrtLogD("enter");
+    CustomHandlerDB::CustomHandlerPtr customHandler =
+        getCustomHandlerFromData(eventInfo);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    WrtLogD("Creating handlers dao");
+
+    This->attachToCustomHandlersDao();
+    CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
+    CustomHandlerDB::CustomHandlerPtr handler =
+        handlersDao.getContentHandler(customHandler->target,
+                                      customHandler->url,
+                                      customHandler->base_url);
+    if (handler) {
+        if (handler->user_decision & CustomHandlerDB::Agreed) {
+            ewk_custom_handlers_data_result_set(
+                static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
+                EWK_CUSTOM_HANDLERS_REGISTERED);
+        } else {
+            ewk_custom_handlers_data_result_set(
+                static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
+                EWK_CUSTOM_HANDLERS_DECLINED);
+        }
+    } else {
+        ewk_custom_handlers_data_result_set(
+            static_cast<Ewk_Custom_Handlers_Data*>(eventInfo),
+            EWK_CUSTOM_HANDLERS_NEW);
+    }
+    This->detachFromCustomHandlersDao();
+}
+
+void ViewLogic::contentHandlerUnregistrationCallback(void* data,
+                                                     Evas_Object* /*obj*/,
+                                                     void* eventInfo)
+{
+    WrtLogD("enter");
+    CustomHandlerDB::CustomHandlerPtr customHandler =
+        getCustomHandlerFromData(eventInfo);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    WrtLogD("Creating handlers dao");
+    This->attachToCustomHandlersDao();
+    CustomHandlerDB::CustomHandlerDAO handlersDao(This->m_model->TizenId);
+    CustomHandlerDB::CustomHandlerPtr handlerCheck =
+        handlersDao.getContentHandler(customHandler->target,
+                                      customHandler->url,
+                                      customHandler->base_url);
+    This->detachFromCustomHandlersDao();
+    if (handlerCheck) {
+        if (handlerCheck->user_decision & CustomHandlerDB::Agreed) {
+            int ret = appsvc_unset_defapp(
+                    DPL::ToUTF8String(This->m_model->TizenId).c_str());
+            if (APPSVC_RET_OK != ret) {
+                WrtLogW("Failed to unregister mime handler from appsvc");
+                return;
+            }
+        }
+        handlersDao.unregisterContentHandler(customHandler->target,
+                                             customHandler->url,
+                                             customHandler->base_url);
+    } else {
+        WrtLogD("Nothing to unregister");
+    }
+}
+
+void ViewLogic::didRunJavaScriptCallback(
+    Evas_Object* /*obj*/,
+    const char* result,
+    void* /*userData*/)
+{
+    WrtLogD("didRunJavaScriptCallback called");
+    WrtLogD("result = %s", result);
+}
+
+void ViewLogic::eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+    Assert(obj);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+
+    Ea_Callback_Type keyType =
+        static_cast<Ea_Callback_Type>(reinterpret_cast<int>(eventInfo));
+
+    WrtLogD("Key = [%d]", keyType);
+
+    std::string keyName;
+    if (keyType == EA_CALLBACK_BACK) {
+        Assert(obj);
+        // Call fullscreen exit API
+        // In case of fullscreen is entered by platform(default video tag),
+        // automatically exit fullscreen when backkey is selected
+        if (This->m_isFullscreenByPlatform) {
+            ewk_view_fullscreen_exit(obj);
+            return;
+        }
+
+        // Call text selection clear API
+        // In case of current state is selection mode,
+        // application doesn't need to handle back key
+        if (EINA_TRUE == ewk_view_text_selection_clear(obj)) {
+            return;
+        }
+        keyName = KeyName::BACK;
+    } else if (keyType == EA_CALLBACK_MORE) {
+        keyName = KeyName::MENU;
+    } else {
+        return;
+    }
+
+    if (This->m_model->SettingList.Get().getHWkeyEvent() == HWkeyEvent_Enable)
+    {
+        DispatchEventSupport::dispatchHwKeyEvent(obj, keyName);
+    }
+    if (This->m_cbs->keyCallback) {
+        This->m_cbs->keyCallback(obj, eventInfo);
+    }
+
+    return;
+}
+
+Eina_Bool ViewLogic::windowCloseIdlerCallback(void* data)
+{
+    WrtLogD("closeIdlerCallback");
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    This->windowClose();
+    return ECORE_CALLBACK_CANCEL;
+}
+
+Eina_Bool ViewLogic::exceededDatabaseQuotaCallback(Evas_Object* obj,
+                                                   Ewk_Security_Origin* origin,
+                                                   const char* ,
+                                                   unsigned long long ,
+                                                   void* data)
+{
+    WrtLogD("exceededDatabaseQuotaCallback called");
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    ViewModule::WebStorageSupport::createPermissionRequest(
+        This->m_currentEwkView,
+        This->m_securityOriginSupport->getSecurityOriginDAO(),
+        obj,
+        origin,
+        ewk_view_exceeded_database_quota_reply);
+    return EINA_TRUE;
+}
+
+Eina_Bool ViewLogic::exceededIndexedDatabaseQuotaCallback(Evas_Object* obj,
+                                                          Ewk_Security_Origin* origin,
+                                                          long long ,
+                                                          void* data)
+{
+    WrtLogD("exceededIndexedDatabaseQuotaCallback called");
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    ViewModule::WebStorageSupport::createPermissionRequest(
+        This->m_currentEwkView,
+        This->m_securityOriginSupport->getSecurityOriginDAO(),
+        obj,
+        origin,
+        ewk_view_exceeded_indexed_database_quota_reply);
+    return EINA_TRUE;
+}
+
+Eina_Bool ViewLogic::exceededLocalFileSystemQuotaCallback(Evas_Object* obj,
+                                                          Ewk_Security_Origin* origin,
+                                                          long long ,
+                                                          void* data)
+{
+    WrtLogD("exceededLocalFileSystemQuotaCallback called");
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    ViewModule::WebStorageSupport::createPermissionRequest(
+        This->m_currentEwkView,
+        This->m_securityOriginSupport->getSecurityOriginDAO(),
+        obj,
+        origin,
+        ewk_view_exceeded_local_file_system_quota_reply);
+    return EINA_TRUE;
+}
+
+void ViewLogic::certificateConfirmRequestCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* eventInfo)
+{
+    WrtLogD("certificateConfirmRequestCallback called");
+
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    Assert(eventInfo);
+    ViewModule::CertificateConfirmSupport::certificatePermissionRequest(
+        This->m_currentEwkView,
+        This->m_certificateSupport->getCertificateDAO(),
+        eventInfo);
+}
+
+#if USE(WEBKIT_UPVERSION)
+void ViewLogic::authenticationRequestCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* eventInfo)
+{
+    WrtLogD("authenticationRequestCallback called");
+    Assert(data);
+    Assert(eventInfo);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    const char* url = ewk_view_url_get(This->m_currentEwkView);
+    if (!url || strlen(url) == 0) {
+        Ewk_Auth_Request* authRequest = static_cast<Ewk_Auth_Request*>(eventInfo);
+        ewk_auth_request_cancel(authRequest);
+        return;
+    }
+    ViewModule::AuthenticationRequestSupport::authenticationRequest(
+        This->m_currentEwkView,
+        url,
+        eventInfo);
+}
+#else
+void ViewLogic::authenticationChallengeRequestCallback(
+    void* data,
+    Evas_Object* /*obj*/,
+    void* eventInfo)
+{
+    WrtLogD("authenticationChallengeRequestCallback called");
+    Assert(data);
+    Assert(eventInfo);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    const char* url = ewk_view_url_get(This->m_currentEwkView);
+    if (!url || strlen(url) == 0) {
+        Ewk_Auth_Challenge* authChallenge = static_cast<Ewk_Auth_Challenge*>(eventInfo);
+        ewk_auth_challenge_credential_cancel(authChallenge);
+        return;
+    }
+    ViewModule::AuthenticationChallengeSupport::authenticationChallengeRequest(
+        This->m_currentEwkView,
+        url,
+        eventInfo);
+}
+#endif // USE(WEBKIT_UPVERSION)
+
+void ViewLogic::viewFrameRenderedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    static bool logEnable = (getenv("WRT_FRAME_RENDERED_LOG_ENABLE") != NULL);
+    if (logEnable) {
+        WrtLogD("enter");
+    }
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->frameRenderedCallback) {
+        This->m_cbs->frameRenderedCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::mediacontrolRotateHorizontal(void* data,
+                                             Evas_Object* obj,
+                                             void* /*eventInfo*/)
+{
+    WrtLogD("mediacontrolRotateHorizontal called");
+    Assert(data);
+    Assert(obj);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    ViewModule::OrientationSupport::setEwkOrientation(
+        obj,
+        OrientationAngle::W3C::Landscape::PRIMARY);
+    if (This->m_cbs->orientationLockCallback) {
+        This->m_cbs->orientationLockCallback(OrientationAngle::Window::Landscape::PRIMARY);
+    }
+}
+
+void ViewLogic::mediacontrolRotateVertical(void* data,
+                                           Evas_Object* obj,
+                                           void* /*eventInfo*/)
+{
+    WrtLogD("mediacontrolRotateVertical called");
+    Assert(data);
+    Assert(obj);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    ViewModule::OrientationSupport::setEwkOrientation(
+        obj,
+        OrientationAngle::W3C::Portrait::PRIMARY);
+    if (This->m_cbs->orientationLockCallback) {
+        This->m_cbs->orientationLockCallback(OrientationAngle::Window::Portrait::PRIMARY);
+    }
+}
+
+void ViewLogic::mediacontrolRotateExit(void* data,
+                                       Evas_Object* obj,
+                                       void* /*eventInfo*/)
+{
+    WrtLogD("mediacontrolRotateExit called");
+    Assert(data);
+    Assert(obj);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+
+    int w3cAngle = 0;
+    int winAngle = 0;
+    if (This->m_rotateAngle == 0) {
+        // application hasn't call orientation lock
+        WidgetSettingScreenLock screenLock =
+            This->m_model->SettingList.Get().getRotationValue();
+        if (screenLock == Screen_Portrait) {
+            w3cAngle = OrientationAngle::W3C::Portrait::PRIMARY;
+            winAngle = OrientationAngle::Window::Portrait::PRIMARY;
+        } else if (screenLock == Screen_Landscape) {
+            w3cAngle = OrientationAngle::W3C::Landscape::PRIMARY;
+            winAngle = OrientationAngle::Window::Landscape::PRIMARY;
+        } else if (screenLock == Screen_AutoRotation) {
+            if (This->m_cbs->orientationLockCallback) {
+                This->m_cbs->orientationLockCallback(OrientationAngle::Window::UNLOCK);
+            }
+            return;
+        }
+    } else {
+        // Restore previous orientation
+        w3cAngle =
+            ViewModule::OrientationSupport::getW3COrientationAngle(
+                This->m_rotateAngle);
+        winAngle =
+            ViewModule::OrientationSupport::getWinOrientationAngle(
+                This->m_rotateAngle);
+    }
+
+    ViewModule::OrientationSupport::setEwkOrientation(obj, w3cAngle);
+    if (This->m_cbs->orientationLockCallback) {
+        This->m_cbs->orientationLockCallback(winAngle);
+    }
+
+}
+
+Eina_Bool ViewLogic::orientationThresholdTimerCallback(void* data)
+{
+    WrtLogD("orientationThresholdTimerCallback");
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+
+    if (This->m_deferredRotateAngle ==
+        ViewModule::OrientationSupport::DEFERRED_ORIENTATION_EMPTY)
+    {
+        // There is no defered orientation API call
+        This->m_orientationThresholdTimer = NULL;
+        return ECORE_CALLBACK_CANCEL;
+    }
+
+    if (This->m_deferredRotateAngle != This->m_rotateAngle) {
+        This->m_rotateAngle = This->m_deferredRotateAngle;
+        int w3cAngle = 0;
+        int winAngle = 0;
+        if (This->m_rotateAngle == 0) {
+            WidgetSettingScreenLock screenLock =
+                This->m_model->SettingList.Get().getRotationValue();
+            if (screenLock == Screen_Portrait) {
+                w3cAngle = OrientationAngle::W3C::Portrait::PRIMARY;
+                winAngle = OrientationAngle::Window::Portrait::PRIMARY;
+            } else if (screenLock == Screen_Landscape) {
+                w3cAngle = OrientationAngle::W3C::Landscape::PRIMARY;
+                winAngle = OrientationAngle::Window::Landscape::PRIMARY;
+            } else if (screenLock == Screen_AutoRotation) {
+                if (This->m_cbs->orientationLockCallback) {
+                    This->m_cbs->orientationLockCallback(OrientationAngle::Window::UNLOCK);
+                }
+                This->m_orientationThresholdTimer = NULL;
+                return ECORE_CALLBACK_CANCEL;
+            }
+        } else {
+            // Restore previous orientation
+            w3cAngle =
+                ViewModule::OrientationSupport::getW3COrientationAngle(
+                    This->m_rotateAngle);
+            winAngle =
+                ViewModule::OrientationSupport::getWinOrientationAngle(
+                    This->m_rotateAngle);
+        }
+
+        ViewModule::OrientationSupport::setEwkOrientation(
+            This->m_currentEwkView,
+            w3cAngle);
+        if (This->m_cbs->orientationLockCallback) {
+            This->m_cbs->orientationLockCallback(winAngle);
+        }
+        This->m_deferredRotateAngle =
+            ViewModule::OrientationSupport::DEFERRED_ORIENTATION_EMPTY;
+        return ECORE_CALLBACK_RENEW;
+    }
+
+    This->m_orientationThresholdTimer = NULL;
+    return ECORE_CALLBACK_CANCEL;
+}
+
+void ViewLogic::popupReplyWaitStart(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    This->m_isPopupReplyWait = true;
+    if (This->m_cbs->popupReplyWaitStartCallback) {
+        This->m_cbs->popupReplyWaitStartCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::popupReplyWaitFinish(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    This->m_isPopupReplyWait = false;
+    if (This->m_cbs->popupReplyWaitFinishCallback) {
+        This->m_cbs->popupReplyWaitFinishCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::consoleMessageCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->consoleMessageCallback) {
+        This->m_cbs->consoleMessageCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::rotatePreparedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_cbs->rotatePreparedCallback) {
+        This->m_cbs->rotatePreparedCallback(obj, eventInfo);
+    }
+}
+
+void ViewLogic::windowClose()
+{
+    WrtLogD("windowClose");
+    AssertMsg(m_closedEwkView, "no closed webview");
+
+    if (1 >= m_ewkViewList.size()) {
+        if (m_cbs->processExitCallback) {
+            m_cbs->processExitCallback(m_closedEwkView, NULL);
+        }
+    } else {
+        // call user callbacks
+        if (m_cbs->unsetWebviewCallback) {
+            m_cbs->unsetWebviewCallback(m_currentEwkView);
+        }
+        removeEwkView(m_closedEwkView);
+
+        // get latest ewkView
+        m_currentEwkView = m_ewkViewList.back();
+
+        setEwkViewVisible(m_currentEwkView);
+
+        // show ewkView
+        if (m_cbs->setWebviewCallback) {
+            m_cbs->setWebviewCallback(m_currentEwkView);
+        }
+    }
+}
+
+void ViewLogic::systemSettingsChangedCallback(system_settings_key_e key,
+                                              void* data)
+{
+    WrtLogD("systemSettingsChanged");
+    WrtLogD("System setting Key is [%d]", key);
+
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+
+    if (SYSTEM_SETTINGS_KEY_FONT_TYPE == key) {
+        if (!This->m_currentEwkView) {
+            WrtLogE("ewkView isn't initialized");
+            return;
+        }
+        ewk_view_use_settings_font(This->m_currentEwkView);
+    } else {
+        WrtLogE("Unregister system callback is called");
+    }
+}
+
diff --git a/src/view/webkit/view_logic.h b/src/view/webkit/view_logic.h
new file mode 100644 (file)
index 0000000..f952cb0
--- /dev/null
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic.h
+ * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @brief   Declaration file for view logic for Webkit2
+ */
+
+#ifndef VIEW_LOGIC_H_
+#define VIEW_LOGIC_H_
+
+#include <i_view_module.h>
+#include <memory>
+#include <map>
+#include <string>
+#include <dpl/log/wrt_log.h>
+#include <dpl/assert.h>
+#include <dpl/platform.h>
+
+#include <widget_model.h>
+#include <i_runnable_widget_object.h>
+#include <common/view_logic_apps_support.h>
+#include <common/view_logic_vibration_support.h>
+#include <system_settings.h>
+
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+namespace ViewModule {
+class CertificateSupport;
+class PrivilegeSupport;
+class SecurityOriginSupport;
+class WebNotificationSupport;
+}
+
+class ViewLogic : public ViewModule::IViewModule
+{
+  public:
+    ViewLogic();
+    virtual ~ViewLogic();
+
+    // IViewModule Impl
+    bool createWebView(Ewk_Context* context,
+                       Evas_Object* window);
+    void destroyWebView();
+    void prepareView(WidgetModel* m, const std::string &startUrl);
+    void showWidget();
+    void hideWidget();
+    void suspendWidget();
+    void resumeWidget();
+    void setWidgetUrl(const std::string &startUrl);
+    void resetWidgetFromSuspend();
+    void resetWidgetFromResume();
+    void backward();
+    void reloadStartPage();
+    Evas_Object* getCurrentWebview();
+    void fireJavascriptEvent(int event, void* data);
+    void setUserCallbacks(const WRT::UserDelegatesPtr& cbs);
+    void checkSyncMessageFromBundle(
+            const char* name,
+            const char* body,
+            char** returnData);
+    void checkAsyncMessageFromBundle(
+            const char* name,
+            const char* body);
+    void downloadData(const char* url);
+    void activateVibration(bool on, uint64_t time);
+
+
+  private:
+    void initializeSupport();
+    void initializePluginLoading();
+    void initializeXwindowHandle();
+    void resetWidgetCommon();
+
+    // EwkView operations
+    void ewkClientInit(Evas_Object *wkView);
+    void ewkClientDeinit(Evas_Object *wkView);
+    bool createEwkView(Evas* canvas);
+    void prepareEwkView(Evas_Object *wkView);
+    void removeEwkView(Evas_Object *wkView);
+    void setEwkViewVisible(Evas_Object *wkView);
+    void setEwkViewInvisible(Evas_Object *wkView);
+    void resumeWebkit(Evas_Object *wkView);
+    void suspendWebkit(Evas_Object *wkView);
+
+    // WKPageLoaderClient
+    static void loadStartedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void loadFinishedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void loadProgressStartedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void loadProgressCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void loadProgressFinishedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void processCrashedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void webProcessCrashedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+    // EWK Callback
+    static void createWindowCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void closeWindowCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+    // EWK PolicyDecide Callback
+    static void policyNavigationDecideCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void policyNewWindowDecideCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void pageResponseDecideCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+    // EWK ContextMenu Callback
+    static void contextmenuCustomizeCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+    // EWK Geolocation Callback
+    static Eina_Bool geolocationPermissionRequestCallback(
+        Evas_Object* obj,
+        Ewk_Geolocation_Permission_Request* geolocationPermissionRequest,
+        void* userData);
+
+    // EWK Notification Callback
+    static void notificationShowCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void notificationCancelCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static Eina_Bool notificationPermissionRequestCallback(
+        Evas_Object* obj,
+        Ewk_Notification_Permission_Request* request,
+        void* userData);
+
+    // EWK Orientation Callback
+    static Eina_Bool orientationLockCallback(
+        Evas_Object* obj,
+        Eina_Bool needLock,
+        int orientation,
+        void* data);
+
+    // EWK Fullscreen API callbacks
+    static void enterFullscreenCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void exitFullscreenCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+    static void enabledVideoHwOverlayCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+    static void disabledVideoHwOverlayCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+    // EWK IME Change/Show/Hide Callback
+    static void imeChangedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void imeOpenedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+    static void imeClosedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+    // EWK Usermedia Callback
+    static Eina_Bool usermediaPermissionRequestCallback(
+        Evas_Object* obj,
+        Ewk_User_Media_Permission_Request* request,
+        void* userData);
+
+    // custom content/scheme handlers
+    static void protocolHandlerRegistrationCallback(void* data,
+                                                    Evas_Object* obj,
+                                                    void* eventInfo);
+    static void protocolHandlerIsRegisteredCallback(void* data,
+                                                    Evas_Object* obj,
+                                                    void* eventInfo);
+    static void protocolHandlerUnregistrationCallback(void* data,
+                                                      Evas_Object* obj,
+                                                      void* eventInfo);
+
+    static void contentHandlerRegistrationCallback(void* data,
+                                                   Evas_Object* obj,
+                                                   void* eventInfo);
+    static void contentHandlerIsRegisteredCallback(void* data,
+                                                   Evas_Object* obj,
+                                                   void* eventInfo);
+    static void contentHandlerUnregistrationCallback(void* data,
+                                                     Evas_Object* obj,
+                                                     void* eventInfo);
+    static Eina_Bool exceededDatabaseQuotaCallback(Evas_Object* obj,
+                                                   Ewk_Security_Origin* origin,
+                                                   const char* databaseName,
+                                                   unsigned long long expectedQuota,
+                                                   void* data);
+    static Eina_Bool exceededIndexedDatabaseQuotaCallback(Evas_Object* obj,
+                                                          Ewk_Security_Origin* origin,
+                                                          long long expectedQuota,
+                                                          void* data);
+    static Eina_Bool exceededLocalFileSystemQuotaCallback(Evas_Object* obj,
+                                                          Ewk_Security_Origin* origin,
+                                                          long long expectedQuota,
+                                                          void* data);
+    static void certificateConfirmRequestCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+#if USE(WEBKIT_UPVERSION)
+    static void authenticationRequestCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+#else
+    static void authenticationChallengeRequestCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+#endif
+    static void viewFrameRenderedCallback(
+        void* data,
+        Evas_Object* obj,
+        void* eventInfo);
+
+    static void mediacontrolRotateHorizontal(void* data,
+                                             Evas_Object* obj,
+                                             void* eventInfo);
+    static void mediacontrolRotateVertical(void* data,
+                                           Evas_Object* obj,
+                                           void* eventInfo);
+    static void mediacontrolRotateExit(void* data,
+                                       Evas_Object* obj,
+                                       void* eventInfo);
+    static void popupReplyWaitStart(void* data,
+                                    Evas_Object* obj,
+                                    void* eventInfo);
+    static void popupReplyWaitFinish(void* data,
+                                     Evas_Object* obj,
+                                     void* eventInfo);
+    static void consoleMessageCallback(void* data,
+                                       Evas_Object* obj,
+                                       void* eventInfo);
+    static void rotatePreparedCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+    void attachToCustomHandlersDao();
+    void detachFromCustomHandlersDao();
+
+    // JS execute callback
+    static void didRunJavaScriptCallback(
+        Evas_Object* obj,
+        const char* result,
+        void* userData);
+
+    // event callback
+    static void eaKeyCallback(void* data,
+                              Evas_Object* obj,
+                              void* eventInfo);
+
+    // idler callback
+    static Eina_Bool windowCloseIdlerCallback(void *data);
+
+    // timer callback
+    static Eina_Bool orientationThresholdTimerCallback(void* data);
+
+    // window
+    void windowClose(void);
+
+    // system settings
+    static void systemSettingsChangedCallback(system_settings_key_e key, void* data);
+
+    Ewk_Context* m_ewkContext;
+    bool m_attachedToCustomHandlerDao;
+    std::list<Evas_Object*> m_ewkViewList;
+    Evas_Object* m_currentEwkView;
+    Evas_Object* m_closedEwkView;
+    Evas_Object* m_window;
+    WidgetModel* m_model;
+    std::string m_blockedUri;
+    std::string m_theme;
+    std::string m_startUrl;
+    WRT::UserDelegatesPtr m_cbs;
+    size_t m_imeWidth;
+    size_t m_imeHeight;
+    bool m_isBackgroundReload;
+    bool m_isBackgroundSupport;
+    int m_rotateAngle;
+    int m_deferredRotateAngle;
+    Ecore_Timer* m_orientationThresholdTimer;
+    // TODO: change name to m_isWebkitBlocked
+    bool m_isPopupReplyWait;
+    bool m_isFullscreenByPlatform;
+
+    std::unique_ptr<ViewModule::AppsSupport> m_appsSupport;
+    std::unique_ptr<ViewModule::VibrationSupport> m_vibrationSupport;
+    std::unique_ptr<ViewModule::SecurityOriginSupport> m_securityOriginSupport;
+    std::unique_ptr<ViewModule::CertificateSupport> m_certificateSupport;
+    std::unique_ptr<ViewModule::PrivilegeSupport> m_privilegeSupport;
+    std::unique_ptr<ViewModule::WebNotificationSupport> m_webNotificationSupport;
+
+    static std::map<const std::string, const Evas_Smart_Cb> m_ewkCallbacksMap;
+};
+
+#endif //VIEW_LOGIC_H_
diff --git a/src/view/webkit/view_logic_authentication_challenge_support.cpp b/src/view/webkit/view_logic_authentication_challenge_support.cpp
new file mode 100644 (file)
index 0000000..f9da82a
--- /dev/null
@@ -0,0 +1,238 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_authentication_challenge_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "view_logic_authentication_challenge_support.h"
+
+#include <string>
+
+#include <dpl/assert.h>
+#include <dpl/availability.h>
+#include <dpl/log/wrt_log.h>
+#include <efl_assist.h>
+#include <Elementary.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+#include <widget_string.h>
+
+namespace ViewModule {
+namespace {
+struct authenticationData {
+    Ewk_Auth_Challenge* m_authChallenge;
+    std::string m_bodyText;
+    Evas_Object* m_navi;
+    Evas_Object* m_idEdit;
+    Evas_Object* m_pwEdit;
+};
+
+// function declare
+void askUserInformation(authenticationData* authData);
+void loginAuthentication(authenticationData* authData);
+void cancelAuthentication(authenticationData* authData);
+Evas_Object* getEvasObjectByWidgetName(Evas_Object* obj, const char* name);
+Evas_Object* createEdit(Evas_Object* parent, bool isIdEdit);
+void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo);
+void buttonClickedCallback(void* data, Evas_Object* obj, void* eventInfo);
+void editActivatedCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+void askUserInformation(authenticationData* authData)
+{
+    Evas_Object* popup = elm_popup_add(authData->m_navi);
+
+    elm_object_style_set(popup, "popup/default");
+    evas_object_size_hint_weight_set(popup , EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(popup , EVAS_HINT_FILL, EVAS_HINT_FILL);
+    elm_object_domain_translatable_part_text_set(popup, "title,text", "wrt", WRT_BODY_AUTHENTICATION_REQUIRED_IDS);
+
+    ea_object_event_callback_add(popup, EA_CALLBACK_BACK, eaKeyCallback, authData);
+
+    Evas_Object* layout = elm_layout_add(popup);
+    elm_layout_file_set(layout, WRT_EDJ_PATH, "authChallengePopup");
+    evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+    Evas_Object* label = elm_label_add(layout);
+    elm_label_line_wrap_set(label , ELM_WRAP_WORD);
+    elm_object_text_set(label, authData->m_bodyText.c_str());
+    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);
+
+    Evas_Object* idEdit = createEdit(layout, true);
+    authData->m_idEdit = idEdit;
+
+    Evas_Object* pwEdit = createEdit(layout, false);
+    authData->m_pwEdit = pwEdit;
+
+    elm_object_part_content_set(layout, "elm.swallow.label", label);
+    elm_object_part_content_set(layout, "elm.swallow.idfield", idEdit);
+    elm_object_part_content_set(layout, "elm.swallow.pwfield", pwEdit);
+    edje_object_part_text_set(elm_layout_edje_get(layout), "elm.swallow.idtext", WRT_BODY_AUTHUSERNAME);
+    edje_object_part_text_set(elm_layout_edje_get(layout), "elm.swallow.pwtext", WRT_BODY_PASSWORD);
+    elm_object_content_set(popup, layout);
+
+    Evas_Object* cancelButton = elm_button_add(popup);
+    elm_object_domain_translatable_part_text_set(cancelButton, 0, "wrt", WRT_SK_CANCEL_IDS);
+    elm_object_style_set(cancelButton, "popup");
+    elm_object_part_content_set(popup, "button1", cancelButton);
+    evas_object_smart_callback_add(cancelButton, "clicked", buttonClickedCallback, static_cast<void*>(authData));
+
+    Evas_Object* loginButton = elm_button_add(popup);
+    elm_object_domain_translatable_part_text_set(loginButton, 0, "sys_string", WRT_SK_LOGIN_IDS);
+    elm_object_style_set(loginButton, "popup");
+    elm_object_part_content_set(popup, "button2", loginButton);
+    evas_object_smart_callback_add(loginButton, "clicked", buttonClickedCallback, static_cast<void*>(authData));
+
+    evas_object_show(popup);
+}
+
+void loginAuthentication(authenticationData* authData)
+{
+    WrtLogD("called");
+
+    Assert(authData);
+
+    const char* id = elm_entry_entry_get(authData->m_idEdit);
+    const char* pw = elm_entry_entry_get(authData->m_pwEdit);
+    ewk_auth_challenge_credential_use(authData->m_authChallenge, const_cast<char*>(id), const_cast<char*>(pw));
+
+    Evas_Object* popup = getEvasObjectByWidgetName(authData->m_idEdit, "elm_popup");
+    if (popup) {
+        evas_object_hide(popup);
+        evas_object_del(popup);
+    }
+}
+
+void cancelAuthentication(authenticationData* authData)
+{
+    WrtLogD("called");
+
+    Assert(authData);
+
+    ewk_auth_challenge_credential_cancel(authData->m_authChallenge);
+
+    Evas_Object* popup = getEvasObjectByWidgetName(authData->m_idEdit, "elm_popup");
+    if (popup) {
+        evas_object_hide(popup);
+        evas_object_del(popup);
+    }
+}
+
+Evas_Object* getEvasObjectByWidgetName(Evas_Object* obj, const char* name)
+{
+    Assert(obj);
+    Evas_Object* current = elm_object_parent_widget_get(obj);
+    while (strcmp(elm_object_widget_type_get(current), name)) {
+        current = elm_object_parent_widget_get(current);
+        if (!current) {
+            return NULL;
+        }
+    }
+    return current;
+}
+
+Evas_Object* createEdit(Evas_Object* parent, bool isIdEdit)
+{
+    Evas_Object* edit = ea_editfield_add(parent, EA_EDITFIELD_SCROLL_SINGLELINE);
+    elm_entry_cnp_mode_set(edit, ELM_CNP_MODE_PLAINTEXT);
+    elm_object_style_set(edit, "editfield/password/popup");
+    elm_entry_single_line_set(edit, EINA_TRUE);
+    elm_entry_scrollable_set(edit, EINA_TRUE);
+    elm_entry_prediction_allow_set(edit, EINA_FALSE);
+    elm_object_signal_emit(edit, "elm,action,hide,search_icon", "");
+    elm_entry_autocapital_type_set(edit, ELM_AUTOCAPITAL_TYPE_NONE);
+
+    if (isIdEdit) {
+        evas_object_smart_callback_add(edit, "activated", editActivatedCallback, NULL);
+    } else {
+        elm_entry_password_set(edit, EINA_TRUE);
+        elm_entry_input_panel_layout_set(edit, ELM_INPUT_PANEL_LAYOUT_PASSWORD);
+    }
+
+    return edit;
+}
+
+void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    Assert(data);
+
+    authenticationData* authData = static_cast<authenticationData*>(data);
+    cancelAuthentication(authData);
+}
+
+void buttonClickedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    Assert(data);
+    Assert(obj);
+
+    bool isLogin = !strcmp(WRT_SK_LOGIN, elm_object_text_get(obj));
+
+    authenticationData* authData = static_cast<authenticationData*>(data);
+    if (isLogin) {
+        loginAuthentication(authData);
+    } else {
+        cancelAuthentication(authData);
+    }
+}
+
+void editActivatedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(eventInfo);
+    DPL_UNUSED_PARAM(data);
+
+    Assert(obj);
+    elm_object_focus_set(obj, EINA_TRUE);
+}
+} // namespace
+
+void AuthenticationChallengeSupport::authenticationChallengeRequest(
+    Evas_Object* webview,
+    std::string url,
+    void* data)
+{
+    WrtLogD("called");
+    authenticationData* authData = new authenticationData();
+    Assert(webview);
+    authData->m_navi = getEvasObjectByWidgetName(webview, "elm_naviframe");
+
+    Assert(data);
+    authData->m_authChallenge = static_cast<Ewk_Auth_Challenge*>(data);
+
+    const char* authRealm =
+        ewk_auth_challenge_realm_get(authData->m_authChallenge);
+    authData->m_bodyText = url;
+    if (authRealm != NULL) {
+        authData->m_bodyText += "<br>";
+        authData->m_bodyText += std::string(authRealm);
+    }
+    ewk_auth_challenge_suspend(authData->m_authChallenge);
+
+    // ask to user
+    askUserInformation(authData);
+}
+} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_authentication_challenge_support.h b/src/view/webkit/view_logic_authentication_challenge_support.h
new file mode 100644 (file)
index 0000000..8aa9b0d
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_authentication_challenge_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_AUTHENTICATION_CHALLENGE_SUPPORT_H_
+#define VIEW_LOGIC_AUTHENTICATION_CHALLENGE_SUPPORT_H_
+
+#include <string>
+#include <Elementary.h>
+
+namespace ViewModule {
+namespace AuthenticationChallengeSupport {
+void authenticationChallengeRequest(
+    Evas_Object* webview,
+    std::string url,
+    void* data);
+} // namespace AuthenticationChallengeSupport
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_AUTHENTICATION_CHALLENGE_SUPPORT_H_
\ No newline at end of file
diff --git a/src/view/webkit/view_logic_authentication_request_support.cpp b/src/view/webkit/view_logic_authentication_request_support.cpp
new file mode 100644 (file)
index 0000000..d62c7f6
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_authentication_request_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "view_logic_authentication_request_support.h"
+
+#include <string>
+
+#include <dpl/assert.h>
+#include <dpl/availability.h>
+#include <dpl/log/wrt_log.h>
+#include <efl_assist.h>
+#include <Elementary.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+#include <widget_string.h>
+
+namespace ViewModule {
+namespace {
+
+const char* const EVAS_SMART_CALLBACK_CLICKED = "clicked";
+const char* const EVAS_SMART_CALLBACK_CHANGED = "changed";
+const char* const EVAS_SMART_CALLBACK_PREEDIT_CHANGED = "preedit,changed";
+const char* const EVAS_SMART_CALLBACK_FOCUSED = "focused";
+const char* const EVAS_SMART_CALLBACK_UNFOCUSED = "unfocused";
+const char* const ELM_SIGNAL_ERASER_CLICKED = "elm,eraser,clicked";
+const char* const ELM_SIGNAL_STATE_GUIDETEXT_HIDE = "elm,state,guidetext,hide";
+const char* const ELM_SIGNAL_STATE_ERASER_SHOW = "elm,state,eraser,show";
+const char* const ELM_SIGNAL_STATE_HIDE_SHOW = "elm,state,eraser,hide";
+const char* const ELM_SWALLOW_CONTENT = "elm.swallow.content";
+const char* const ELM_SWALLOW_LABEL = "elm.swallow.label";
+const char* const ELM_SWALLOW_IDFIELD = "elm.swallow.idfield";
+const char* const ELM_SWALLOW_PASSWDFIELD = "elm.swallow.passwdfield";
+
+const char* const GROUP_NAME_AUTHENTICATION_REQUEST_POPUP =
+    "authChallengePopup";
+const char* const THEME_EDITFIELD = "editfield";
+const char* const THEME_DEFAULT = "default";
+
+const char* const STYLE_POPUP_BUTTON_DEFAULT = "popup_button/default";
+const char* const STYLE_DEFAULT_EDITFIELD =
+    "DEFAULT='font_size=34 color=#808080 ellipsis=1'";
+
+const char* const PART_IDFIELD_TEXT = "idfield_text";
+const char* const PART_PASSWORDFIELD_TEXT = "passwdfield_text";
+const char* const PART_BUTTON1 = "button1";
+const char* const PART_BUTTON2 = "button2";
+
+const char* const ELM = "elm";
+const char* const TITLE_TEXT = "title,text";
+const char* const LAYOUT = "layout";
+const char* const ERASER = "eraser";
+const char* const WIDGET_NAME_POPUP = "elm_popup";
+const char* const WIDGET_NAME_NAVIFRAME = "elm_naviframe";
+
+const char* const AUTHENTICATION_REQUEST_TITLE_TEXT =
+    "Authentication Requested";
+const char* const AUTHENTICATION_REQUEST_BODY_PRETEXT =
+    "A username and password are being requested by ";
+const char* const AUTHENTICATION_REQUEST_BODY_MIDDLETEXT =
+    ". The site says: ";
+
+const char* const TEXT_DOUBLE_QUOTATION_MARKS = " \"";
+const char* const TEXT_ID_FIELD = " User Name: ";
+const char* const TEXT_PASSWORD_FIELD = " Password: ";
+const char* const TEXT_OK = "Ok";
+const char* const TEXT_CANCEL = "Cancel";
+
+struct authenticationData {
+    Ewk_Auth_Request* m_authRequest;
+    std::string m_bodyText;
+    Evas_Object* m_navi;
+    Evas_Object* m_idEdit;
+    Evas_Object* m_pwEdit;
+};
+
+// function declare
+void askUserInformation(authenticationData* authData);
+void loginAuthentication(authenticationData* authData);
+void cancelAuthentication(authenticationData* authData);
+Evas_Object* getEvasObjectByWidgetName(Evas_Object* obj, const char* name);
+Evas_Object* createEdit(Evas_Object* parent, bool isIdEdit = false);
+void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo);
+void buttonClickedCallback(void* data, Evas_Object* obj, void* eventInfo);
+void editActivatedCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+void askUserInformation(authenticationData* authData)
+{
+    Evas_Object* popup = elm_popup_add(authData->m_navi);
+    evas_object_size_hint_weight_set(popup,
+                                     EVAS_HINT_EXPAND,
+                                     EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(popup, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    elm_object_part_text_set(popup,
+                             TITLE_TEXT,
+                             AUTHENTICATION_REQUEST_TITLE_TEXT);
+
+    Evas_Object* label = elm_label_add(popup);
+    evas_object_size_hint_weight_set(label,
+                                     EVAS_HINT_EXPAND,
+                                     EVAS_HINT_EXPAND);
+
+    elm_label_line_wrap_set(label , ELM_WRAP_WORD);
+    elm_object_text_set(label, authData->m_bodyText.c_str());
+
+    authData->m_idEdit = createEdit(popup);
+    authData->m_pwEdit = createEdit(popup, true);
+
+    Evas_Object* popupLayout = elm_layout_add(popup);
+    elm_layout_file_set(popupLayout,
+                        WRT_EDJ_PATH,
+                        GROUP_NAME_AUTHENTICATION_REQUEST_POPUP);
+    evas_object_size_hint_weight_set(popupLayout,
+                                     EVAS_HINT_EXPAND,
+                                     EVAS_HINT_EXPAND);
+    /* FIXME : The text should be translated. */
+    edje_object_part_text_set(elm_layout_edje_get(popupLayout),
+                              PART_IDFIELD_TEXT,
+                              TEXT_ID_FIELD);
+    edje_object_part_text_set(elm_layout_edje_get(popupLayout),
+                              PART_PASSWORDFIELD_TEXT,
+                              TEXT_PASSWORD_FIELD);
+
+    elm_object_part_content_set(popupLayout, ELM_SWALLOW_LABEL, label);
+    elm_object_part_content_set(popupLayout,
+                                ELM_SWALLOW_IDFIELD,
+                                authData->m_idEdit);
+    elm_object_part_content_set(popupLayout,
+                                ELM_SWALLOW_PASSWDFIELD,
+                                authData->m_pwEdit);
+    elm_object_content_set(popup, popupLayout);
+
+    Evas_Object* lButton = elm_button_add(popup);
+    elm_object_text_set(lButton, TEXT_OK);
+    elm_object_style_set(lButton, STYLE_POPUP_BUTTON_DEFAULT);
+    elm_object_part_content_set(popup, PART_BUTTON1, lButton);
+    evas_object_smart_callback_add(lButton,
+                                   EVAS_SMART_CALLBACK_CLICKED,
+                                   buttonClickedCallback,
+                                   static_cast<void *>(authData));
+
+    Evas_Object* rButton= elm_button_add(popup);
+    elm_object_text_set(rButton, TEXT_CANCEL);
+    elm_object_style_set(rButton, STYLE_POPUP_BUTTON_DEFAULT);
+    elm_object_part_content_set(popup, PART_BUTTON2, rButton);
+    evas_object_smart_callback_add(rButton,
+                                   EVAS_SMART_CALLBACK_CLICKED,
+                                   buttonClickedCallback,
+                                   static_cast<void *>(authData));
+
+    evas_object_show(popup);
+}
+
+void loginAuthentication(authenticationData* authData)
+{
+    WrtLogD("called");
+
+    Assert(authData);
+
+    const char* id = elm_entry_entry_get(authData->m_idEdit);
+    const char* pw = elm_entry_entry_get(authData->m_pwEdit);
+    ewk_auth_request_authenticate(authData->m_authRequest, const_cast<char*>(id), const_cast<char*>(pw));
+
+    Evas_Object* popup = getEvasObjectByWidgetName(authData->m_idEdit, "elm_popup");
+    if (popup) {
+        evas_object_hide(popup);
+        evas_object_del(popup);
+    }
+}
+
+void cancelAuthentication(authenticationData* authData)
+{
+    WrtLogD("called");
+
+    Assert(authData);
+
+    ewk_auth_request_cancel(authData->m_authRequest);
+
+    Evas_Object* popup = getEvasObjectByWidgetName(authData->m_idEdit, "elm_popup");
+    if (popup) {
+        evas_object_hide(popup);
+        evas_object_del(popup);
+    }
+}
+
+Evas_Object* getEvasObjectByWidgetName(Evas_Object* obj, const char* name)
+{
+    Assert(obj);
+    Evas_Object* current = elm_object_parent_widget_get(obj);
+    while (strcmp(elm_object_widget_type_get(current), name)) {
+        current = elm_object_parent_widget_get(current);
+        if (!current) {
+            return NULL;
+        }
+    }
+    return current;
+}
+
+Evas_Object* createEdit(Evas_Object* parent, bool isIdEdit)
+{
+    Evas_Object* edit = ea_editfield_add(parent, EA_EDITFIELD_SCROLL_SINGLELINE);
+    elm_entry_cnp_mode_set(edit, ELM_CNP_MODE_PLAINTEXT);
+    elm_object_style_set(edit, "editfield/password/popup");
+    elm_entry_single_line_set(edit, EINA_TRUE);
+    elm_entry_scrollable_set(edit, EINA_TRUE);
+    elm_entry_prediction_allow_set(edit, EINA_FALSE);
+    elm_object_signal_emit(edit, "elm,action,hide,search_icon", "");
+    elm_entry_autocapital_type_set(edit, ELM_AUTOCAPITAL_TYPE_NONE);
+
+    if (isIdEdit) {
+        evas_object_smart_callback_add(edit, "activated", editActivatedCallback, NULL);
+    } else {
+        elm_entry_password_set(edit, EINA_TRUE);
+        elm_entry_input_panel_layout_set(edit, ELM_INPUT_PANEL_LAYOUT_PASSWORD);
+    }
+
+    return edit;
+}
+
+void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    Assert(data);
+
+    authenticationData* authData = static_cast<authenticationData*>(data);
+    cancelAuthentication(authData);
+}
+
+void buttonClickedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    Assert(data);
+    Assert(obj);
+
+    authenticationData* authData = static_cast<authenticationData *>(data);
+    Evas_Object* popup = getEvasObjectByWidgetName(obj, WIDGET_NAME_POPUP);
+
+    bool allow = !strcmp(TEXT_OK, elm_object_text_get(obj));
+    if (allow) {
+        const char* id =
+            elm_entry_entry_get(
+                elm_object_part_content_get(authData->m_idEdit,
+                                            ELM_SWALLOW_CONTENT));
+        const char* pw =
+            elm_entry_entry_get(
+                elm_object_part_content_get(authData->m_pwEdit,
+                                            ELM_SWALLOW_CONTENT));
+        ewk_auth_request_authenticate(authData->m_authRequest,
+                                      const_cast<char *>(id),
+                                      const_cast<char *>(pw));
+    } else {
+        ewk_auth_request_cancel(authData->m_authRequest);
+    }
+}
+
+void editActivatedCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(eventInfo);
+    DPL_UNUSED_PARAM(data);
+
+    Assert(obj);
+    elm_object_focus_set(obj, EINA_TRUE);
+}
+} // namespace
+
+void AuthenticationRequestSupport::authenticationRequest(
+    Evas_Object* webview,
+    std::string url,
+    void* data)
+{
+    WrtLogD("authenticationRequest called");
+    authenticationData* authData = new authenticationData();
+    Assert(webview);
+    authData->m_navi = getEvasObjectByWidgetName(webview, "elm_naviframe");
+
+    Assert(data);
+    authData->m_authRequest = static_cast<Ewk_Auth_Request*>(data);
+
+    // create body text
+    // TODO : The text should be translated
+    const char* authRealm = ewk_auth_request_realm_get(authData->m_authRequest);
+    if (authRealm != NULL) {
+        authData->m_bodyText =
+            std::string(AUTHENTICATION_REQUEST_BODY_PRETEXT) +
+            std::string(url) +
+            std::string(AUTHENTICATION_REQUEST_BODY_MIDDLETEXT) +
+            std::string(TEXT_DOUBLE_QUOTATION_MARKS) +
+            std::string(authRealm) +
+            std::string(TEXT_DOUBLE_QUOTATION_MARKS);
+    }
+    ewk_auth_request_suspend(authData->m_authRequest);
+
+    // ask to user
+    askUserInformation(authData);
+}
+} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_authentication_request_support.h b/src/view/webkit/view_logic_authentication_request_support.h
new file mode 100644 (file)
index 0000000..26a649f
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_authentication_request_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_AUTHENTICATION_REQUEST_SUPPORT_H_
+#define VIEW_LOGIC_AUTHENTICATION_REQUEST_SUPPORT_H_
+
+#include <string>
+#include <Evas.h>
+
+namespace ViewModule {
+namespace AuthenticationRequestSupport {
+void authenticationRequest(
+    Evas_Object* webview,
+    std::string url,
+    void* data);
+} // namespace AuthenticationSupport
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_AUTHENTICATION_REQUEST_SUPPORT_H_
diff --git a/src/view/webkit/view_logic_certificate_confirm_support.cpp b/src/view/webkit/view_logic_certificate_confirm_support.cpp
new file mode 100644 (file)
index 0000000..98fe845
--- /dev/null
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_certificate_confirm_support.cpp
+ * @author  Leerang Song (leerang.song@samsung.com)
+ */
+
+#include "view_logic_certificate_confirm_support.h"
+
+#include <string>
+#include <sstream>
+#include <dpl/log/wrt_log.h>
+#include <dpl/availability.h>
+#include <dpl/assert.h>
+#include <wrt-commons/certificate-dao/certificate_dao_types.h>
+#include <wrt-commons/certificate-dao/certificate_dao.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <common/view_logic_certificate_support.h>
+#include <Elementary.h>
+#include <widget_string.h>
+
+namespace ViewModule {
+namespace CertificateConfirmSupport {
+using namespace CertificateDB;
+using namespace ViewModule::CertificateSupportUtil;
+
+namespace {
+
+// function declare
+void askUserForCertificatePermission(
+    Evas_Object* window,
+    PermissionData* data);
+void setPermissionResult(PermissionData* permData, Result result);
+static void popupCallback(void* data, Evas_Object* obj, void* eventInfo);
+static void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+void askUserForCertificatePermission(
+    Evas_Object* window,
+    PermissionData* data)
+{
+    WrtLogD("askUserForCertificatePermission called");
+    Ewk_Certificate_Policy_Decision* certificatePolicyDecision =
+        static_cast<Ewk_Certificate_Policy_Decision*>(data->m_data);
+    Assert(certificatePolicyDecision);
+
+    std::string msg = std::string(WRT_POP_CERTIFICATE_PERMISSION)
+        + " " + ewk_certificate_policy_decision_url_get(certificatePolicyDecision);
+    Evas_Object* popup = createPopup(window,
+                                     msg.c_str(),
+                                     WRT_BODY_REMEMBER_PREFERENCE_IDS,
+                                     popupCallback,
+                                     eaKeyCallback,
+                                     data);
+
+    if (popup == NULL) {
+        WrtLogE("Fail to create popup object");
+        delete data;
+        return;
+    } else {
+        evas_object_show(popup);
+    }
+}
+
+void setPermissionResult(PermissionData* permData, Result result)
+{
+    Assert(permData);
+    Ewk_Certificate_Policy_Decision* certificatePolicyDecision =
+        static_cast<Ewk_Certificate_Policy_Decision*>(permData->m_data);
+
+    if (result != RESULT_UNKNOWN) {
+        permData->m_certiDao->setCertificateData(permData->m_certiData, result);
+    }
+
+    Eina_Bool ret = (result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ? EINA_TRUE : EINA_FALSE;
+    ewk_certificate_policy_decision_allowed_set(certificatePolicyDecision, ret);
+}
+
+void popupCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    setPermissionResult(permData, getResult(obj));
+    delete permData;
+
+    Evas_Object* popup = getPopup(obj);
+    evas_object_hide(popup);
+    evas_object_del(popup);
+}
+
+void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    setPermissionResult(permData, RESULT_DENY_ONCE);
+    delete permData;
+
+    evas_object_hide(obj);
+    evas_object_del(obj);
+}
+} // namespace
+
+void certificatePermissionRequest(
+    Evas_Object* window,
+    CertificateDB::CertificateDAO* certificateDAO,
+    void* data)
+{
+    WrtLogD("certificationPermissionRequest called");
+    Assert(certificateDAO);
+    Assert(data);
+
+    Ewk_Certificate_Policy_Decision* certificatePolicyDecision =
+        static_cast<Ewk_Certificate_Policy_Decision*>(data);
+    ewk_certificate_policy_decision_suspend(certificatePolicyDecision);
+    Assert(certificatePolicyDecision);
+
+    CertificateData certificateData(
+             DPL::FromUTF8String(
+                ewk_certificate_policy_decision_certificate_pem_get(
+                     certificatePolicyDecision)));
+
+    // check cache database
+    Result result = certificateDAO->getResult(certificateData);
+
+    if (RESULT_ALLOW_ONCE == result || RESULT_ALLOW_ALWAYS == result) {
+        WrtLogD("allow");
+        ewk_certificate_policy_decision_allowed_set(
+            certificatePolicyDecision,
+            EINA_TRUE);
+         return;
+   } else if (RESULT_DENY_ONCE == result || RESULT_DENY_ALWAYS == result) {
+        WrtLogD("Deny");
+        ewk_certificate_policy_decision_allowed_set(
+            certificatePolicyDecision,
+            EINA_FALSE);
+         return;
+    }
+    // ask to user
+    PermissionData* permissionData =
+        new PermissionData(certificateDAO,
+                           certificateData,
+                           certificatePolicyDecision);
+    askUserForCertificatePermission(window, permissionData);
+    return;
+}
+}
+} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_certificate_confirm_support.h b/src/view/webkit/view_logic_certificate_confirm_support.h
new file mode 100755 (executable)
index 0000000..8bd42ba
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_certificate_confirm_support.h
+ * @author  Leerang Song (leerang.song@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_CERTIFICATE_CONFIRM_SUPPORT_H_
+#define VIEW_LOGIC_CERTIFICATE_CONFIRM_SUPPORT_H_
+
+#include <memory.h>
+#include <Elementary.h>
+
+namespace CertificateDB {
+class CertificateDAO;
+}
+
+namespace ViewModule {
+namespace CertificateConfirmSupport {
+void certificatePermissionRequest(
+    Evas_Object* window,
+    CertificateDB::CertificateDAO* certificateDAO,
+    void* data);
+}
+} // namespace ViewModule
+
+#endif
diff --git a/src/view/webkit/view_logic_geolocation_support.cpp b/src/view/webkit/view_logic_geolocation_support.cpp
new file mode 100644 (file)
index 0000000..39e0cd1
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_geolocation_support.cpp
+ * @author  Grzegorz Krawczyk (g.krawczyk@samsung.com)
+ */
+
+#include "view_logic_geolocation_support.h"
+
+#include <string>
+#include <sstream>
+
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/availability.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao_types.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao.h>
+#include <EWebKit.h>
+#include <widget_string.h>
+#include <common/view_logic_help_popup_support.h>
+#include <common/view_logic_security_origin_support_util.h>
+#include <Elementary.h>
+#include <app.h>
+#include <privacy_manager_client.h>
+#include <privacy_manager_client_types.h>
+
+namespace ViewModule {
+namespace GeolocationSupport {
+using namespace SecurityOriginDB;
+using namespace ViewModule::SecurityOriginSupportUtil;
+
+namespace {
+// function declare
+void askUserForGeolocationPermission(
+    Evas_Object* window,
+    PermissionData* data);
+void setPermissionResult(PermissionData* permData, Result result);
+static void popupCallback(void* data, Evas_Object* obj, void* eventInfo);
+static void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+void askUserForGeolocationPermission(
+    Evas_Object* window,
+    PermissionData* data)
+{
+    WrtLogD("askUserForGeolocationPermission called");
+    std::string origin = DPL::ToUTF8String(data->m_originData.origin.host);
+    if (origin.empty()) {
+        origin = "local";
+    }
+    std::string appname;
+    char* name = NULL;
+    if (app_get_name(&name) == APP_ERROR_NONE) {
+        appname = name;
+        free(name);
+    } else {
+        appname = "application";
+    }
+
+    std::string body =
+        WrtText::replacePS({WRT_POP_GEOLOCATION_PERMISSION, appname, origin});
+    Evas_Object* popup = createPopup(window,
+                                     body.c_str(),
+                                     WRT_BODY_REMEMBER_PREFERENCE_IDS,
+                                     popupCallback,
+                                     eaKeyCallback,
+                                     data);
+
+    if (popup == NULL) {
+        WrtLogE("Fail to create popup object");
+        delete data;
+        return;
+    } else {
+        evas_object_show(popup);
+    }
+}
+
+void setPermissionResult(PermissionData* permData, Result result)
+{
+    Assert(permData);
+    if (result != RESULT_UNKNOWN) {
+        permData->m_originDao->setSecurityOriginData(permData->m_originData, result);
+    }
+
+    Ewk_Geolocation_Permission_Request* permissionRequest =
+        static_cast<Ewk_Geolocation_Permission_Request*>(permData->m_data);
+
+    Eina_Bool ret = (result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ? EINA_TRUE : EINA_FALSE;
+
+    const char* package_id = DPL::ToUTF8String(permData->m_pkgId).c_str();
+    char* location_privacy = "http://tizen.org/privilege/location";
+    const char *privacy_list[] = {
+        location_privacy,
+        "\0"
+    };
+
+    WrtLogD("packageId %s", package_id);
+    int privacy_ret = privacy_manager_client_install_privacy(package_id, privacy_list, false);
+    WrtLogD("privacy manager ret val: %i", privacy_ret);
+
+    ewk_geolocation_permission_reply(permissionRequest, ret);
+}
+
+void popupCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(obj);
+    Assert(data);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    setPermissionResult(permData, getResult(obj));
+    delete permData;
+
+    Evas_Object* popup = getPopup(obj);
+    if (isNeedHelpPopup(popup)) {
+        ViewModule::HelpPopupSupport::showClearDefaultPopup(popup);
+    }
+    evas_object_hide(popup);
+    evas_object_del(popup);
+}
+
+void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+    DPL_UNUSED_PARAM(eventInfo);
+
+    Assert(data);
+    Assert(obj);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    Evas_Object* popup = getPopup(obj);
+    setPermissionResult(permData, RESULT_DENY_ONCE);
+
+    delete permData;
+    evas_object_hide(popup);
+    evas_object_del(popup);
+}
+} // namespace
+
+void geolocationPermissionRequest(
+    Evas_Object* window,
+    SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+    void* data)
+{
+    WrtLogD("geolocationPermissionRequest called");
+    Assert(securityOriginDAO);
+    Assert(data);
+    GeoLocationData *geoData = static_cast<GeoLocationData*>(data);
+    Ewk_Geolocation_Permission_Request* permissionRequest =
+        static_cast<Ewk_Geolocation_Permission_Request*>(geoData->permissionRequest);
+
+    const Ewk_Security_Origin* ewkOrigin =
+        ewk_geolocation_permission_request_origin_get(
+            permissionRequest);
+    Assert(ewkOrigin);
+
+    SecurityOriginData securityOriginData(
+        WrtDB::FEATURE_GEOLOCATION,
+        Origin(
+            DPL::FromUTF8String(ewk_security_origin_protocol_get(ewkOrigin)),
+            DPL::FromUTF8String(ewk_security_origin_host_get(ewkOrigin)),
+            ewk_security_origin_port_get(ewkOrigin)));
+
+    // check cache database
+    Result result = securityOriginDAO->getResult(securityOriginData);
+    if (RESULT_ALLOW_ONCE == result || RESULT_ALLOW_ALWAYS == result) {
+        WrtLogD("allow");
+        ewk_geolocation_permission_reply(permissionRequest, EINA_TRUE);
+        return;
+    } else if (RESULT_DENY_ONCE == result || RESULT_DENY_ALWAYS == result) {
+        WrtLogD("deny");
+        ewk_geolocation_permission_reply(permissionRequest, EINA_FALSE);
+        return;
+    }
+
+    DPL::String pkgId = geoData->pkgId;
+    // ask to user
+    PermissionData* permissionData =
+        new PermissionData(securityOriginDAO,
+                           securityOriginData,
+                           permissionRequest,
+                           pkgId);
+    askUserForGeolocationPermission(window, permissionData);
+    return;
+}
+} // namespace GeolocationSupport
+} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_geolocation_support.h b/src/view/webkit/view_logic_geolocation_support.h
new file mode 100644 (file)
index 0000000..d97e5ce
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_geolocation_support.h
+ * @author  Grzegorz Krawczyk (g.krawczyk@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_GEOLOCATION_SUPPORT_H_
+#define VIEW_LOGIC_GEOLOCATION_SUPPORT_H_
+
+#include <memory.h>
+#include <Elementary.h>
+#include <dpl/string.h>
+#include <EWebKit_internal.h>
+
+namespace SecurityOriginDB {
+class SecurityOriginDAO;
+}
+
+namespace ViewModule {
+namespace GeolocationSupport {
+
+typedef struct {
+    void* data;
+    Ewk_Geolocation_Permission_Request* permissionRequest;
+    DPL::String pkgId;
+}GeoLocationData;
+
+void geolocationPermissionRequest(
+    Evas_Object* window,
+    SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+    void* data);
+} // namespace GeolocationSupport
+} // namespace ViewModule
+
+#endif
diff --git a/src/view/webkit/view_logic_message_support.cpp b/src/view/webkit/view_logic_message_support.cpp
new file mode 100644 (file)
index 0000000..36d409b
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_message_support.cpp
+ * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @author  Yunchan Cho (yunchan.cho@samsung.com)
+ * @brief   View logic message support - implementation
+ */
+#include "view_logic_message_support.h"
+
+#include <sstream>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <message_support.h>
+#include <js_overlay_types.h>
+
+namespace ViewLogicMessageSupport {
+void init(Ewk_Context* ewkContext, const std::string& tizenId)
+{
+    const char* name = Message::ToInjectedBundle::INIT;
+    const char* msg = tizenId.c_str();
+
+    ewk_context_message_post_to_injected_bundle(ewkContext, name, msg);
+}
+
+void start(Ewk_Context* ewkContext,
+           const DPL::String& tizenId,
+           double scale,
+           const char *encodedBundle,
+           const char *theme)
+{
+    std::stringstream ssMsg;
+
+    std::string id = DPL::ToUTF8String(tizenId);
+    ssMsg << id << " ";
+
+    ssMsg << "_" << scale << " ";
+
+    if (encodedBundle) {
+        ssMsg << "_" << encodedBundle << " ";
+    } else {
+        ssMsg << "null" << " ";
+    }
+
+    if (theme) {
+        ssMsg << "_" << theme;
+    } else {
+        ssMsg << "null";
+    }
+
+    std::string msgString = ssMsg.str();
+
+    const char* msg = msgString.c_str();
+    const char* name = Message::ToInjectedBundle::START;
+
+    ewk_context_message_post_to_injected_bundle(ewkContext, name, msg);
+}
+
+void shutdown(Ewk_Context* ewkContext)
+{
+    const char* name = Message::ToInjectedBundle::SHUTDOWN;
+    ewk_context_message_post_to_injected_bundle(ewkContext, name, name);
+}
+
+void setCustomProperties(
+    Ewk_Context* ewkContext,
+    double* scale,
+    const char* encodedBundle,
+    const char* theme)
+{
+    std::stringstream ssMsg;
+
+    if (scale) {
+        ssMsg << "_" << *scale << " ";
+    } else {
+        ssMsg << "null" << " ";
+    }
+
+    if (encodedBundle) {
+        ssMsg << "_" << encodedBundle << " ";
+    } else {
+        ssMsg << "null" << " ";
+    }
+
+    if (theme) {
+        ssMsg << "_" << theme;
+    } else {
+        ssMsg << "null";
+    }
+
+    std::string msgString = ssMsg.str();
+
+    const char* msg = msgString.c_str();
+    const char* name = Message::ToInjectedBundle::SET_CUSTOM_PROPERTIES;
+
+    ewk_context_message_post_to_injected_bundle(ewkContext, name, msg);
+}
+
+void dispatchJavaScriptEvent(
+    Ewk_Context* ewkContext,
+    WrtPlugins::W3C::CustomEventType eventType,
+    void *data)
+{
+    using namespace WrtPlugins::W3C;
+    std::stringstream str;
+    str << eventType;
+
+    // if needed, arguments for event should be set here
+    if (eventType == SoftKeyboardChangeCustomEvent) {
+        if (data) {
+            SoftKeyboardChangeArgs* args =
+                static_cast<SoftKeyboardChangeArgs *>(data);
+            str << " " << args->state;
+            str << " " << args->width;
+            str << " " << args->height;
+        }
+    }
+
+    std::string msgString = str.str();
+    const char* msg = msgString.c_str();
+    const char* name = Message::ToInjectedBundle::DISPATCH_JS_EVENT;
+
+    ewk_context_message_post_to_injected_bundle(ewkContext, name, msg);
+}
+
+void setXwindowHandle(Ewk_Context* ewkContext, const unsigned int handle)
+{
+    const char* name = Message::ToInjectedBundle::SET_XWINDOW_HANDLE;
+    std::stringstream ssMsg;
+    ssMsg << handle;
+    std::string msgString = ssMsg.str();
+    const char* msg = msgString.c_str();
+
+    ewk_context_message_post_to_injected_bundle(ewkContext, name, msg);
+}
+
+void setViewmodes(Ewk_Context* ewkContext, const char* msg)
+{
+    const char* name = Message::ToInjectedBundle::SET_VIEWMODES;
+    ewk_context_message_post_to_injected_bundle(ewkContext, name, msg);
+}
+} // namespace ViewLogicMessageSupport
diff --git a/src/view/webkit/view_logic_message_support.h b/src/view/webkit/view_logic_message_support.h
new file mode 100644 (file)
index 0000000..341fa54
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_message_support.h
+ * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
+ * @author  Yunchan Cho (yunchan.cho@samsung.com)
+ * @brief   View logic message support - declaration
+ */
+#ifndef VIEW_LOGIC_MESSAGE_SUPPORT_H_
+#define VIEW_LOGIC_MESSAGE_SUPPORT_H_
+
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <dpl/string.h>
+#include <js_overlay_types.h>
+
+namespace ViewLogicMessageSupport {
+void init(Ewk_Context* ewkContext,
+          const std::string& tizenId);
+void start(Ewk_Context* ewkContext,
+           const DPL::String& tizenId,
+           double scale,
+           const char *encodedBundle,
+           const char *theme);
+void shutdown(Ewk_Context* ewkContext);
+void setCustomProperties(
+    Ewk_Context* ewkContext,
+    double* scale = NULL,
+    const char* encodedBundle = NULL,
+    const char* theme = NULL);
+void dispatchJavaScriptEvent(
+    Ewk_Context* ewkContext,
+    WrtPlugins::W3C::CustomEventType eventType,
+    void* data);
+void setXwindowHandle(Ewk_Context* ewkContext, const unsigned int handle);
+void setViewmodes(Ewk_Context* ewkContext, const char* msg);
+} // namespace ViewLogicMessageSupport
+
+#endif // VIEW_LOGIC_MESSAGE_SUPPORT_H_
diff --git a/src/view/webkit/view_logic_orientation_support.cpp b/src/view/webkit/view_logic_orientation_support.cpp
new file mode 100644 (file)
index 0000000..3046c93
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       view_logic_orientation_support.cpp
+ * @author     Jihoon Chung (jihoon.chung@samsung.com)
+ * @version    1.0
+ */
+
+ #include "view_logic_orientation_support.h"
+
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <widget_data_types.h>
+
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+namespace ViewModule {
+
+int OrientationSupport::getWinOrientationAngle(int ewkOrientation)
+{
+    int angle;
+    if (ewkOrientation & EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY) {
+        angle = OrientationAngle::Window::Portrait::PRIMARY;
+    } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_PRIMARY) {
+        angle = OrientationAngle::Window::Landscape::PRIMARY;
+    } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY) {
+        angle = OrientationAngle::Window::Portrait::SECONDARY;
+    } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_SECONDARY) {
+        angle = OrientationAngle::Window::Landscape::SECONDARY;
+    } else {
+        WrtLogD("Wrong orientation value is passed");
+        Assert(false);
+    }
+    return angle;
+}
+
+int OrientationSupport::getW3COrientationAngle(int ewkOrientation)
+{
+    int angle;
+    if (ewkOrientation & EWK_SCREEN_ORIENTATION_PORTRAIT_PRIMARY) {
+        angle = OrientationAngle::W3C::Portrait::PRIMARY;
+    } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_PRIMARY) {
+        angle = OrientationAngle::W3C::Landscape::PRIMARY;
+    } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_PORTRAIT_SECONDARY) {
+        angle = OrientationAngle::W3C::Portrait::SECONDARY;
+    } else if (ewkOrientation & EWK_SCREEN_ORIENTATION_LANDSCAPE_SECONDARY) {
+        angle = OrientationAngle::W3C::Landscape::SECONDARY;
+    } else {
+        WrtLogD("Wrong orientation value is passed");
+        Assert(false);
+    }
+    return angle;
+}
+
+void OrientationSupport::setEwkOrientation(Evas_Object* ewk,
+                                           int angle)
+{
+    WrtLogD("setOrientation called");
+    ewk_view_orientation_send(ewk, angle);
+}
+} // ViewModule
diff --git a/src/view/webkit/view_logic_orientation_support.h b/src/view/webkit/view_logic_orientation_support.h
new file mode 100644 (file)
index 0000000..2512afc
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       view_logic_orientation_support.h
+ * @author     Jihoon Chung (jihoon.chung@samsung.com)
+ * @version    1.0
+ */
+
+#ifndef VIEW_LOGIC_ORIENTATION_SUPPORT_H_
+#define VIEW_LOGIC_ORIENTATION_SUPPORT_H_
+
+#include <Elementary.h>
+
+namespace ViewModule {
+namespace OrientationSupport {
+const int DEFERRED_ORIENTATION_EMPTY = -1;
+const int DEFERRED_ORIENTATION_UNLOCK = 0;
+
+int getWinOrientationAngle(int ewkOrientation);
+int getW3COrientationAngle(int ewkOrientation);
+void setEwkOrientation(Evas_Object* ewk, int angle);
+} // namespace OrientationSupport
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_ORIENTATION_SUPPORT_H_
\ No newline at end of file
diff --git a/src/view/webkit/view_logic_scheme_support.cpp b/src/view/webkit/view_logic_scheme_support.cpp
new file mode 100644 (file)
index 0000000..f7c1fa9
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       view_logic_scheme_support.cpp
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    1.0
+ */
+
+#include "view_logic_scheme_support.h"
+
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <common/scheme_action_map.h>
+#include <Elementary.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+namespace ViewModule {
+namespace {
+char const * const TIZEN_SCHEME = "tizen";
+char const * const TIZEN_EXIT = "tizen://exit";
+char const * const TIZEN_HIDE = "tizen://hide";
+char const * const TIZEN_CHANGE_USERAGNET = "tizen://changeUA";
+
+static Eina_Bool exitAppIdlerCallback(void* /*data*/)
+{
+    elm_exit();
+    return ECORE_CALLBACK_CANCEL;
+}
+} // namespace
+
+bool SchemeSupport::HandleTizenScheme(const char* uri,
+                                      Evas_Object* window,
+                                      Evas_Object* wkView)
+{
+    if (!uri) {
+        WrtLogW("Empty uri");
+        return false;
+    }
+    if (!window) {
+        WrtLogW("Empty window data");
+        return false;
+    }
+
+    if (strncmp(uri, TIZEN_EXIT, strlen(TIZEN_EXIT)) == 0) {
+        WrtLogD("%s : exit", uri);
+        ecore_idler_add(exitAppIdlerCallback, NULL);
+        return true;
+    } else if (strncmp(uri, TIZEN_HIDE, strlen(TIZEN_HIDE)) == 0) {
+        WrtLogD("%s : hide", uri);
+        elm_win_lower(window);
+        return true;
+    } else if (strncmp(uri,
+                       TIZEN_CHANGE_USERAGNET,
+                       strlen(TIZEN_CHANGE_USERAGNET)) == 0)
+    {
+        WrtLogD("%s : change UA", uri);
+        const char* userAgentString = strstr(uri, "=");
+        if (NULL == userAgentString) {
+            WrtLogW("UA string is NULL");
+        } else {
+            userAgentString++;
+            WrtLogD("Setting custom user agent as: %s", userAgentString);
+            ewk_view_user_agent_set(wkView, userAgentString);
+        }
+        return true;
+    }
+    return false;
+}
+
+bool SchemeSupport::filterURIByScheme(Ewk_Policy_Decision* policyDecision,
+                                      bool newWindow,
+                                      Evas_Object* window,
+                                      Evas_Object* wkView)
+{
+    WrtLogD("called");
+    Assert(policyDecision);
+
+    const char* url = ewk_policy_decision_url_get(policyDecision);
+    if (NULL == url) {
+        // URI is null
+        // There is no reason, security by scheme block null uri
+        return true;
+    }
+
+    bool mainFrame =
+        ewk_frame_is_main_frame(ewk_policy_decision_frame_get(policyDecision));
+
+    using namespace ViewModule::SchemeActionMap;
+    if (HandleTizenScheme(url, window, wkView)) {
+        WrtLogD("Scheme is tizen scheme");
+        return false;
+    }
+
+    NavigationContext ctx;
+    ctx = (mainFrame ? TOP_LEVEL : FRAME_LEVEL);
+    if (newWindow) {
+        // In case of Tizen,
+        // policy of new window should be applied,
+        // regardless level of this frame
+        ctx = NEW_WINDOW;
+    }
+
+    return SchemeActionMap::HandleUri(url, ctx);
+}
+} // namespace ViewModule
+
diff --git a/src/view/webkit/view_logic_scheme_support.h b/src/view/webkit/view_logic_scheme_support.h
new file mode 100644 (file)
index 0000000..1c2cb64
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       view_logic_scheme_support.h
+ * @author     Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+ * @version    1.0
+ */
+
+#ifndef VIEW_LOGIC_SCHEME_SUPPORT_H_
+#define VIEW_LOGIC_SCHEME_SUPPORT_H_
+
+#include <Elementary.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <common/scheme_action_map.h>
+
+namespace ViewModule {
+namespace SchemeSupport {
+bool HandleTizenScheme(const char* uri,
+                       Evas_Object* window,
+                       Evas_Object* wkView);
+bool filterURIByScheme(Ewk_Policy_Decision* policyDecision,
+                       bool newWindow,
+                       Evas_Object* window,
+                       Evas_Object* wkView);
+} // SchemeSupport
+} // namespace ViewModule
+#endif // VIEW_LOGIC_SCHEME_SUPPORT_H_
diff --git a/src/view/webkit/view_logic_user_agent_support.cpp b/src/view/webkit/view_logic_user_agent_support.cpp
new file mode 100644 (file)
index 0000000..3ee03be
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       view_logic_user_agent_support.cpp
+ * @author     Jihoon Chung (jihoon.chung@samsung.com)
+ * @version    1.0
+ */
+
+#include "view_logic_user_agent_support.h"
+
+#include <string>
+#include <cstring>
+#include <dpl/platform.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/string.h>
+#include <widget_model.h>
+
+#include <app.h>
+#include <Elementary.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+namespace ViewModule {
+namespace {
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+void setCustomUA(std::string customUA);
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+bool setAppInfo(WidgetModel* model, Evas_Object* wkView);
+void printUA(Evas_Object* wkView);
+
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+bool setCustomUA(WidgetModel* model, Evas_Object* wkView)
+{
+    std::string customUserAgent = model->SettingList.Get().getUserAgent();
+    if (customUserAgent.empty()) {
+        return false;
+    } else {
+        ewk_view_user_agent_set(wkView, customUserAgent.c_str());
+        return true;
+    }
+    return false;
+}
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+
+bool setAppInfo(WidgetModel* model, Evas_Object* wkView)
+{
+    std::string appInfo; // appname/appversion
+    char* name = NULL;
+    if (app_get_name(&name) == APP_ERROR_NONE) {
+        appInfo = name;
+        free(name);
+    } else {
+        WrtLogW("Fail to get app name");
+        if (name) {
+            free(name);
+        }
+        return false;
+    }
+
+    DPL::OptionalString version = model->Version.Get();
+    if (!!version) {
+        std::string versionStr = DPL::ToUTF8String(*version);
+        if (versionStr.empty()) {
+            // version is empty
+            // skip to set version field
+        } else {
+            appInfo += "/";
+            appInfo += versionStr;
+        }
+    }
+    if (ewk_view_application_name_for_user_agent_set(wkView, appInfo.c_str())
+        == EINA_TRUE)
+    {
+        // verify
+        const char* info =
+            ewk_view_application_name_for_user_agent_get(wkView);
+        if (!info || !strlen(info) || appInfo != info) {
+            WrtLogW("Fail to verify app info in the UA");
+            return false;
+        }
+        return true;
+    } else {
+        WrtLogW("Fail to set app info to UA");
+        return false;
+    }
+}
+
+void printUA(Evas_Object* wkView)
+{
+    const char* ua = ewk_view_user_agent_get(wkView);
+    WrtLogD("%s", ua);
+}
+} // anonymous namespace
+
+void UserAgentSupport::setUserAgent(WidgetModel* model, Evas_Object* wkView)
+{
+    Assert(model);
+    Assert(wkView);
+
+#if ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+    // set custom UA
+    if (setCustomUA(model, wkView)) {
+        printUA(wkView);
+        return;
+    }
+#endif // ENABLE(CUSTOM_USER_AGENT_SUPPORT)
+
+    // In case of default UA, add appname/appversion
+    if (setAppInfo(model, wkView)) {
+        printUA(wkView);
+    } else {
+        // default UA
+        printUA(wkView);
+    }
+    return;
+}
+
+} // ViewModule
diff --git a/src/view/webkit/view_logic_user_agent_support.h b/src/view/webkit/view_logic_user_agent_support.h
new file mode 100644 (file)
index 0000000..1bb7643
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       view_logic_user_agent_support.h
+ * @author     Jihoon Chung (jihoon.chung@samsung.com)
+ * @version    1.0
+ */
+
+#ifndef VIEW_LOGIC_USER_AGENT_SUPPORT_H_
+#define VIEW_LOGIC_USER_AGENT_SUPPORT_H_
+
+#include <Elementary.h>
+
+class WidgetModel;
+
+namespace ViewModule {
+namespace UserAgentSupport {
+void setUserAgent(WidgetModel* model, Evas_Object* wkView);
+} // namespace UserAgentSupport
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_USER_AGENT_SUPPORT_H_
\ No newline at end of file
diff --git a/src/view/webkit/view_logic_usermedia_support.cpp b/src/view/webkit/view_logic_usermedia_support.cpp
new file mode 100644 (file)
index 0000000..40828ec
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_usermedia_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "view_logic_usermedia_support.h"
+
+#include <string>
+
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/availability.h>
+#include <Elementary.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao_types.h>
+#include <common/view_logic_security_origin_support_util.h>
+#include <common/view_logic_get_parent_window_util.h>
+#include <widget_string.h>
+
+namespace ViewModule {
+using namespace SecurityOriginDB;
+using namespace ViewModule::SecurityOriginSupportUtil;
+namespace {
+// function declare
+void askUserForUsermediaPermission(Evas_Object* window, PermissionData* data);
+static void popupCallback(void* data, Evas_Object* obj, void* eventInfo);
+void setPermissionResult(PermissionData* permData, Result result);
+static void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+void askUserForUsermediaPermission(Evas_Object* window, PermissionData* data)
+{
+    WrtLogD("called");
+    std::string origin = DPL::ToUTF8String(data->m_originData.origin.host);
+    if (origin.empty()) {
+        origin = "local";
+    }
+    std::string appname;
+    char* name = NULL;
+    if (app_get_name(&name) == APP_ERROR_NONE) {
+        appname = name;
+        free(name);
+    } else {
+        appname = "application";
+    }
+
+    std::string body =
+        WrtText::replacePS({WRT_POP_USERMEDIA_PERMISSION, appname, origin});
+
+    Evas_Object* popup = createPopup(window,
+                                     body.c_str(),
+                                     WRT_BODY_REMEMBER_PREFERENCE_IDS,
+                                     popupCallback,
+                                     eaKeyCallback,
+                                     data);
+
+    if (popup == NULL) {
+        WrtLogE("Fail to create popup object");
+        delete data;
+        return;
+    } else {
+        evas_object_show(popup);
+    }
+}
+
+void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+    DPL_UNUSED_PARAM(eventInfo);
+
+    Assert(data);
+    Assert(obj);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    Evas_Object* popup = getPopup(obj);
+    setPermissionResult(permData, RESULT_DENY_ONCE);
+
+    delete permData;
+    evas_object_hide(popup);
+    evas_object_del(popup);
+}
+
+void popupCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(obj);
+    Assert(data);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    setPermissionResult(permData, getResult(obj));
+    delete permData;
+
+    Evas_Object* popup = getPopup(obj);
+
+    evas_object_hide(popup);
+    evas_object_del(popup);
+}
+
+void setPermissionResult(PermissionData* permData, Result result)
+{
+    Assert(permData);
+    if (result != RESULT_UNKNOWN) {
+        permData->m_originDao->setSecurityOriginData(permData->m_originData, result);
+    }
+
+    Ewk_User_Media_Permission_Request* permissionRequest =
+        static_cast<Ewk_User_Media_Permission_Request*>(permData->m_data);
+
+    Eina_Bool ret = (result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ? EINA_TRUE : EINA_FALSE;
+
+    ewk_user_media_permission_reply(permissionRequest, ret);
+}
+} // namespace
+
+void UsermediaSupport::usermediaPermissionRequest(Evas_Object* window,
+                                                  SecurityOriginDAO* securityOriginDAO,
+                                                  void* data)
+{
+    WrtLogD("called");
+    Assert(securityOriginDAO);
+    Assert(data);
+
+    Ewk_User_Media_Permission_Request* permissionRequest =
+        static_cast<Ewk_User_Media_Permission_Request*>(data);
+
+    const Ewk_Security_Origin* ewkOrigin =
+        ewk_user_media_permission_request_origin_get(permissionRequest);
+    Assert(ewkOrigin);
+
+    SecurityOriginData securityOriginData(
+        WrtDB::FEATURE_USER_MEDIA,
+        Origin(
+            DPL::FromUTF8String(ewk_security_origin_protocol_get(ewkOrigin)),
+            DPL::FromUTF8String(ewk_security_origin_host_get(ewkOrigin)),
+            ewk_security_origin_port_get(ewkOrigin)));
+
+    // In case of usermedia ewk doesn't support origin data
+    // cache data also only store allow data by privilege
+    Result result = securityOriginDAO->getResult(securityOriginData);
+    if (RESULT_ALLOW_ONCE == result || RESULT_ALLOW_ALWAYS == result) {
+        WrtLogD("allow");
+        ewk_user_media_permission_reply(permissionRequest, EINA_TRUE);
+        return;
+    } else if (RESULT_DENY_ONCE == result || RESULT_DENY_ALWAYS == result) {
+        WrtLogD("deny");
+        ewk_user_media_permission_reply(permissionRequest, EINA_FALSE);
+        return;
+    }
+
+    // ask to user
+    PermissionData* permissionData =
+        new PermissionData(securityOriginDAO,
+                           securityOriginData,
+                           permissionRequest);
+    askUserForUsermediaPermission(window, permissionData);
+    return;
+}
+} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_usermedia_support.h b/src/view/webkit/view_logic_usermedia_support.h
new file mode 100644 (file)
index 0000000..89670ea
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_usermedia_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_USERMEDIA_SUPPORT_H_
+#define VIEW_LOGIC_USERMEDIA_SUPPORT_H_
+
+#include <Elementary.h>
+
+//Forward declarations
+namespace SecurityOriginDB {
+class SecurityOriginDAO;
+}
+
+namespace ViewModule {
+namespace UsermediaSupport {
+void usermediaPermissionRequest(
+    Evas_Object* window,
+    SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+    void* data);
+} // namespace UsermediaSupport
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_USERMEDIA_SUPPORT_H_
\ No newline at end of file
diff --git a/src/view/webkit/view_logic_web_notification_data.cpp b/src/view/webkit/view_logic_web_notification_data.cpp
new file mode 100644 (file)
index 0000000..8ef96da
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ *
+ * @file    view_logic_web_notification_data.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ *
+ */
+
+#include "view_logic_web_notification_data.h"
+
+#include <stdint.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+namespace ViewModule {
+WebNotificationData::WebNotificationData(Ewk_Notification* ewkNotification) :
+    m_notificaionId(0),
+    m_data(ewkNotification)
+{}
+
+WebNotificationData::~WebNotificationData()
+{}
+
+int WebNotificationData::getNotiId()
+{
+    return m_notificaionId;
+}
+
+void WebNotificationData::setNotiId(const int notiId)
+{
+    m_notificaionId = notiId;
+}
+
+uint64_t WebNotificationData::getEwkNotiId()
+{
+    return ewk_notification_id_get(m_data);
+}
+
+const char* WebNotificationData::getIconUrl()
+{
+    return ewk_notification_icon_url_get(m_data);
+}
+
+const char* WebNotificationData::getTitle()
+{
+    return ewk_notification_title_get(m_data);
+}
+
+const char* WebNotificationData::getBody()
+{
+    return ewk_notification_body_get(m_data);
+}
+
+Ewk_Notification* WebNotificationData::getData()
+{
+    return m_data;
+}
+} //namespace ViewModule
diff --git a/src/view/webkit/view_logic_web_notification_data.h b/src/view/webkit/view_logic_web_notification_data.h
new file mode 100644 (file)
index 0000000..9c53fca
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ *
+ * @file    view_logic_web_notification_data.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ *
+ */
+
+#ifndef VIEW_LOGIC_WEB_NOTIFICATION_DATA_H_
+#define VIEW_LOGIC_WEB_NOTIFICATION_DATA_H_
+
+#include <stdint.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <memory>
+
+namespace ViewModule {
+class WebNotificationData
+{
+  public:
+    WebNotificationData(Ewk_Notification* ewkNotification);
+    virtual ~WebNotificationData();
+
+    int getNotiId(void);
+    void setNotiId(const int notiId);
+    uint64_t getEwkNotiId(void);
+    const char* getIconUrl(void);
+    const char* getTitle(void);
+    const char* getBody(void);
+    Ewk_Notification* getData(void);
+
+  private:
+    int m_notificaionId;
+    Ewk_Notification* m_data;
+};
+typedef std::shared_ptr<WebNotificationData> WebNotificationDataPtr;
+} // namespace ViewModule
+#endif // VIEW_LOGIC_WEB_NOTIFICATION_DATA_H_
diff --git a/src/view/webkit/view_logic_web_notification_permission_support.cpp b/src/view/webkit/view_logic_web_notification_permission_support.cpp
new file mode 100644 (file)
index 0000000..ee0197d
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_web_notification_permission_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @brief   Implementation file of web Notification permission API
+ */
+
+#include "view_logic_web_notification_permission_support.h"
+
+#include <string>
+#include <dpl/log/wrt_log.h>
+#include <dpl/availability.h>
+#include <dpl/assert.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao_types.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao.h>
+#include <common/view_logic_help_popup_support.h>
+#include <common/view_logic_security_origin_support_util.h>
+
+#include <app.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <widget_string.h>
+
+namespace ViewModule {
+namespace WebNotificationPermissionSupport {
+using namespace SecurityOriginDB;
+using namespace ViewModule::SecurityOriginSupportUtil;
+
+namespace {
+// Function declare
+bool askUserPermission(Evas_Object* parent, PermissionData* data);
+void setPermissionResult(PermissionData* permData, Result result);
+static void popupCallback(void* data, Evas_Object* obj, void* eventInfo);
+static void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+bool askUserPermission(Evas_Object* parent, PermissionData* data)
+{
+    WrtLogD("called");
+    std::string origin = DPL::ToUTF8String(data->m_originData.origin.host);
+    if (origin.empty()) {
+        origin = "local";
+    }
+    std::string appname;
+    char* name = NULL;
+    if (app_get_name(&name) == APP_ERROR_NONE) {
+        appname = name;
+        free(name);
+    } else {
+        appname = "application";
+    }
+
+    std::string body =
+        WrtText::replacePS({WRT_POP_WEB_NOTIFICATION_PERMISSION,
+                           appname,
+                           origin});
+    Evas_Object* popup = createPopup(parent,
+                                     body.c_str(),
+                                     WRT_BODY_REMEMBER_PREFERENCE_IDS,
+                                     popupCallback,
+                                     eaKeyCallback,
+                                     data);
+    if (popup == NULL) {
+        delete data;
+        return false;
+    } else {
+        evas_object_show(popup);
+    }
+    return true;
+}
+
+void setPermissionResult(PermissionData* permData, Result result)
+{
+    Assert(permData);
+    if (result != RESULT_UNKNOWN) {
+        permData->m_originDao->setSecurityOriginData(permData->m_originData, result);
+    }
+
+    Ewk_Notification_Permission_Request* permissionRequest =
+        static_cast<Ewk_Notification_Permission_Request*>(permData->m_data);
+    Eina_Bool ret = (result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ? EINA_TRUE : EINA_FALSE;
+    ewk_notification_permission_reply(permissionRequest, ret);
+}
+
+void popupCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    setPermissionResult(permData, getResult(obj));
+    delete permData;
+
+    Evas_Object* popup = getPopup(obj);
+    if (isNeedHelpPopup(popup)) {
+        ViewModule::HelpPopupSupport::showClearDefaultPopup(popup);
+    }
+    evas_object_hide(popup);
+    evas_object_del(popup);
+}
+
+void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    setPermissionResult(permData, RESULT_DENY_ONCE);
+    delete permData;
+
+    evas_object_hide(obj);
+    evas_object_del(obj);
+}
+} // anonymous namespace
+
+void permissionRequest(
+    Evas_Object* parent,
+    SecurityOriginDAO* securityOriginDAO,
+    void* data)
+{
+    Assert(securityOriginDAO);
+    Assert(data);
+    Ewk_Notification_Permission_Request* request =
+        static_cast<Ewk_Notification_Permission_Request*>(data);
+    const Ewk_Security_Origin* ewkOrigin =
+        ewk_notification_permission_request_origin_get(request);
+    Assert(ewkOrigin);
+
+    SecurityOriginData securityOriginData(
+        WrtDB::FEATURE_WEB_NOTIFICATION,
+        Origin(
+            DPL::FromUTF8String(ewk_security_origin_protocol_get(ewkOrigin)),
+            DPL::FromUTF8String(ewk_security_origin_host_get(ewkOrigin)),
+            ewk_security_origin_port_get(ewkOrigin)));
+
+    // check cache database
+    Result result = securityOriginDAO->getResult(securityOriginData);
+    if (RESULT_ALLOW_ONCE == result || RESULT_ALLOW_ALWAYS == result) {
+        WrtLogD("allow");
+        ewk_notification_permission_reply(request, EINA_TRUE);
+        return;
+    } else if (RESULT_DENY_ONCE == result || RESULT_DENY_ALWAYS == result) {
+        WrtLogD("deny");
+        ewk_notification_permission_reply(request, EINA_FALSE);
+        return;
+    }
+
+    // ask to user
+    PermissionData* permissionData =
+        new PermissionData(securityOriginDAO,
+                           securityOriginData,
+                           request);
+
+    if (!askUserPermission(parent, permissionData)) {
+        WrtLogW("Fail to create user permission popup");
+        ewk_notification_permission_reply(request, RESULT_DENY_ONCE);
+    }
+    return;
+}
+} // namespace WebNotificationPermissionSupport
+} //namespace ViewModule
diff --git a/src/view/webkit/view_logic_web_notification_permission_support.h b/src/view/webkit/view_logic_web_notification_permission_support.h
new file mode 100644 (file)
index 0000000..22bb21c
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_web_notification_permission_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @brief   Header file of web Notification permission API
+ */
+
+#ifndef VIEW_LOGIC_WEB_NOTIFICATION_PERMISSION_SUPPORT_H_
+#define VIEW_LOGIC_WEB_NOTIFICATION_PERMISSION_SUPPORT_H_
+
+#include <Elementary.h>
+
+//Forward declarations
+namespace SecurityOriginDB {
+class SecurityOriginDAO;
+}
+
+namespace ViewModule {
+namespace WebNotificationPermissionSupport {
+void permissionRequest(
+    Evas_Object* parent,
+    SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+    void* data);
+} // namespace WebNotificationPermissionSupport
+} // namespace ViewModule
+#endif // VIEW_LOGIC_WEB_NOTIFICATION_PERMISSION_SUPPORT_H_
+
diff --git a/src/view/webkit/view_logic_web_notification_support.cpp b/src/view/webkit/view_logic_web_notification_support.cpp
new file mode 100644 (file)
index 0000000..e5a4b3d
--- /dev/null
@@ -0,0 +1,379 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_web_notification_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @brief   Implementation file of web Notification API used by ViewLogic
+ */
+
+#include "view_logic_web_notification_support.h"
+#include "view_logic_web_notification_data.h"
+
+#include <stdint.h>
+#include <string>
+#include <map>
+#include <unistd.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/assert.h>
+#include <dpl/exception.h>
+#include <dpl/wrt-dao-ro/widget_config.h>
+
+#include <notification.h>
+#include <notification_internal.h>
+#include <pcrecpp.h>
+#include <sstream>
+#include <curl/curl.h>
+
+namespace ViewModule {
+namespace {
+const char* PATTERN_CHECK_EXTERNAL = "^http(s)?://\\w+.*$";
+
+// Function declare
+bool isExternalUri(const std::string &uri);
+size_t curlWriteData(void* ptr, size_t size, size_t nmemb, FILE* stream);
+
+bool isExternalUri(const std::string &uri)
+{
+    pcrecpp::RE_Options pcreOpt;
+    pcreOpt.set_caseless(true);
+    pcrecpp::RE re(PATTERN_CHECK_EXTERNAL, pcreOpt);
+
+    return re.FullMatch(uri);
+}
+
+size_t curlWriteData(void* ptr, size_t size, size_t nmemb, FILE* stream)
+{
+    size_t written = fwrite(ptr, size, nmemb, stream);
+    return written;
+}
+} // anonymous namespace
+
+// Implementation class
+class WebNotificationSupportImplementation
+{
+  private:
+    class Exception
+    {
+      public:
+        DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
+        DECLARE_EXCEPTION_TYPE(Base, InitError)
+        DECLARE_EXCEPTION_TYPE(Base, NotificationShowError)
+        DECLARE_EXCEPTION_TYPE(Base, DownloadImageError)
+    };
+
+    bool m_initialized;
+    std::string m_persistentPath;
+
+    typedef std::map<uint64_t, WebNotificationDataPtr> NotiMap;
+    typedef std::map<uint64_t, WebNotificationDataPtr>::iterator NotiMapIt;
+    NotiMap m_notiDataMap;
+
+    std::string createDownloadPath(const std::string& iconUrl)
+    {
+        // Make valid filename
+        // If there is already exist filename, rename to "filename_%d"
+
+        std::string downloadPath = m_persistentPath;
+        std::string fileName = iconUrl.substr(iconUrl.rfind('/') + 1);
+        WrtLogD("fileName from URL: %s", fileName.c_str());
+        std::string rename = fileName;
+        unsigned int renameSuffixNb = 0;
+        while (0 == access((m_persistentPath + rename).c_str(), F_OK)) {
+            std::ostringstream suffixOstr;
+            suffixOstr.str("");
+            suffixOstr << fileName << "_" << renameSuffixNb++;
+
+            rename = fileName;
+            rename.insert(rename.find('.'), suffixOstr.str());
+        }
+
+        downloadPath += rename;
+        WrtLogD("Valid file path : %s", downloadPath.c_str());
+        return downloadPath;
+    }
+
+    std::string downloadImage(const std::string& iconUrl)
+    {
+        if (iconUrl.empty()) {
+            WrtLogW("Icon url is empty");
+            return std::string();
+        }
+        std::string downloadPath = createDownloadPath(iconUrl);
+
+        // Download image by curl
+        FILE *fp = NULL;
+        CURL *curl = NULL;
+
+        Try {
+            curl = curl_easy_init();
+            if (NULL == curl) {
+                WrtLogW("fail to curl_easy_init");
+                Throw(Exception::InitError);
+            }
+            fp = fopen(downloadPath.c_str(), "wb");
+            if (fp == NULL) {
+                WrtLogW("fail to open");
+                Throw(Exception::InitError);
+            }
+
+            curl_easy_setopt(curl, CURLOPT_URL, iconUrl.c_str());
+            curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
+            curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curlWriteData);
+
+            CURLcode err = curl_easy_perform(curl);
+            if (0 != err) {
+                WrtLogW("fail to curl_easy_perform: %d", err);
+                Throw(Exception::DownloadImageError);
+            }
+            fclose(fp);
+            curl_easy_cleanup(curl);
+        } Catch(DPL::Exception) {
+            fclose(fp);
+            curl_easy_cleanup(curl);
+            return std::string();
+        }
+        WrtLogD("Download success");
+        return downloadPath;
+    }
+
+    int showNotification(WebNotificationDataPtr notiData)
+    {
+        Assert(notiData);
+        notification_h noti_h = NULL;
+        int error = NOTIFICATION_ERROR_NONE;
+
+        Try {
+            // create notification
+            noti_h = notification_new(
+                    NOTIFICATION_TYPE_NOTI,
+                    NOTIFICATION_GROUP_ID_DEFAULT,
+                    NOTIFICATION_PRIV_ID_NONE);
+            if (!noti_h) {
+                WrtLogE("Fail to notification_new");
+                Throw(Exception::NotificationShowError);
+            }
+
+            // set notification title
+            error = notification_set_text(
+                    noti_h,
+                    NOTIFICATION_TEXT_TYPE_TITLE,
+                    notiData->getTitle(),
+                    NULL,
+                    NOTIFICATION_VARIABLE_TYPE_NONE);
+            if (error != NOTIFICATION_ERROR_NONE) {
+                WrtLogE("Fail to set title");
+                Throw(Exception::NotificationShowError);
+            }
+
+            // set notification content
+            error = notification_set_text(
+                    noti_h,
+                    NOTIFICATION_TEXT_TYPE_CONTENT,
+                    notiData->getBody(),
+                    NULL,
+                    NOTIFICATION_VARIABLE_TYPE_NONE);
+            if (error != NOTIFICATION_ERROR_NONE) {
+                WrtLogE("Fail to set content: %d", error);
+                Throw(Exception::NotificationShowError);
+            }
+
+            //check uri is "http", https" or not
+            if (notiData->getIconUrl()) {
+                std::string iconPath;
+                if (isExternalUri(notiData->getIconUrl())) {
+                    //download image from url
+                    iconPath = downloadImage(notiData->getIconUrl());
+                }
+
+                //set image
+                // If fail to download external image, skip to set image.
+                // In this case, set to default package image.
+                if (!iconPath.empty()) {
+                    error = notification_set_image(
+                            noti_h,
+                            NOTIFICATION_IMAGE_TYPE_ICON,
+                            iconPath.c_str());
+                    if (error != NOTIFICATION_ERROR_NONE) {
+                        WrtLogE("Fail to free notification: %d", error);
+                        Throw(Exception::NotificationShowError);
+                    }
+                }
+            }
+
+            // insert notification
+            int privId = NOTIFICATION_PRIV_ID_NONE;
+            error = notification_insert(noti_h, &privId);
+            if (error != NOTIFICATION_ERROR_NONE) {
+                WrtLogE("Fail to insert notification : %d", error);
+                Throw(Exception::NotificationShowError);
+            }
+            WrtLogD("ewkId=[%llu], notiId=[%d]", notiData->getEwkNotiId(), privId);
+
+            if (noti_h) {
+                error = notification_free(noti_h);
+                if (error != NOTIFICATION_ERROR_NONE) {
+                    WrtLogE("Fail to free notification : %d", error);
+                    Throw(Exception::NotificationShowError);
+                }
+                noti_h = NULL;
+            }
+            notiData->setNotiId(privId);
+        } Catch(Exception::NotificationShowError) {
+            notification_free(noti_h);
+            noti_h = NULL;
+            return false;
+        } Catch(DPL::Exception) {
+            WrtLogE("Fail to show notification");
+            return false;
+        }
+        return true;
+    }
+
+    bool hideNotification(uint64_t ewkNotiId)
+    {
+        int error = NOTIFICATION_ERROR_NONE;
+        NotiMapIt it = m_notiDataMap.find(ewkNotiId);
+        error =
+            notification_delete_by_priv_id(NULL,
+                                           NOTIFICATION_TYPE_NOTI,
+                                           it->second->getNotiId());
+        if (error == NOTIFICATION_ERROR_NONE) {
+            WrtLogD("Success to hide");
+            return true;
+        } else if (error == NOTIFICATION_ERROR_NOT_EXIST_ID) {
+            WrtLogD("Success to hide. Not exist noti");
+            return true;
+        } else {
+            WrtLogW("Error to hide : %d", error);
+            return false;
+        }
+    }
+
+    // manage noti data
+    bool isExistData(uint64_t ewkNotiId)
+    {
+        if (m_notiDataMap.find(ewkNotiId) == m_notiDataMap.end()) {
+            return false;
+        }
+        return true;
+    }
+
+    void insertData(WebNotificationDataPtr notiData)
+    {
+        m_notiDataMap[notiData->getEwkNotiId()] = notiData;
+    }
+
+    void removeData(uint64_t ewkNotiId)
+    {
+        m_notiDataMap.erase(ewkNotiId);
+    }
+
+    WebNotificationDataPtr getData(uint64_t ewkNotiId)
+    {
+        return m_notiDataMap.find(ewkNotiId)->second;
+    }
+
+  public:
+    WebNotificationSupportImplementation() :
+        m_initialized(false)
+    {
+    }
+
+    void initialize(WrtDB::TizenPkgId pkgId)
+    {
+        // icon download path
+        // /opt/apps/tizen_id/data + '/' + filename
+        m_persistentPath =
+            WrtDB::WidgetConfig::GetWidgetPersistentStoragePath(pkgId) + '/';
+        WrtLogD("path %s", m_persistentPath.c_str());
+        m_initialized = true;
+    }
+
+    void deinitialize(void)
+    {
+        WrtLogD("called");
+        m_initialized = false;
+    }
+
+    bool show(WebNotificationDataPtr notiData)
+    {
+        Assert(m_initialized);
+        if (isExistData(notiData->getEwkNotiId())) {
+            // Web Notifications (http://www.w3.org/TR/notifications/)
+            // 4.7 Replacing a notification
+            //   3. If old is in the list of pending notifications, queue a
+            //      task to replace old with new, in the same position, in the
+            //      list of pending notifications, and fire an event named
+            //      close on old.
+            //   4. Otherwise, queue a task to replace old with new, in the
+            //      same position, in the list of active notifications, fire
+            //      an event named close on old, and fire an event named show
+            //      on new.
+            hideNotification(notiData->getEwkNotiId());
+            removeData(notiData->getEwkNotiId());
+        }
+        if (showNotification(notiData)) {
+            insertData(notiData);
+            return true;
+        }
+        return false;
+    }
+
+    void* hide(uint64_t ewkNotiId)
+    {
+        Assert(m_initialized);
+        if (!isExistData(ewkNotiId)) {
+            WrtLogW("Noti isn't exist");
+            return NULL;
+        }
+        if (!hideNotification(ewkNotiId)) {
+            return NULL;
+        }
+        WebNotificationDataPtr data = getData(ewkNotiId);
+        removeData(ewkNotiId);
+        return static_cast<void*>(data->getData());
+    }
+};
+
+WebNotificationSupport::WebNotificationSupport() :
+    m_impl(new WebNotificationSupportImplementation())
+{
+}
+
+WebNotificationSupport::~WebNotificationSupport()
+{
+}
+
+void WebNotificationSupport::initialize(WrtDB::TizenAppId appId)
+{
+    m_impl->initialize(appId);
+}
+
+void WebNotificationSupport::deinitialize(void)
+{
+    m_impl->deinitialize();
+}
+
+bool WebNotificationSupport::show(WebNotificationDataPtr notiData)
+{
+    return m_impl->show(notiData);
+}
+
+void* WebNotificationSupport::hide(uint64_t ewkNotiId)
+{
+    return m_impl->hide(ewkNotiId);
+}
+} //namespace ViewModule
diff --git a/src/view/webkit/view_logic_web_notification_support.h b/src/view/webkit/view_logic_web_notification_support.h
new file mode 100644 (file)
index 0000000..893e771
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_web_notification_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ * @brief   Header file of web Notification API used by ViewLogic
+ */
+
+#ifndef VIEW_LOGIC_WEB_NOTIFICATION_SUPPORT_H_
+#define VIEW_LOGIC_WEB_NOTIFICATION_SUPPORT_H_
+
+#include <memory>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include "view_logic_web_notification_data.h"
+
+namespace ViewModule {
+class WebNotificationSupportImplementation;
+class WebNotificationSupport
+{
+  public:
+    WebNotificationSupport();
+    virtual ~WebNotificationSupport();
+    void initialize(WrtDB::TizenPkgId pkgId);
+    void deinitialize(void);
+
+    bool show(WebNotificationDataPtr notiData);
+    void* hide(uint64_t ewkNotiId);
+
+  private:
+    std::unique_ptr<WebNotificationSupportImplementation> m_impl;
+};
+} // namespace ViewModule
+#endif /* VIEW_LOGIC_WEB_NOTIFICATION_H_ */
diff --git a/src/view/webkit/view_logic_web_storage_support.cpp b/src/view/webkit/view_logic_web_storage_support.cpp
new file mode 100644 (file)
index 0000000..0441a94
--- /dev/null
@@ -0,0 +1,191 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_web_storage_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "view_logic_web_storage_support.h"
+
+#include <string>
+#include <sstream>
+#include <dpl/log/wrt_log.h>
+#include <dpl/availability.h>
+#include <dpl/assert.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao_types.h>
+#include <wrt-commons/security-origin-dao/security_origin_dao.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <common/view_logic_help_popup_support.h>
+#include <common/view_logic_security_origin_support_util.h>
+#include <Elementary.h>
+#include <widget_string.h>
+
+namespace ViewModule {
+using namespace SecurityOriginDB;
+using namespace ViewModule::SecurityOriginSupportUtil;
+
+namespace {
+struct WebStoragePermissionData {
+    WebStorageSupport::ewkQuotaReply m_replyEAPI;
+    Evas_Object* m_ewkView;
+    WebStoragePermissionData(WebStorageSupport::ewkQuotaReply replyEAPI,
+                             Evas_Object* ewkView) :
+        m_replyEAPI(replyEAPI),
+        m_ewkView(ewkView)
+    {}
+};
+
+// function declare
+void askUserForWebStorageCreatePermission(
+    Evas_Object* window,
+    PermissionData* data);
+void setPermissionResult(PermissionData* permData, Result result);
+static void popupCallback(void* data, Evas_Object* obj, void* eventInfo);
+static void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+void askUserForWebStorageCreatePermission(
+    Evas_Object* window,
+    PermissionData* data)
+{
+    WrtLogD("called");
+    std::string origin = DPL::ToUTF8String(data->m_originData.origin.host);
+    if (origin.empty()) {
+        origin = "local";
+    }
+    std::string appname;
+    char* name = NULL;
+    if (app_get_name(&name) == APP_ERROR_NONE) {
+        appname = name;
+        free(name);
+    } else {
+        appname = "application";
+    }
+
+    std::string body =
+        WrtText::replacePS({WRT_POP_WEB_STORAGE_PERMISSION, appname, origin});
+    Evas_Object* popup = createPopup(window,
+                                     body.c_str(),
+                                     WRT_BODY_REMEMBER_PREFERENCE_IDS,
+                                     popupCallback,
+                                     eaKeyCallback,
+                                     data);
+
+    if (popup == NULL) {
+        WrtLogE("Fail to create popup object");
+        delete data;
+        return;
+    } else {
+        evas_object_show(popup);
+    }
+}
+
+void setPermissionResult(PermissionData* permData, Result result)
+{
+    Assert(permData);
+    WebStoragePermissionData* webStoragePermissionData =
+        static_cast<WebStoragePermissionData*>(permData->m_data);
+
+    if (result != RESULT_UNKNOWN) {
+        permData->m_originDao->setSecurityOriginData(permData->m_originData, result);
+    }
+    Eina_Bool ret = (result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ? EINA_TRUE : EINA_FALSE;
+    webStoragePermissionData->m_replyEAPI(webStoragePermissionData->m_ewkView, ret);
+}
+
+void popupCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    Assert(data);
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    setPermissionResult(permData, getResult(obj));
+    WebStoragePermissionData* webStoragePermissionData =
+        static_cast<WebStoragePermissionData*>(permData->m_data);
+    delete webStoragePermissionData;
+    delete permData;
+
+    Evas_Object* popup = getPopup(obj);
+    if (isNeedHelpPopup(popup)) {
+        ViewModule::HelpPopupSupport::showClearDefaultPopup(popup);
+    }
+    evas_object_hide(popup);
+    evas_object_del(popup);
+}
+
+void eaKeyCallback(void* data, Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(data);
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    setPermissionResult(permData, RESULT_DENY_ONCE);
+
+    WebStoragePermissionData* webStoragePermissionData =
+        static_cast<WebStoragePermissionData*>(permData->m_data);
+    delete webStoragePermissionData;
+    delete permData;
+
+    evas_object_hide(obj);
+    evas_object_del(obj);
+}
+} // namespace
+
+void WebStorageSupport::createPermissionRequest(
+    Evas_Object* window,
+    SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+    Evas_Object* ewkView,
+    Ewk_Security_Origin* ewkOrigin,
+    ewkQuotaReply replyEAPI)
+{
+    WrtLogD("called");
+    Assert(securityOriginDAO);
+    Assert(ewkOrigin);
+    Assert(ewkView);
+    SecurityOriginData securityOriginData(
+        WrtDB::FEATURE_WEB_DATABASE,
+        Origin(
+            DPL::FromUTF8String(ewk_security_origin_protocol_get(ewkOrigin)),
+            DPL::FromUTF8String(ewk_security_origin_host_get(ewkOrigin)),
+            ewk_security_origin_port_get(ewkOrigin)));
+
+    // check cache database
+    Result result = securityOriginDAO->getResult(securityOriginData);
+    if (result != RESULT_UNKNOWN) {
+        Eina_Bool ret =
+            (result == RESULT_ALLOW_ALWAYS || result == RESULT_ALLOW_ONCE) ?
+                EINA_TRUE : EINA_FALSE;
+        replyEAPI(ewkView, ret);
+        return;
+    }
+
+    // ask to user
+    WebStoragePermissionData* webStoragePermissionData =
+        new WebStoragePermissionData(replyEAPI, ewkView);
+    PermissionData* permissionData =
+        new PermissionData(securityOriginDAO,
+                           securityOriginData,
+                           webStoragePermissionData);
+    askUserForWebStorageCreatePermission(window, permissionData);
+    return;
+}
+} // namespace ViewModule
diff --git a/src/view/webkit/view_logic_web_storage_support.h b/src/view/webkit/view_logic_web_storage_support.h
new file mode 100644 (file)
index 0000000..845f591
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    view_logic_web_storage_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#ifndef VIEW_LOGIC_WEB_STORAGE_SUPPORT_H_
+#define VIEW_LOGIC_WEB_STORAGE_SUPPORT_H_
+
+#include <memory.h>
+#include <Elementary.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+
+namespace SecurityOriginDB {
+class SecurityOriginDAO;
+}
+
+namespace ViewModule {
+namespace WebStorageSupport {
+typedef void (*ewkQuotaReply)(Evas_Object* ewkView, Eina_Bool allow);
+bool isNeedPermissionRequest(void);
+void createPermissionRequest(
+    Evas_Object* window,
+    SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
+    Evas_Object* ewkView,
+    Ewk_Security_Origin* ewkOrigin,
+    ewkQuotaReply replyEAPI);
+
+} // namespace WebStorageSupport
+} // namespace ViewModule
+
+#endif // VIEW_LOGIC_WEB_STORAGE_SUPPORT_H_
diff --git a/src/wrt-client/CMakeLists.txt b/src/wrt-client/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c7a34ba
--- /dev/null
@@ -0,0 +1,83 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+GROUP_DEPS(CLIENT_DEP DEPS
+    appcore-efl
+    capi-appfw-application
+    dpl-wrt-dao-ro
+    wrt-popup-wrt-runner
+    appsvc
+    efl-assist
+    libsystemd-daemon
+)
+
+SET(WRT_CLIENT_SRCS
+    ${PROJECT_SOURCE_DIR}/src/wrt-client/wrt-client.cpp
+    ${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/src/access_control.cpp
+    ${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/src/process_pool.cpp
+)
+
+INCLUDE_DIRECTORIES(
+    ${PROJECT_SOURCE_DIR}/src/wrt-client
+    ${PROJECT_SOURCE_DIR}/src/api_new
+    ${PROJECT_SOURCE_DIR}/src/domain
+    ${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/include
+    ${CLIENT_DEP_INCLUDE_DIRS}
+)
+
+ADD_DEFINITIONS("-fPIE")
+
+ADD_EXECUTABLE(${TARGET_WRT_CLIENT}
+    ${WRT_CLIENT_SRCS}
+)
+
+SET_TARGET_PROPERTIES(${TARGET_WRT_CLIENT} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+
+
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+TARGET_LINK_LIBRARIES(${TARGET_WRT_CLIENT}
+    ${CLIENT_DEP_LIBRARIES}
+    ${TARGET_CLIENT_SUPPORT_STATIC}
+    ${TARGET_CORE_MODULE_LIB}
+    ${TARGET_SMACK_LABELING_SUPPORT_STATIC}
+    ${TARGET_WRT_EVENT_LOOP_LIB}
+    ${PROF_LIB}
+    "-lcap"
+    "-pie"
+)
+ELSE(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+TARGET_LINK_LIBRARIES(${TARGET_WRT_CLIENT}
+    ${CLIENT_DEP_LIBRARIES}
+    ${TARGET_CLIENT_SUPPORT_STATIC}
+    ${TARGET_CORE_MODULE_LIB}
+    ${TARGET_SMACK_LABELING_SUPPORT_STATIC}
+    ${PROF_LIB}
+    "-lcap"
+    "-pie"
+)
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+SET_TARGET_PROPERTIES(${TARGET_WRT_CLIENT} PROPERTIES
+    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both -Wl,--version-script=${PROJECT_SOURCE_DIR}/wrt-engine.map"
+    BUILD_WITH_INSTALL_RPATH ON
+    INSTALL_RPATH_USE_LINK_PATH ON
+)
+
+SET_TARGET_PROPERTIES(${TARGET_WRT_CLIENT} PROPERTIES
+    COMPILE_FLAGS "-include profiling_util.h" )
+
+INSTALL(TARGETS ${TARGET_WRT_CLIENT} DESTINATION bin)
+
diff --git a/src/wrt-client/DESCRIPTION b/src/wrt-client/DESCRIPTION
new file mode 100644 (file)
index 0000000..dd6f294
--- /dev/null
@@ -0,0 +1 @@
+The official WRT command-line interface
diff --git a/src/wrt-client/client_command_line_parser.cpp b/src/wrt-client/client_command_line_parser.cpp
new file mode 100644 (file)
index 0000000..ef452e4
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    client_command_line_parser.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "client_command_line_parser.h"
+
+#include <cstddef>
+#include <sstream>
+#include <string>
+
+#include <dpl/log/wrt_log.h>
+#include <dpl/optional_typedefs.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+
+namespace ClientModule {
+namespace {
+
+std::string parseIdField(int argc, char **argv)
+{
+    if (argv[0] == NULL) {
+        return "";
+    }
+
+    std::string arg = argv[0];
+    if (arg.empty()) {
+        return "";
+    }
+
+    if (arg.find("wrt-client") != std::string::npos) {
+        if (argc <= 1) {
+            return "";
+        }
+
+        arg = argv[1];
+
+        if (arg == "-h" || arg == "--help") {
+            return "";
+        } else if (arg == "-l" ||
+                   arg == "--launch" ||
+                   arg == "-t" ||
+                   arg == "--tizen")
+        {
+            if (argc != 3) {
+                return "";
+            }
+            return argv[2];
+        } else {
+            return "";
+        }
+    } else {
+        std::size_t pos = arg.find_last_of('/');
+        if (pos != std::string::npos) {
+            arg = arg.erase(0, pos + 1);
+        }
+        return arg;
+    }
+}
+
+DPL::OptionalUInt getIndex(const std::string& tizenId)
+{
+    std::size_t pos =
+        tizenId.find(WrtDB::AppControlPrefix::PROCESS_PREFIX);
+    if (pos != std::string::npos) {
+        std::string index = tizenId.substr(pos);
+        index.erase(strlen(WrtDB::AppControlPrefix::PROCESS_PREFIX));
+        std::stringstream s(index);
+        unsigned int appControlIndex;
+        s >> appControlIndex;
+        return appControlIndex;
+    }
+    return DPL::OptionalUInt();
+}
+
+std::string removeIndex(const std::string& tizenId)
+{
+    std::string id = tizenId;
+    std::size_t pos =
+        id.find(WrtDB::AppControlPrefix::PROCESS_PREFIX);
+    if (pos != std::string::npos) {
+        id.erase(pos);
+    }
+    return id;
+}
+}
+
+std::string CommandLineParser::getTizenId(int argc, char **argv)
+{
+    std::string id = parseIdField(argc, argv);
+    if (id.empty()) {
+        return "";
+    }
+    return removeIndex(id);
+}
+
+DPL::OptionalUInt CommandLineParser::getAppControlIndex(int argc, char **argv)
+{
+    std::string id = parseIdField(argc, argv);
+    if (id.empty()) {
+        return DPL::OptionalUInt();
+    }
+    return getIndex(id);
+}
+} // ClientModule
diff --git a/src/wrt-client/client_command_line_parser.h b/src/wrt-client/client_command_line_parser.h
new file mode 100644 (file)
index 0000000..615e442
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+ /**
+ * @file    client_command_line_parser.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+#ifndef CLIENT_COMMAND_LINE_PARSER_H_
+#define CLIENT_COMMAND_LINE_PARSER_H_
+
+#include <dpl/optional_typedefs.h>
+
+namespace ClientModule {
+namespace CommandLineParser {
+std::string getTizenId(int argc, char **argv);
+DPL::OptionalUInt getAppControlIndex(int argc, char **argv);
+} // CommandLineParser
+} // ClientModule
+#endif // CLIENT_COMMAND_LINE_PARSER_H_
\ No newline at end of file
diff --git a/src/wrt-client/client_ide_support.cpp b/src/wrt-client/client_ide_support.cpp
new file mode 100644 (file)
index 0000000..85c5084
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    client_ide_support.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "client_ide_support.h"
+#include <stdarg.h>
+#include <string>
+#include <dpl/log/wrt_log.h>
+#include <dpl/exception.h>
+
+#include <dlog.h>
+#include <appsvc.h>
+#include <bundle.h>
+#include <widget_data_types.h>
+
+namespace ClientModule {
+namespace {
+const char* const KEY_DEBUG = "debug";
+const char* const KEY_PORT = "port";
+const char* const VALUE_TRUE = "true";
+
+const char* const CONSOLE_MESSAGE_LOG_TAG = "ConsoleMessage";
+}
+
+bool IDESupport::getDebugMode(bundle* b)
+{
+    if (!b) {
+        WrtLogW("bundle is empty");
+        return false;
+    }
+
+    const char* value = bundle_get_val(b, KEY_DEBUG);
+    if (value != NULL && !strcmp(value, VALUE_TRUE)) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+bool IDESupport::sendReply(bundle* b, unsigned int portNum)
+{
+    bundle* request = NULL;
+    if (appsvc_create_result_bundle(b, &request) != APPSVC_RET_OK) {
+        WrtLogW("Fail to create result bundle");
+        return false;
+    }
+
+    char port[10] = {0,};
+    sprintf(port, "%u", portNum);
+    if (appsvc_add_data(request, KEY_PORT, port) != APPSVC_RET_OK) {
+        WrtLogW("Fail to add data");
+        bundle_free(request);
+        return false;
+    }
+
+    if (appsvc_send_result(request, APPSVC_RES_OK) != APPSVC_RET_OK) {
+        WrtLogW("Fail to send result");
+        bundle_free(request);
+        return false;
+    }
+
+    bundle_free(request);
+    return true;
+}
+
+void IDESupport::consoleMessage(int level, const char* format, ...)
+{
+    va_list args;
+    va_start(args, format);
+    switch (level) {
+    case ConsoleLogLevel::Debug:
+        ALOG_VA(LOG_DEBUG, CONSOLE_MESSAGE_LOG_TAG, format, args);
+        break;
+    case ConsoleLogLevel::Warning:
+        ALOG_VA(LOG_WARN, CONSOLE_MESSAGE_LOG_TAG, format, args);
+        break;
+    case ConsoleLogLevel::Error:
+        ALOG_VA(LOG_ERROR, CONSOLE_MESSAGE_LOG_TAG, format, args);
+        break;
+    default:
+        ALOG_VA(LOG_DEBUG, CONSOLE_MESSAGE_LOG_TAG, format, args);
+        break;
+    }
+    va_end(args);
+}
+} // ClientModule
diff --git a/src/wrt-client/client_ide_support.h b/src/wrt-client/client_ide_support.h
new file mode 100644 (file)
index 0000000..e52c1d1
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+ /**
+ * @file    client_ide_support.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+#ifndef CLIENT_IDE_SUPPORT_H_
+#define CLIENT_IDE_SUPPORT_H_
+
+#include <bundle.h>
+
+namespace ClientModule {
+namespace IDESupport {
+bool getDebugMode(bundle* b);
+bool sendReply(bundle* b, unsigned int portNum);
+void consoleMessage(int level, const char* format, ...);
+} // IDESupport
+} // ClientModule
+#endif // CLIENT_IDE_SUPPORT_H_
\ No newline at end of file
diff --git a/src/wrt-client/client_orientation_support.cpp b/src/wrt-client/client_orientation_support.cpp
new file mode 100644 (file)
index 0000000..ac9830f
--- /dev/null
@@ -0,0 +1,278 @@
+/*
+  * Copyright 2013  Samsung Electronics Co., Ltd
+  *
+  * Licensed under the Flora License, Version 1.1 (the "License");
+  * you may not use this file except in compliance with the License.
+  * You may obtain a copy of the License at
+  *
+  *     http://floralicense.org/license/
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+/**
+ * @file       client_orientation_support.cpp
+ * @author     Grzegorz Rynkowski (g.rynkowski@samsung.com)
+ * @brief      source file to support window orientation of web application
+ */
+
+#include "client_orientation_support.h"
+
+#include <dpl/assert.h>
+#include <dpl/availability.h>
+#include <dpl/foreach.h>
+#include <dpl/log/wrt_log.h>
+#include <Elementary.h>
+#include <Evas.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <widget_data_types.h>
+
+namespace ClientModule {
+
+namespace {
+const char* const WM_ROTATION_CHANGED_CALLBACK =  "wm,rotation,changed";
+const int ANGLE_PORTRAIT = 0;
+const int ANGLE_LANDSCAPE = 270;
+}
+
+OrientationSupport::OrientationSupport(const WindowDataPtr& windowData,
+                                     const WRT::RunnableWidgetObjectPtr& widget)
+        : m_windowData(windowData),
+          m_widget(widget),
+          m_rotationAngle(0)
+{
+}
+
+void OrientationSupport::setWindowOrientation(int angle)
+{
+    Assert(m_windowData);
+    m_windowData->setOrientation(angle);
+}
+
+void OrientationSupport::setInitialWindowOrientation(
+                                     WidgetSettingScreenLock rotationValue)
+{
+    switch(rotationValue)  {
+    case Screen_AutoRotation:
+        break;
+    case Screen_Landscape:
+        setWindowOrientation(OrientationAngle::Window::Landscape::PRIMARY);
+        break;
+    case Screen_Portrait:
+    default:
+        setWindowOrientation(OrientationAngle::Window::Portrait::PRIMARY);
+        break;
+    }
+}
+
+bool OrientationSupport::setAutoRotation()
+{
+    Assert(m_windowData);
+    Evas_Object* window = m_windowData->getEvasObject(Layer::WINDOW);
+
+    if (elm_win_wm_rotation_supported_get(window)) {
+        const int rots[4] = {OrientationAngle::Window::Portrait::PRIMARY,
+                             OrientationAngle::Window::Portrait::SECONDARY,
+                             OrientationAngle::Window::Landscape::PRIMARY,
+                             OrientationAngle::Window::Landscape::SECONDARY};
+        elm_win_wm_rotation_available_rotations_set(window, rots, 4);
+        registerRotationCallback(&OrientationSupport::autoRotationCallback, this);
+#if USE(WEBKIT_MANUAL_ROTATION)
+        m_rotationAngle = elm_win_rotation_get(window);
+#endif
+        return true;
+    }
+    return false;
+}
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+void OrientationSupport::setRotationDone(void)
+{
+    WrtLogD("called");
+
+    Assert(m_windowData);
+    Evas_Object* win = m_windowData->getEvasObject(Layer::WINDOW);
+    Assert(win);
+    if (EINA_TRUE == elm_win_wm_rotation_manual_rotation_done_get(win)) {
+        elm_win_wm_rotation_manual_rotation_done(win);
+    }
+}
+
+void OrientationSupport::setManualRotation(bool enable)
+{
+    WrtLogD("called");
+
+    Assert(m_windowData);
+    Evas_Object* win = m_windowData->getEvasObject(Layer::WINDOW);
+
+    Assert(win);
+    elm_win_wm_rotation_manual_rotation_done_set(win, enable ? EINA_TRUE : EINA_FALSE);
+}
+#endif
+
+bool OrientationSupport::isOrientationPrepared(WidgetSettingScreenLock rotationValue)
+{
+    WrtLogD("called");
+
+    Assert(m_windowData);
+    Evas_Object* win = m_windowData->getEvasObject(Layer::WINDOW);
+    Assert(win);
+    int currentAngle = elm_win_rotation_get(win);
+    if (currentAngle == -1) {
+        WrtLogE("elm_win_rotation_get failed");
+        Assert(false);
+    }
+
+    switch(rotationValue) {
+        case Screen_Landscape:
+            return currentAngle == ANGLE_LANDSCAPE;
+        case Screen_Portrait:
+            return currentAngle == ANGLE_PORTRAIT;
+        case Screen_AutoRotation:
+        default:
+            return true;
+    }
+}
+
+void OrientationSupport::registerRotationCallback(const Evas_Smart_Cb callback,
+                                                  const void *data)
+{
+    Assert(m_windowData);
+    Evas_Object* window = m_windowData->getEvasObject(Layer::WINDOW);
+    WrtLogD("add rotation callback");
+    evas_object_smart_callback_add(window,
+                                   WM_ROTATION_CHANGED_CALLBACK,
+                                   callback,
+                                   data);
+    m_registeredCallbacks.push_back(
+            Callback(WM_ROTATION_CHANGED_CALLBACK, callback));
+}
+
+void OrientationSupport::unregisterRotationCallback(const Evas_Smart_Cb callback)
+{
+    FOREACH(it, m_registeredCallbacks)
+    {
+        if (it->second == callback) {
+            Assert(m_windowData);
+            Evas_Object* win = m_windowData->getEvasObject(Layer::WINDOW);
+            Assert(win);
+            WrtLogD("remove rotation callback: %s (%p)", WM_ROTATION_CHANGED_CALLBACK, callback);
+            evas_object_smart_callback_del(win, it->first.c_str(), it->second);
+            m_registeredCallbacks.erase(it);
+            return;
+        }
+    }
+}
+
+void OrientationSupport::unregisterRotationCallbacks()
+{
+    Assert(m_windowData);
+    Evas_Object* wkView = m_windowData->getEvasObject(Layer::WINDOW);
+    FOREACH(it, m_registeredCallbacks)
+    {
+        WrtLogD("remove rotation callback: %s", it->first.c_str());
+        evas_object_smart_callback_del(wkView, it->first.c_str(), it->second);
+    }
+}
+
+void OrientationSupport::setEwkInitialOrientation(
+                                     WidgetSettingScreenLock rotationValue)
+{
+    Assert(m_widget);
+
+    Evas_Object* obj =  m_widget->GetCurrentWebview();
+    switch(rotationValue)  {
+      case Screen_Landscape:
+          ewk_view_orientation_send(obj,
+                                    OrientationAngle::W3C::Landscape::PRIMARY);
+          break;
+      case Screen_Portrait:
+      case Screen_AutoRotation:
+      default:
+          ewk_view_orientation_send(obj,
+                                    OrientationAngle::W3C::Portrait::PRIMARY);
+          break;
+      }
+}
+
+void OrientationSupport::rotatePrepared(Evas_Object* obj)
+{
+    WrtLogD("rotatePrepared");
+    Assert(m_windowData);
+    int winAngle = elm_win_rotation_get(
+            m_windowData->getEvasObject(Layer::WINDOW));
+    int w3cAngle;
+
+    switch(winAngle)  {
+    case OrientationAngle::Window::Portrait::PRIMARY:
+        w3cAngle = OrientationAngle::W3C::Portrait::PRIMARY;
+        break;
+    case OrientationAngle::Window::Portrait::SECONDARY:
+        w3cAngle = OrientationAngle::W3C::Portrait::SECONDARY;
+        break;
+    case OrientationAngle::Window::Landscape::PRIMARY:
+        w3cAngle = OrientationAngle::W3C::Landscape::PRIMARY;
+        break;
+    case OrientationAngle::Window::Landscape::SECONDARY:
+        w3cAngle = OrientationAngle::W3C::Landscape::SECONDARY;
+        break;
+    default:
+        WrtLogW("unknown angle");
+        return;
+    }
+    ewk_view_orientation_send(obj, w3cAngle);
+}
+
+void OrientationSupport::updateRotationAngle(void)
+{
+    Evas_Object* win = m_windowData->getEvasObject(Layer::WINDOW);
+    int newAngle = elm_win_rotation_get(win);
+    if (newAngle == -1) {
+        WrtLogW("elm_win_rotation_get failed");
+        return;
+    }
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+    if (EINA_FALSE == elm_win_wm_rotation_manual_rotation_done_get(win)) {
+        WrtLogD("Rotate by platform");
+        m_rotationAngle = newAngle;
+        return;
+    }
+
+    if ((m_rotationAngle + newAngle) % 180 == 0)
+    {
+        WrtLogD("Rotate by wrt");
+        // In case of rotate 180 degress, setRotationDone by WRT instead of webkit.
+        //    Webkit doesn't call "rotate,prepared" callback.
+        setRotationDone();
+    }
+    m_rotationAngle = newAngle;
+#endif
+}
+
+//static
+void OrientationSupport::autoRotationCallback(void* data,
+                                     Evas_Object* obj,
+                                     void* event)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(event);
+    WrtLogD("entered");
+    OrientationSupport* This = static_cast<OrientationSupport*>(data);
+    Assert(This->m_widget);
+    This->rotatePrepared(This->m_widget->GetCurrentWebview());
+    This->updateRotationAngle();
+}
+
+void OrientationSupport::resetOrientation()
+{
+    Assert(m_widget);
+    rotatePrepared(m_widget->GetCurrentWebview());
+    updateRotationAngle();
+}
+
+} // namespace ClientModule
diff --git a/src/wrt-client/client_orientation_support.h b/src/wrt-client/client_orientation_support.h
new file mode 100644 (file)
index 0000000..081bf61
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+  * Copyright 2013  Samsung Electronics Co., Ltd
+  *
+  * Licensed under the Flora License, Version 1.1 (the "License");
+  * you may not use this file except in compliance with the License.
+  * You may obtain a copy of the License at
+  *
+  *     http://floralicense.org/license/
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+
+/**
+ * @file       client_orientation_support.h
+ * @author     Grzegorz Rynkowski (g.rynkowski@samsung.com)
+ * @brief      header file to support window orientation of web application
+ */
+
+#ifndef CLIENT_ORIENTATION_SUPPORT_H_
+#define CLIENT_ORIENTATION_SUPPORT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+
+#include <dpl/platform.h>
+#include <Evas.h>
+#include <i_runnable_widget_object.h>
+#include <widget_data_types.h>
+
+#include "window_data.h"
+
+namespace ClientModule {
+
+class OrientationSupport {
+  public:
+    OrientationSupport(const WindowDataPtr& windowData,
+                       const WRT::RunnableWidgetObjectPtr& widget);
+
+    void setInitialWindowOrientation(WidgetSettingScreenLock rotationValue);
+    void setEwkInitialOrientation(WidgetSettingScreenLock rotationValue);
+    bool setAutoRotation();
+#if USE(WEBKIT_MANUAL_ROTATION)
+    void setRotationDone(void);
+    void setManualRotation(bool enable);
+#endif
+    bool isOrientationPrepared(WidgetSettingScreenLock rotationValue);
+
+    void registerRotationCallback(const Evas_Smart_Cb callback, const void *data);
+    void unregisterRotationCallback(const Evas_Smart_Cb callback);
+    void unregisterRotationCallbacks();
+    void resetOrientation();
+
+  private:
+    void setWindowOrientation(int angle);
+    void rotatePrepared(Evas_Object* obj);
+    void updateRotationAngle(void);
+    static void autoRotationCallback(void* data, Evas_Object* obj, void* event);
+
+    WindowDataPtr m_windowData;
+    WRT::RunnableWidgetObjectPtr m_widget;
+    // TODO: separate by base class(OrientationManualRotationSupport)
+    int m_rotationAngle;
+
+    typedef std::pair<std::string, Evas_Smart_Cb> Callback;
+    typedef std::vector<Callback> CallbacksList;
+    CallbacksList m_registeredCallbacks;
+};
+
+} // namespace ClientModule
+#endif // CLIENT_ORIENTATION_SUPPORT_H_
diff --git a/src/wrt-client/client_submode_support.cpp b/src/wrt-client/client_submode_support.cpp
new file mode 100644 (file)
index 0000000..278555e
--- /dev/null
@@ -0,0 +1,199 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       client_submode_support.cpp
+ * @author     Jihoon Chung (jihoon.chung@samsung.com)
+ * @version    1.0
+ */
+
+#include "client_submode_support.h"
+
+#include <memory>
+#include <sstream>
+#include <Ecore.h>
+#include <Elementary.h>
+#include <bundle.h>
+
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+
+#include <application_data.h>
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+#include <web_internal_eventloop.h>
+#endif
+
+namespace ClientModule {
+namespace {
+const unsigned int EMPTY = 0;
+const unsigned int INLINE_MODE = 1;
+const unsigned int TRANSIENT_WINDOW = 1 << 1;
+}
+
+ //Implementation class
+class SubmodeSupportImplementation
+{
+  private:
+    bool m_initialized;
+    WrtDB::TizenAppId m_appId;
+    unsigned int m_mode;
+
+    void setMode(const int mode)
+    {
+        m_mode |= mode;
+    }
+
+    bool getMode(const int mode)
+    {
+        return m_mode & mode;
+    }
+
+    static Eina_Bool destoryCallback(void* data, int /*type*/, void* event)
+    {
+        WrtLogD("called");
+        Ecore_X_Window callerId = reinterpret_cast<Ecore_X_Window>(data);
+
+        Assert(event);
+        Ecore_X_Event_Window_Hide* ev =
+            static_cast<Ecore_X_Event_Window_Hide*>(event);
+
+        if(ev->win == callerId) {
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+            char* appId = ecore_x_window_prop_string_get(ev->win, ECORE_X_ATOM_UTF8_STRING);
+            if (appId) {
+                WebInternalEventSingleton::Instance().sendEvent(WebInternalEventSingleton::Instance().WEB_APP_TERMINATE,
+                                                                appId);
+            }
+#else
+            elm_exit();
+#endif
+        }
+        return ECORE_CALLBACK_CANCEL;
+    }
+
+  public:
+    SubmodeSupportImplementation() :
+        m_initialized(false),
+        m_mode(EMPTY)
+    {
+    }
+
+    void initialize(WrtDB::TizenAppId appId)
+    {
+        WrtLogD("called");
+
+        m_appId = appId;
+        WrtDB::WidgetDAOReadOnly dao(m_appId);
+        WrtDB::WidgetAppControlList widgetApplicationControlList;
+        dao.getAppControlList(widgetApplicationControlList);
+        FOREACH(it, widgetApplicationControlList) {
+            if (it->disposition ==
+                WrtDB::WidgetAppControl::Disposition::INLINE)
+            {
+                WrtLogD("disposition");
+                setMode(INLINE_MODE);
+            }
+        }
+
+        m_initialized = true;
+    }
+
+    void deinitialize(void)
+    {
+        WrtLogD("called");
+        m_initialized = false;
+    }
+
+    bool isInlineMode(void)
+    {
+        return getMode(INLINE_MODE);
+    }
+
+    bool isNeedTerminateOnSuspend(void)
+    {
+        if (isInlineMode()) {
+            return !getMode(TRANSIENT_WINDOW);
+        }
+        return false;
+    }
+
+    bool transientWindow(Ecore_X_Window calleeId)
+    {
+        WrtLogD("called");
+        if (!m_initialized) {
+            WrtLogE("not initialized");
+            return false;
+        }
+
+        bundle* b = ApplicationDataSingleton::Instance().getBundle(DPL::ToUTF8String(m_appId));
+        if (!b) {
+            WrtLogW("Service data is empty");
+            return false;
+        }
+        const char* callerIdPtr = bundle_get_val(b, "__APP_SVC_K_WIN_ID__");
+        if (callerIdPtr) {
+            Ecore_X_Window callerId = atoi(callerIdPtr);
+            WrtLogD("Caller x handle = %u", callerId);
+            ecore_x_icccm_transient_for_set(calleeId, callerId);
+            ecore_x_window_client_manage(callerId);
+            ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY,
+                                    destoryCallback,
+                                    reinterpret_cast<void*>(callerId));
+            setMode(TRANSIENT_WINDOW);
+        } else {
+            WrtLogW("Service data is empty");
+            return false;
+        }
+
+        return true;
+    }
+};
+
+SubmodeSupport::SubmodeSupport() :
+    m_impl(new SubmodeSupportImplementation())
+{
+}
+
+SubmodeSupport::~SubmodeSupport()
+{
+}
+
+void SubmodeSupport::initialize(WrtDB::TizenAppId appId)
+{
+    m_impl->initialize(appId);
+}
+
+void SubmodeSupport::deinitialize(void)
+{
+    m_impl->deinitialize();
+}
+
+bool SubmodeSupport::isInlineMode(void)
+{
+    return m_impl->isInlineMode();
+}
+
+bool SubmodeSupport::isNeedTerminateOnSuspend(void)
+{
+    return m_impl->isNeedTerminateOnSuspend();
+}
+
+bool SubmodeSupport::transientWindow(Ecore_X_Window calleeId)
+{
+    return m_impl->transientWindow(calleeId);
+}
+} // namespace ClientModule
diff --git a/src/wrt-client/client_submode_support.h b/src/wrt-client/client_submode_support.h
new file mode 100644 (file)
index 0000000..4fdcf66
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file       client_submode_support.h
+ * @author     Jihoon Chung (jihoon.chung@samsung.com)
+ * @version    1.0
+ */
+
+#ifndef CLIENT_SUBMODE_SUPPORT_H_
+#define CLIENT_SUBMODE_SUPPORT_H_
+
+#include <memory>
+#include <Ecore_X.h>
+
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+
+namespace ClientModule {
+class SubmodeSupportImplementation;
+class SubmodeSupport
+{
+  public:
+    SubmodeSupport();
+    virtual ~SubmodeSupport();
+    void initialize(WrtDB::TizenAppId appId);
+    void deinitialize(void);
+    bool isInlineMode(void);
+    bool isNeedTerminateOnSuspend(void);
+    bool transientWindow(Ecore_X_Window win);
+
+  private:
+    std::unique_ptr<SubmodeSupportImplementation> m_impl;
+};
+} // namespace ClientModule
+#endif // CLIENT_SUBMODE_SUPPORT_H_
\ No newline at end of file
diff --git a/src/wrt-client/process_pool/smack_labeling_support.cpp b/src/wrt-client/process_pool/smack_labeling_support.cpp
new file mode 100644 (file)
index 0000000..a5e2957
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    smack_labeling_support.cpp
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 0.1
+ * @brief   API to support smack labeling for whole threads in a process.
+ */
+
+#include "smack_labeling_support.h"
+
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/smack.h>
+#include <dirent.h>
+#include <assert.h>
+#include <dpl/log/wrt_log.h>
+
+#define SMACK_LABEL_LEN 255
+#define FILE_MAX_LEN    1024
+#define MAX_RETRY_CNT   1000
+#define UID_ROOT        0
+
+static char s_smack_label[SMACK_LABEL_LEN + 1] = {0,};
+static int  s_waiting_task_cnt = 0;
+
+static int smack_set_label_for_tid(const char *label)
+{
+    int len, fd, ret;
+    char curren_path[FILE_MAX_LEN + 1] = {0,};
+
+    len = strnlen(label, SMACK_LABEL_LEN + 1);
+
+    if (len > SMACK_LABEL_LEN)
+    {
+        return -1;
+    }
+
+    snprintf(curren_path, sizeof(curren_path), "/proc/%d/attr/current", (int)syscall(__NR_gettid));
+
+    fd = open(curren_path, O_WRONLY);
+
+    if (fd < 0)
+    {
+        return -1;
+    }
+
+    ret = write(fd, label, len);
+    close(fd);
+
+    return (ret < 0) ? -1 : 0;
+}
+
+static void SIGUSR1_handler(int /*signo*/)
+{
+    if (smack_set_label_for_tid(s_smack_label) != 0)
+    {
+        WrtLogE("## [tid: %d] smack_set_label_for_tid() failed! ##", (int)syscall(__NR_gettid));
+    }
+    s_waiting_task_cnt--;
+}
+
+static int set_SIGUSR1_handler()
+{
+    if (signal(SIGUSR1, SIGUSR1_handler) == SIG_ERR)
+    {
+        WrtLogE("## signal(SIGUSR1, SIGUSR1_handler) failed! ##");
+        return -1;
+    }
+
+    return 0;
+}
+
+static int set_SIGUSR1_to_default()
+{
+    if (signal(SIGUSR1, SIG_DFL) == SIG_ERR)
+    {
+        WrtLogE("## signal(SIGUSR1, SIG_ERR) failed! ##");
+        return -1;
+    }
+
+    return 0;
+}
+
+static int send_SIGUSR1_to_threads()
+{
+    int ret;
+    DIR *dir;
+    struct dirent entry, *result;
+    char proc_self_task_path[FILE_MAX_LEN + 1] = {0, };
+
+    sprintf(proc_self_task_path, "/proc/self/task");
+
+    dir = opendir(proc_self_task_path);
+
+    if (dir)
+    {
+        for (ret = readdir_r(dir, &entry, &result);
+             result != NULL && ret == 0;
+             ret = readdir_r(dir, &entry, &result))
+        {
+            if (strncmp(entry.d_name, ".", 2) == 0 ||
+                strncmp(entry.d_name, "..", 3) == 0)
+            {
+                continue;
+            }
+
+            s_waiting_task_cnt++;
+            if (syscall(__NR_tkill, atoi(entry.d_name), SIGUSR1) != 0)
+            {
+                WrtLogE("## tkill(%dSIGUSR1) failed! ##", atoi(entry.d_name));
+                s_waiting_task_cnt--;
+            }
+        }
+
+        closedir(dir);
+    }
+    else
+    {
+        WrtLogE("## opendir(\"/proc/self/task\") failed! ##");
+        return -1;
+    }
+
+    return 0;
+}
+
+int set_app_smack_label(const char* app_path)
+{
+    assert(s_waiting_task_cnt == 0);
+
+    if (UID_ROOT != getuid() || app_path == NULL)
+    {
+        WrtLogE("## parameter error! ##");
+        return -1;
+    }
+
+    // set SIGUSR1 signal handler
+    if (set_SIGUSR1_handler() != 0)
+    {
+        return -1;
+    }
+
+    // get smack label from app_path
+    char *smack_label = NULL;
+
+    if (smack_lgetlabel(app_path, &smack_label, SMACK_LABEL_EXEC) != 0)
+    {
+        WrtLogE("## smack_lgetlabel() failed! ##");
+        goto err_set_app_smack_label;
+    }
+
+    if (smack_label)
+    {
+        strncpy(s_smack_label, smack_label, sizeof(s_smack_label));
+        s_smack_label[SMACK_LABEL_LEN] = '\0';
+
+        free(smack_label);
+        smack_label = NULL;
+    }
+    else
+    {
+        WrtLogE("## smack_label is NULL! ##");
+        strcpy(s_smack_label, "");
+    }
+
+    if (send_SIGUSR1_to_threads() != 0)
+    {
+        WrtLogE("## send_SIGUSR1_to_threads() timeout! ##");
+        goto err_set_app_smack_label;
+    }
+
+    // wait for labeling on each tasks
+    int i;
+
+    for (i=0; s_waiting_task_cnt && i < MAX_RETRY_CNT; i++)
+    {
+        usleep(100); // 0.1ms
+    }
+
+    if (i == MAX_RETRY_CNT)
+    {
+        WrtLogE("## set_app_smack_label() timeout! ##");
+    }
+
+    // set SIGUSR1 signal defualt handler
+    set_SIGUSR1_to_default();
+
+    return 0;
+
+err_set_app_smack_label:
+    s_waiting_task_cnt = 0;
+    set_SIGUSR1_to_default();
+
+    return -1;
+}
+
+
diff --git a/src/wrt-client/process_pool/smack_labeling_support.h b/src/wrt-client/process_pool/smack_labeling_support.h
new file mode 100644 (file)
index 0000000..09ef1a5
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    smack_labeling_support.h
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 0.1
+ * @brief   API to support smack labeling for whole threads in a process.
+ */
+
+#ifndef SMACK_LABELING_SUPPORT_H
+#define SMACK_LABELING_SUPPORT_H
+
+int set_app_smack_label(const char* app_path);
+
+#endif // SMACK_LABELING_SUPPORT_H
diff --git a/src/wrt-client/splash_screen_support.cpp b/src/wrt-client/splash_screen_support.cpp
new file mode 100644 (file)
index 0000000..eff3875
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        splash_screen_support.cpp
+ * @author      Andrzej Surdej (a.surdej@samsung.com)
+ * @brief       Implementation file for splash screen support
+ */
+
+#include "splash_screen_support.h"
+#include <dpl/log/wrt_log.h>
+
+const short  SPLASH_SCREEN_LAYER = 10;
+const double SPLASH_SCREEN_MAXIUM_TIMER = 5.0;   // sec
+const double SPLASH_SCREEN_BUFFER_TIMER = 0.3;  //  sec
+const int    INDICATOR_H = 60;
+
+static void evas_object_reposition(Evas_Object* obj, int x, int y, int w, int h)
+{
+    evas_object_resize(obj,w, h);
+    evas_object_move(obj, x, y);
+}
+
+SplashScreenSupport::SplashScreenSupport(Evas_Object* parent, const char* image_path, bool indicator, bool landscape) :
+    m_parent(parent),
+    m_splashScreen(NULL),
+    m_splashScreenBg(NULL),
+    m_timer(NULL),
+    m_deviceWidth(0),
+    m_deviceHeight(0),
+    m_imageWidth(0),
+    m_imageHeight(0),
+    m_initialized(false),
+    m_isShowing(false),
+    m_indicator(indicator)
+{
+    WrtLogD("enter");
+
+    if (!m_parent || !image_path)
+    {
+        WrtLogE("Invalid parameter");
+        return;
+    }
+
+    // create evas object
+    m_splashScreenBg = evas_object_rectangle_add(evas_object_evas_get(m_parent));
+    evas_object_color_set(m_splashScreenBg, 255, 255, 255, 255);
+
+    m_splashScreen = elm_image_add(m_splashScreenBg);
+    elm_image_no_scale_set(m_splashScreen, FALSE);
+
+    if (elm_image_file_set(m_splashScreen, image_path, NULL))
+    {
+        // check animation
+        if (elm_image_animated_available_get(m_splashScreen))
+        {
+            elm_image_animated_set(m_splashScreen, EINA_TRUE);
+            elm_image_animated_play_set(m_splashScreen, EINA_FALSE);
+        }
+
+        // get contents area
+        Evas_Coord x, y, w, h;
+        evas_object_geometry_get(m_parent, &x, &y, &w, &h);
+
+        m_deviceWidth  = (w < h) ? w : h;
+        m_deviceHeight = (w > h) ? w : h;
+
+        if (!landscape)
+        {
+            x = 0;
+            y = 0;
+            w = m_deviceWidth;
+            h = m_deviceHeight;
+
+            if (m_indicator)
+            {
+                int indicator_h = ELM_SCALE_SIZE(INDICATOR_H);
+
+                y += indicator_h;
+                h -= indicator_h;
+            }
+        }
+        else
+        {
+            x = 0;
+            y = 0;
+            w = m_deviceHeight;
+            h = m_deviceWidth;
+        }
+
+        // fit to width
+        elm_image_object_size_get(m_splashScreen, &m_imageWidth, &m_imageHeight);
+
+        if (m_imageWidth == 0 || m_imageHeight == 0)
+        {
+            WrtLogE("Splash screen image size error!");
+
+            m_imageWidth = w;
+            m_imageHeight = h;
+        }
+
+        double ratio_win    = (double)w/h;
+        double ratio_image  = (double)m_imageWidth/m_imageHeight;
+
+        // set evas position
+        evas_object_reposition(m_splashScreenBg, x, y, w, h);
+        evas_object_reposition(m_splashScreen,   x, y, w, h);
+
+        double scaled_image_w = w;
+        double scaled_image_h = (w/ratio_image);
+
+        Evas_Object* imageObject = elm_image_object_get(m_splashScreen);
+
+        if (ratio_image <= ratio_win)
+        {
+            evas_object_image_fill_set(imageObject, 0, 0-((scaled_image_h-h)/2), scaled_image_w, scaled_image_h);
+            evas_object_reposition(imageObject, x, y, w, h);
+        }
+        else
+        {
+            evas_object_image_fill_set(imageObject, 0, 0, scaled_image_w, scaled_image_h);
+            evas_object_reposition(imageObject, 0, y+(h-scaled_image_h)/2, scaled_image_w, scaled_image_h);
+        }
+
+        m_initialized = true;
+    }
+}
+
+SplashScreenSupport::~SplashScreenSupport()
+{
+    WrtLogD("enter");
+
+    if (m_initialized)
+    {
+        evas_object_del(m_splashScreen);
+        evas_object_del(m_splashScreenBg);
+    }
+
+    if (m_timer)
+    {
+        ecore_timer_del(m_timer);
+        m_timer = NULL;
+    }
+}
+
+Eina_Bool SplashScreenSupport::timerCallback(void *data)
+{
+    WrtLogD("enter");
+
+    SplashScreenSupport* This = static_cast<SplashScreenSupport*>(data);
+
+    if (This->isShowing())
+    {
+        This->stopSplashScreen();
+    }
+
+    return ECORE_CALLBACK_CANCEL;
+}
+
+void SplashScreenSupport::startSplashScreen()
+{
+    WrtLogD("splashImageOn");
+
+    if (m_initialized)
+    {
+        if (elm_image_animated_get(m_splashScreen) == EINA_TRUE)
+        {
+            elm_image_animated_play_set(m_splashScreen, EINA_TRUE);
+        }
+
+        evas_object_layer_set(m_splashScreenBg, SPLASH_SCREEN_LAYER);
+        evas_object_layer_set(m_splashScreen,   SPLASH_SCREEN_LAYER);
+
+        evas_object_show(m_splashScreenBg);
+        evas_object_show(m_splashScreen);
+
+        m_isShowing = true;
+
+        if (m_timer)
+        {
+            ecore_timer_del(m_timer);
+        }
+
+        m_timer = ecore_timer_add(SPLASH_SCREEN_MAXIUM_TIMER, timerCallback, this);
+    }
+}
+
+
+void SplashScreenSupport::stopSplashScreenBuffered()
+{
+    if (m_isShowing)
+    {
+        if (m_timer)
+        {
+            ecore_timer_del(m_timer);
+        }
+
+        m_timer = ecore_timer_add(SPLASH_SCREEN_BUFFER_TIMER, timerCallback, this);
+    }
+}
+
+void SplashScreenSupport::stopSplashScreen()
+{
+    WrtLogD("splashImageOff");
+
+    if (m_isShowing)
+    {
+        if (elm_image_animated_get(m_splashScreen) == EINA_TRUE)
+        {
+            elm_image_animated_play_set(m_splashScreen, EINA_FALSE);
+        }
+
+        evas_object_hide(m_splashScreen);
+        evas_object_hide(m_splashScreenBg);
+
+        evas_object_del(m_splashScreen);
+        evas_object_del(m_splashScreenBg);
+
+        m_initialized = false;
+        m_isShowing = false;
+
+        if (m_timer)
+        {
+            ecore_timer_del(m_timer);
+            m_timer = NULL;
+        }
+    }
+}
+
+bool SplashScreenSupport::isShowing()
+{
+    return m_isShowing;
+}
+
+void SplashScreenSupport::resizeSplashScreen()
+{
+    if (m_initialized && m_isShowing)
+    {
+        int x, y, w, h;
+        int angle = elm_win_rotation_get(m_parent);
+
+        if (angle == 0 || angle == 180)
+        {
+            x = 0;
+            y = 0;
+            w = m_deviceWidth;
+            h = m_deviceHeight;
+
+            if (m_indicator)
+            {
+                int indicator_h =ELM_SCALE_SIZE(INDICATOR_H);
+
+                y += indicator_h;
+                h -= indicator_h;
+            }
+        }
+        else
+        {
+            x = 0;
+            y = 0;
+            w = m_deviceHeight;
+            h = m_deviceWidth;
+        }
+
+        // fit to width
+        double ratio_win    = (double)w/h;
+        double ratio_image  = (double)m_imageWidth/m_imageHeight;
+
+        evas_object_reposition(m_splashScreenBg, x, y, w, h);
+        evas_object_reposition(m_splashScreen,   x, y, w, h);
+
+        double scaled_image_w = w;
+        double scaled_image_h = (w/ratio_image);
+
+        Evas_Object* imageObject = elm_image_object_get(m_splashScreen);
+
+        if (ratio_image <= ratio_win)
+        {
+            evas_object_image_fill_set(imageObject, 0, 0-((scaled_image_h-h)/2), scaled_image_w, scaled_image_h);
+            evas_object_reposition(imageObject, x, y, w, h);
+        }
+        else
+        {
+            evas_object_image_fill_set(imageObject, 0, 0, scaled_image_w, scaled_image_h);
+            evas_object_reposition(imageObject, 0, y+(h-scaled_image_h)/2, scaled_image_w, scaled_image_h);
+        }
+
+    }
+}
diff --git a/src/wrt-client/splash_screen_support.h b/src/wrt-client/splash_screen_support.h
new file mode 100644 (file)
index 0000000..553b863
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        splash_screen_support.h
+ * @author      Andrzej Surdej (a.surdej@samsung.com)
+ * @brief       Header file for supporting splash screen handling
+ */
+
+#ifndef WRT_SPLASH_SCREEN_SUPPORT_H
+#define WRT_SPLASH_SCREEN_SUPPORT_H
+
+#include <Evas.h>
+#include <Elementary.h>
+
+class SplashScreenSupport
+{
+  public:
+    SplashScreenSupport(Evas_Object* parent, const char* image_path, bool indicator = true, bool landscape = false);
+    ~SplashScreenSupport();
+
+    void startSplashScreen();
+    void stopSplashScreen();
+    void stopSplashScreenBuffered();
+    bool isShowing();
+    void resizeSplashScreen();
+    static Eina_Bool timerCallback(void *data);
+
+  private:
+    Evas_Object* m_parent;
+    Evas_Object* m_splashScreen;
+    Evas_Object* m_splashScreenBg;
+    Ecore_Timer* m_timer;
+
+    int m_deviceWidth;
+    int m_deviceHeight;
+    int m_imageWidth;
+    int m_imageHeight;
+
+    bool m_initialized;
+    bool m_isShowing;
+    bool m_indicator;
+};
+
+#endif /* WRT_SPLASH_SCREEN_SUPPORT_H */
diff --git a/src/wrt-client/web_app_manager.cpp b/src/wrt-client/web_app_manager.cpp
new file mode 100644 (file)
index 0000000..90caca5
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include "web_app_manager.h"
+
+#include <ail.h>
+#include <app.h>
+#include <core_module.h>
+#include <dpl/availability.h>
+#include <dpl/localization/w3c_file_localization.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/string.h>
+#include <message_support.h>
+#include <security_support.h>
+#include <web_internal_eventloop.h>
+
+const char* const BUNDLE_PATH = "/usr/lib/libwrt-injected-bundle.so";
+
+WebAppManager::WebAppManager() :
+    m_nextLaunchContext(NULL),
+    m_nextLaunchWindowData(NULL)
+{
+    WrtLogD("called");
+
+#ifndef TIZEN_PUBLIC
+    setenv("COREGL_FASTPATH", "1", 1);
+#endif
+    setenv("CAIRO_GL_COMPOSITOR", "msaa", 1);
+    setenv("CAIRO_GL_LAZY_FLUSHING", "yes", 1);
+    setenv("ELM_IMAGE_CACHE", "0", 1);
+    setenv("IGNORE_WEBPROCESS_MEM_TRACKING", "1", 1);
+
+    WRT::CoreModuleSingleton::Instance().Init();
+    ewk_init();
+    if(!getenv("WRT_PROCESS_POOL_DISABLE")) {
+        WebInternalEventSingleton::Instance().addListner(WebInternalEvent::WEB_APP_START_POOL_PROCESS,
+                                                         createPoolProcessCallback,
+                                                         this);
+    }
+}
+
+WebAppManager::~WebAppManager()
+{
+    WrtLogD("called");
+
+    ewk_shutdown();
+    WRT::CoreModuleSingleton::Instance().Terminate();
+}
+
+bool WebAppManager::create(std::string appId, bundle* b)
+{
+    WrtLogD("create");
+
+    WrtClientLitePtr clientPtr = findWrtClientLitePtr(appId);
+    if (clientPtr) {
+        WrtLogW("wrtClientLitePtr already exists");
+        clientPtr->OnReset(b);
+        return true;
+    }
+
+    WrtClientLitePtr ptr(new WrtClientLite(appId, m_nextLaunchContext, m_nextLaunchWindowData));
+
+    if (!ptr) {
+        WrtLogE("Fail to create wrt-client-lite");
+        return false;
+    }
+
+    if (!setWebProcessCmdlineEnv(appId, m_nextLaunchContext && m_nextLaunchWindowData)) {
+        WrtLogE("Fail to change web process cmdline");
+        return false;
+    }
+    ptr->OnCreate(b);
+    unsetWebProcessCmdlineEnv();
+    m_nextLaunchContext = NULL;
+    m_nextLaunchWindowData = NULL;
+
+    m_wrtClientLitePtrMap.insert(WrtClientLitePtrMapPair(appId, ptr));
+
+    return true;
+}
+
+void WebAppManager::service(std::string appId, bundle* b)
+{
+    WrtLogD("service");
+
+    WrtClientLitePtr ptr = findWrtClientLitePtr(appId);
+    if (ptr) {
+        ptr->OnReset(b);
+    }
+}
+
+void WebAppManager::resume(std::string appId)
+{
+    WrtLogD("resume");
+
+    WrtClientLitePtr ptr = findWrtClientLitePtr(appId);
+    if (ptr) {
+        ptr->OnResume();
+    }
+}
+
+void WebAppManager::suspend(std::string appId)
+{
+    WrtLogD("suspend");
+
+    WrtClientLitePtr ptr = findWrtClientLitePtr(appId);
+    if (ptr) {
+        ptr->OnSuspend();
+    }
+}
+
+void WebAppManager::terminate(std::string appId)
+{
+    WrtLogD("terminate");
+
+    WrtClientLitePtr ptr = findWrtClientLitePtr(appId);
+    if (ptr) {
+        ptr->OnTerminate();
+        m_wrtClientLitePtrMap.erase(appId);
+    }
+}
+
+WrtClientLitePtr WebAppManager::findWrtClientLitePtr(std::string appId)
+{
+    WrtClientLitePtr ptr;
+    auto it = m_wrtClientLitePtrMap.find(appId);
+    if (it != m_wrtClientLitePtrMap.end()) {
+        WrtLogD("found WrtClientLitePtr: %s", it->first.c_str());
+       ptr = it->second;
+    }
+
+    return ptr;
+}
+
+bool WebAppManager::setWebProcessCmdlineEnv(const std::string& appId, bool isPooledProcess)
+{
+    ail_appinfo_h handle = NULL;
+    ail_error_e ret = ail_get_appinfo(appId.c_str(), &handle);
+    if (AIL_ERROR_OK != ret) {
+        WrtLogE("error ail_get_appinfo : %d", ret);
+        return false;
+    }
+
+    char* path;
+    ret = ail_appinfo_get_str(handle, AIL_PROP_X_SLP_EXE_PATH, &path);
+    if (AIL_ERROR_OK != ret) {
+        WrtLogE("error ail_appinfo_get_str(%s) : %d", AIL_PROP_X_SLP_EXE_PATH, ret);
+        ail_destroy_appinfo(handle);
+        return false;
+    }
+
+    std::string pluginProcessPath = WRT::SecuritySupport::getPluginProcessSoftLinkPath(appId);
+    if (!isPooledProcess) {
+        setenv("WEB_PROCESS_EXECUTABLE_PATH", path, 1);
+        setenv("PLUGIN_PROCESS_EXECUTABLE_PATH", pluginProcessPath.c_str(), 1);
+    } else {
+        ewk_context_message_post_to_injected_bundle(m_nextLaunchContext, Message::ToWebProcess::CHANGE_CMDLINE, path);
+        setenv("PLUGIN_PROCESS_EXECUTABLE_PATH_FOR_PROCESS_POOL", pluginProcessPath.c_str(), 1);
+    }
+
+    ail_destroy_appinfo(handle);
+    return true;
+}
+
+void WebAppManager::unsetWebProcessCmdlineEnv(void)
+{
+    unsetenv("WEB_PROCESS_EXECUTABLE_PATH");
+    unsetenv("PLUGIN_PROCESS_EXECUTABLE_PATH");
+}
+
+Eina_Bool WebAppManager::createPoolProcessCallback(void* data, int type, void* event)
+{
+    WrtLogD("Create Pooled process");
+
+    Assert(data);
+
+    DPL_UNUSED_PARAM(type);
+    DPL_UNUSED_PARAM(event);
+
+    setenv("WEB_PROCESS_EXECUTABLE_PATH", "/usr/bin/WebProcess", 1); // To make sure WebContext is created
+    setenv("WEB_PROCESS_EXECUTABLE_PATH_FOR_PROCESS_POOL","1", 1); // To ensure WebProcess is created
+
+    WebAppManager* This = static_cast<WebAppManager*>(data);
+    if (This->m_nextLaunchContext == NULL) {
+        This->m_nextLaunchContext = ewk_context_new_with_injected_bundle_path(BUNDLE_PATH);
+        if (This->m_nextLaunchContext == NULL) {
+            WrtLogW("Creating webkit context was failed!");
+            return ECORE_CALLBACK_RENEW;
+        }
+    }
+
+    if (This->m_nextLaunchWindowData == NULL) {
+        This->m_nextLaunchWindowData = new WindowData(static_cast<unsigned long>(getpid()));
+    }
+
+    unsetenv("WEB_PROCESS_EXECUTABLE_PATH");
+    unsetenv("WEB_PROCESS_EXECUTABLE_PATH_FOR_PROCESS_POOL");
+    return ECORE_CALLBACK_RENEW;
+}
+
+void WebAppManager::resetAulConnection(std::string appId)
+{
+    WrtLogD("reset aul connection");
+    WrtClientLitePtr ptr = findWrtClientLitePtr(appId);
+    if (ptr) {
+        ptr->OnResetAulConnection();
+    }
+}
diff --git a/src/wrt-client/web_app_manager.h b/src/wrt-client/web_app_manager.h
new file mode 100644 (file)
index 0000000..8b4ecc7
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef WEB_APP_MANAGER_H_
+#define WEB_APP_MANAGER_H_
+
+#include <map>
+#include <memory>
+#include <string>
+#include <utility>
+
+#include <app.h>
+#include <bundle.h>
+#include <core_module.h>
+#include <i_runnable_widget_object.h>
+#include "window_data.h"
+#include "wrt-client-lite.h"
+
+class WebAppManager
+{
+  public:
+    WebAppManager();
+    virtual ~WebAppManager();
+
+    bool create(std::string appId, bundle *b);
+    void service(std::string appId, bundle* b);
+    void resume(std::string appId);
+    void suspend(std::string appId);
+    void terminate(std::string appId);
+    static Eina_Bool createPoolProcessCallback(void *data, int type, void *event);
+    void resetAulConnection(std::string appId);
+
+  private:
+    WrtClientLitePtr findWrtClientLitePtr(std::string appId);
+
+    // WebProcess cmdline change
+    bool setWebProcessCmdlineEnv(const std::string& appId, bool isPooledProcess);
+    void unsetWebProcessCmdlineEnv(void);
+
+    typedef std::map<std::string, WrtClientLitePtr> WrtClientLitePtrMap;
+    typedef std::pair<std::string, WrtClientLitePtr> WrtClientLitePtrMapPair;
+    WrtClientLitePtrMap m_wrtClientLitePtrMap;
+
+    Ewk_Context* m_nextLaunchContext;
+    WindowData* m_nextLaunchWindowData;
+};
+
+#endif // WEB_APP_MANAGER_H_
diff --git a/src/wrt-client/widget_state.h b/src/wrt-client/widget_state.h
new file mode 100644 (file)
index 0000000..2c3c061
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    core_module.cpp
+ * @author  Przemyslaw Ciezkowski (p.ciezkowski@samsung.com)
+ * @version 1.0
+ * @brief   File contains declaration of WidgetState enum.
+ */
+
+#ifndef WIDGET_STATE_H
+#define WIDGET_STATE_H
+
+enum WidgetState
+{
+    WidgetState_Stopped,
+    WidgetState_Created,
+    WidgetState_Running,
+    WidgetState_Suspended,
+    WidgetState_Stopping
+};
+
+#endif /* WIDGET_STATE_H */
+
diff --git a/src/wrt-client/window_data.cpp b/src/wrt-client/window_data.cpp
new file mode 100644 (file)
index 0000000..ef5021e
--- /dev/null
@@ -0,0 +1,448 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        window_data.cpp
+ * @author      Jaroslaw Osmanski (j.osmanski@samsung.com)
+ * @version     1.0
+ * @brief       Window data class implementation
+ */
+#include "window_data.h"
+
+#include <ui-gadget.h>
+#include <dpl/assert.h>
+#include <dpl/platform.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/foreach.h>
+#include <dpl/availability.h>
+
+#include <efl_assist.h>
+#include <efl_assist_screen_reader.h>
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+#include <web_internal_eventloop.h>
+#endif
+
+namespace {
+const unsigned int UID_ROOT = 0;
+const char* const DELETE_REQUEST = "delete,request";
+const char* const PROFILE_CHANGED = "profile,changed";
+const char* const DESKTOP_ICON_PATH =
+    "/opt/share/icons/default/small/tizenScmgz.png";
+const std::string DESKTOP_PROFILE("desktop");
+const int PROGRESS_H = 10;
+} // anonymous namespace
+
+WindowData::WindowData(unsigned long pid, bool manualInit) :
+    m_win(NULL),
+    m_bg(NULL),
+    m_conformant(NULL),
+    m_conformantBg(NULL),
+    m_topLayout(NULL),
+    m_naviframe(NULL),
+    m_mainLayout(NULL),
+    m_progressbar(NULL),
+    m_initialized(false),
+    m_currentViewModeFullScreen(false)
+{
+    m_win = createWindow(pid);
+
+    if (!manualInit) {
+        init();
+    }
+}
+
+WindowData::~WindowData()
+{
+    WrtLogD("");
+    evas_object_del(m_win);
+}
+
+void WindowData::init()
+{
+    AssertMsg(m_win != NULL, "m_win is null");
+
+    if (m_initialized == true) {
+        WrtLogD("Already initilized");
+        return;
+    }
+
+    ea_theme_changeable_ui_enabled_set(EINA_TRUE);
+    m_bg = createBg(m_win);
+    evas_object_show(m_bg);
+    m_conformant = createConformant(m_win);
+    evas_object_show(m_conformant);
+    m_conformantBg = createConformantBg(m_conformant);
+    evas_object_show(m_conformantBg);
+    m_topLayout = createTopLayout(m_conformant);
+    evas_object_show(m_topLayout);
+    m_naviframe = createNaviframe(m_topLayout);
+    evas_object_show(m_naviframe);
+    m_mainLayout = createMainLayout(m_naviframe);
+    evas_object_show(m_mainLayout);
+    m_focus = createFocus(m_mainLayout);
+    evas_object_show(m_focus);
+    m_progressbar = createProgressBar(m_win, m_mainLayout);
+    evas_object_show(m_progressbar);
+
+    UG_INIT_EFL(m_win, UG_OPT_INDICATOR_ENABLE);
+    m_initialized = true;
+}
+
+void WindowData::postInit()
+{
+    AssertMsg(m_win != NULL, "m_win is null");
+    AssertMsg(m_initialized, "Not init");
+
+    // postInit should called after process permission is changed to app
+    if (UID_ROOT == getuid()) {
+        Assert(!"Cannot do with root permission");
+    }
+    elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_SHOW);
+}
+
+#if USE(EA_SCREEN_READER)
+bool WindowData::initScreenReaderSupport(bool isSupportAccessibility)
+{
+    WrtLogD("called");
+    AssertMsg(m_win != NULL, "x window is Null");
+    return ea_screen_reader_support_set(
+               m_win,
+               isSupportAccessibility ? EINA_TRUE : EINA_FALSE);
+}
+#endif
+
+Evas_Object* WindowData::getEvasObject(Layer layer)
+{
+    EvasObjectDataIt it = m_evasObjectData.find(layer);
+    if (it == m_evasObjectData.end()) {
+        return NULL;
+    }
+    return it->second;
+}
+
+void WindowData::setWebview(Evas_Object* webview)
+{
+    elm_object_part_content_set(m_focus, "elm.swallow.content", webview);
+    elm_object_focus_set(m_focus, EINA_TRUE);
+}
+
+void WindowData::unsetWebview()
+{
+    elm_object_part_content_unset(m_focus, "elm.swallow.content");
+}
+
+void WindowData::smartCallbackAdd(
+    Layer layer,
+    const char* event,
+    Evas_Smart_Cb callback,
+    const void* data)
+{
+    Evas_Object* obj = getEvasObject(layer);
+    if (!obj) {
+        WrtLogE("Fail to get Evas_Object");
+        return;
+    }
+    evas_object_smart_callback_add(obj, event, callback, data);
+    return;
+}
+
+void WindowData::smartCallbackDel(
+    Layer layer,
+    const char* event,
+    Evas_Smart_Cb callback)
+{
+    Evas_Object* obj = getEvasObject(layer);
+    if (!obj) {
+        WrtLogE("Fail to get Evas_Object");
+        return;
+    }
+    evas_object_smart_callback_del(obj, event, callback);
+}
+
+void WindowData::signalEmit(Layer layer,
+                            const char* emission,
+                            const char* source)
+{
+    Evas_Object* obj = getEvasObject(layer);
+    if (!obj) {
+        WrtLogE("Fail to get Evas_Object");
+        return;
+    }
+    edje_object_signal_emit(elm_layout_edje_get(obj), emission, source);
+}
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+void WindowData::setAppId(const std::string& appId)
+{
+    Assert(m_win);
+    if (appId.empty()) {
+        WrtLogE("appId is empty");
+        return;
+    }
+    ecore_x_window_prop_string_set(elm_win_xwindow_get(m_win), ECORE_X_ATOM_UTF8_STRING, appId.c_str());
+}
+#endif
+
+void WindowData::setViewMode(bool fullscreen, bool backbutton)
+{
+    WrtLogD("fullscreen: %d", fullscreen);
+    WrtLogD("backbutton: %d", backbutton);
+
+    m_currentViewModeFullScreen = fullscreen;
+    toggleIndicator(fullscreen);
+}
+
+void WindowData::setOrientation(int angle)
+{
+    WrtLogD("setOrientation");
+    Assert(m_win);
+    elm_win_wm_rotation_preferred_rotation_set(m_win, angle);
+}
+
+void WindowData::toggleFullscreen(bool fullscreen)
+{
+    toggleIndicator(fullscreen || m_currentViewModeFullScreen);
+}
+
+void WindowData::toggleTransparent(bool transparent)
+{
+    if (transparent) {
+        edje_object_signal_emit(elm_layout_edje_get(m_mainLayout),
+                                "show,transparent,signal",
+                                "");
+        evas_object_render_op_set(m_bg, EVAS_RENDER_COPY);
+    } else {
+        edje_object_signal_emit(elm_layout_edje_get(m_mainLayout),
+                                "hide,transparent,signal",
+                                "");
+        evas_object_render_op_set(m_bg, EVAS_RENDER_BLEND);
+    }
+}
+
+void WindowData::updateProgress(double value)
+{
+    elm_progressbar_value_set(m_progressbar, ELM_SCALE_SIZE(value));
+}
+
+void WindowData::setEvasObjectData(Layer layer, Evas_Object* obj)
+{
+    m_evasObjectData[layer] = obj;
+}
+
+Evas_Object* WindowData::createWindow(unsigned long pid)
+{
+#if USE(WEBKIT_HW_BACKEND)
+    elm_config_preferred_engine_set("opengl_x11");
+#else // WEBKIT_HW_BACKEND
+    elm_config_preferred_engine_set("software_x11");
+#endif // WEBKIT_HW_BACKEND
+    ADD_PROFILING_POINT("elm_win_add", "start");
+    Evas_Object* window = elm_win_add(NULL, "wrt-widget", ELM_WIN_BASIC);
+    ADD_PROFILING_POINT("elm_win_add", "stop");
+    ecore_x_window_prop_property_set(
+        elm_win_xwindow_get(window),
+        ECORE_X_ATOM_NET_WM_PID,
+        ECORE_X_ATOM_CARDINAL, 32, &pid, 1);
+    elm_win_conformant_set(window, EINA_TRUE);
+    int w, h;
+    ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+    evas_object_resize(window, w, h);
+    elm_win_autodel_set(window, EINA_TRUE);
+    evas_object_smart_callback_add(window,
+                                   DELETE_REQUEST,
+                                   winDeleteRequestCallback,
+                                   this);
+    evas_object_smart_callback_add(window,
+                                   PROFILE_CHANGED,
+                                   winProfileChangedCallback,
+                                   this);
+    setEvasObjectData(Layer::WINDOW, window);
+    return window;
+}
+
+Evas_Object* WindowData::createBg(Evas_Object* parent)
+{
+    AssertMsg(parent != NULL, "Parent is null");
+    Evas_Object* obj = evas_object_rectangle_add(evas_object_evas_get(parent));
+    evas_object_color_set(obj, 0, 0, 0, 0);
+    evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    elm_win_resize_object_add(parent, obj);
+    evas_object_render_op_set(obj, EVAS_RENDER_BLEND);
+    setEvasObjectData(Layer::BG, obj);
+    return obj;
+}
+
+Evas_Object* WindowData::createConformant(Evas_Object* parent)
+{
+    AssertMsg(parent != NULL, "Parent is null");
+    Evas_Object* obj = elm_conformant_add(parent);
+    evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    elm_win_resize_object_add(parent, obj);
+    setEvasObjectData(Layer::CONFORMANT, obj);
+    return obj;
+}
+
+Evas_Object* WindowData::createConformantBg(Evas_Object* parent)
+{
+    AssertMsg(parent != NULL, "Parent is null");
+    Evas_Object *obj = elm_bg_add(parent);
+    elm_object_style_set(obj, "indicator/headerbg");
+    elm_object_part_content_set(parent, "elm.swallow.indicator_bg", obj);
+    evas_object_show(obj);
+    return obj;
+}
+
+Evas_Object* WindowData::createTopLayout(Evas_Object* parent)
+{
+    AssertMsg(parent != NULL, "Parent is null");
+    Evas_Object* obj = elm_layout_add(parent);
+    elm_layout_theme_set(obj, "layout", "application", "default");
+    evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    elm_object_content_set(parent, obj);
+    setEvasObjectData(Layer::TOP_LAYOUT, obj);
+    return obj;
+}
+
+Evas_Object* WindowData::createNaviframe(Evas_Object* parent)
+{
+    AssertMsg(parent != NULL, "Parent is null");
+    Evas_Object* obj = elm_naviframe_add(parent);
+    evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    elm_object_part_content_set(parent, "elm.swallow.content", obj);
+    setEvasObjectData(Layer::NAVIFRAME, obj);
+    return obj;
+}
+
+Evas_Object* WindowData::createMainLayout(Evas_Object* parent)
+{
+    AssertMsg(parent != NULL, "Parent is null");
+    Evas_Object* obj = elm_layout_add(parent);
+    elm_layout_file_set(obj, WRT_EDJ_PATH, "web-application");
+    evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    ADD_PROFILING_POINT("elm_naviframe_item_push", "start");
+    Elm_Object_Item* naviIt =
+        elm_naviframe_item_push(
+            parent,         // Evas_Object* obj
+            NULL,           // const char* title_label
+            NULL,           // Evas_Object* prev_btn
+            NULL,           // Evas_Object* next_btn
+            obj,            // Evas_Object* content
+            "empty/transparent"); // const char* item_style
+    ADD_PROFILING_POINT("elm_naviframe_item_push", "stop");
+    elm_naviframe_item_pop_cb_set(naviIt, naviframeItemPopCallback, NULL);
+    setEvasObjectData(Layer::MAIN_LAYOUT, obj);
+    return obj;
+}
+
+Evas_Object* WindowData::createFocus(Evas_Object* parent)
+{
+    AssertMsg(parent != NULL, "Parent is null");
+    // ewkview isn't elementary widget style. This is reason why ewkview focus
+    // doesn't restore after focus-out and focus-in. To support focus restore
+    // for ewkview, WRT add selectable elementary(button) to manage focus
+    Evas_Object* obj = elm_button_add(parent);
+    elm_object_style_set(obj, "transparent");
+    elm_object_part_content_set(parent, "elm.swallow.content", obj);
+    evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+#if USE(EA_SCREEN_READER)
+    elm_access_object_unregister(obj);
+#endif
+    setEvasObjectData(Layer::FOCUS, obj);
+    return obj;
+}
+
+Evas_Object* WindowData::createProgressBar(Evas_Object* window, Evas_Object* parent)
+{
+    AssertMsg(parent != NULL, "Parent is null");
+    Evas_Object *obj = elm_progressbar_add(parent);
+    elm_object_style_set(obj, "custom");
+    elm_progressbar_horizontal_set(obj, EINA_TRUE);
+    evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+    evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+    elm_progressbar_value_set(obj, 0.0);
+
+    evas_object_size_hint_min_set(obj, -1, ELM_SCALE_SIZE(1));
+    elm_object_part_content_set(parent, "elm.swallow.progress", obj);
+    setEvasObjectData(Layer::PROGRESSBAR, obj);
+    return obj;
+}
+
+void WindowData::toggleIndicator(bool fullscreen)
+{
+    WrtLogD("fullscreen=%s", (fullscreen ? "true" : "false"));
+
+    if (!fullscreen) {
+        elm_win_indicator_opacity_set(m_win, ELM_WIN_INDICATOR_OPAQUE);
+    } else {
+        elm_win_indicator_opacity_set(m_win, ELM_WIN_INDICATOR_TRANSPARENT);
+    }
+}
+
+void WindowData::winDeleteRequestCallback(void* data,
+                                          Evas_Object* /*obj*/,
+                                          void* /*eventInfo*/)
+{
+    DPL_UNUSED_PARAM(data);
+    WrtLogD("call");
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    WindowData* This = (WindowData*)data;
+    char* appId = ecore_x_window_prop_string_get(elm_win_xwindow_get(This->m_win), ECORE_X_ATOM_UTF8_STRING);
+    if (appId) {
+        WebInternalEventSingleton::Instance().sendEvent(WebInternalEventSingleton::Instance().WEB_APP_TERMINATE,
+                                                        appId);
+    }
+#else
+    elm_exit();
+#endif
+}
+
+void WindowData::winProfileChangedCallback(void *data,
+                                           Evas_Object* /*obj*/,
+                                           void* /*eventInfo*/)
+{
+    WrtLogD("winProfileChangedCallback");
+    if (data == NULL) {
+        return;
+    }
+    WindowData* This = static_cast<WindowData *>(data);
+    const char* profile = elm_config_profile_get();
+
+    if (DESKTOP_PROFILE == profile) {
+        elm_win_indicator_mode_set(This->m_win, ELM_WIN_INDICATOR_HIDE);
+        // set desktop icon
+        Evas_Object* icon =
+            evas_object_image_add(evas_object_evas_get(This->m_win));
+        evas_object_image_file_set(icon, DESKTOP_ICON_PATH, NULL);
+        elm_win_icon_object_set(This->m_win, icon);
+    }
+}
+
+Eina_Bool WindowData::naviframeItemPopCallback(void* /*data*/,
+                                            Elm_Object_Item* /*it*/)
+{
+    WrtLogD("naviframeItemPopCallback");
+    // This return value makes naviframe not to perform a pop operation
+    // about this item.
+    return EINA_FALSE;
+}
+
diff --git a/src/wrt-client/window_data.h b/src/wrt-client/window_data.h
new file mode 100644 (file)
index 0000000..287bfb1
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        window_data.h
+ * @author      Jaroslaw Osmanski (j.osmanski@samsung.com)
+ * @version     1.0
+ * @brief       Window data header file.
+ */
+
+#ifndef WINDOW_INITIALIZE_H_
+#define WINDOW_INITIALIZE_H_
+
+#include <functional>
+#include <map>
+#include <memory>
+#include <string>
+
+#include <dpl/platform.h>
+#include <dpl/framework_efl.h>
+#include <dpl/noncopyable.h>
+
+enum class Layer {
+    WINDOW      = 0,
+    BG          = 1,
+    CONFORMANT  = 2,
+    TOP_LAYOUT  = 3,
+    NAVIFRAME   = 4,
+    MAIN_LAYOUT = 5,
+    FOCUS       = 6,
+    PROGRESSBAR = 7
+};
+
+class WindowData : private DPL::Noncopyable
+{
+  public:
+    explicit WindowData(unsigned long pid, bool manualInit = false);
+    virtual ~WindowData();
+
+    void init();
+    void postInit();
+#if USE(EA_SCREEN_READER)
+    bool initScreenReaderSupport(bool isSupportAccessibility);
+#endif
+
+    Evas_Object* getEvasObject(Layer layer);
+    void setWebview(Evas_Object* evas_object);
+    void unsetWebview();
+
+    void smartCallbackAdd(
+        Layer layer,
+        const char* event,
+        Evas_Smart_Cb callback,
+        const void* data);
+    void smartCallbackDel(
+        Layer layer,
+        const char* event,
+        Evas_Smart_Cb callback);
+    void signalEmit(Layer layer, const char* emission, const char* source);
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    void setAppId(const std::string& appId);
+#endif
+    void setViewMode(bool fullscreen, bool backbutton);
+    void setOrientation(int angle);
+    void toggleFullscreen(bool fullscreen);
+    void toggleTransparent(bool transparent);
+    void updateProgress(double value);
+
+  private:
+    Evas_Object* m_win;
+    Evas_Object* m_bg;
+    Evas_Object* m_conformant;
+    Evas_Object* m_conformantBg;
+    Evas_Object* m_topLayout;
+    Evas_Object* m_naviframe;
+    Evas_Object* m_mainLayout;
+    Evas_Object* m_focus;
+    Evas_Object* m_progressbar;
+    bool m_initialized;
+    bool m_currentViewModeFullScreen;
+
+    typedef std::map<Layer, Evas_Object*> EvasObjectData;
+    typedef std::map<Layer, Evas_Object*>::iterator EvasObjectDataIt;
+    EvasObjectData m_evasObjectData;
+    void setEvasObjectData(Layer layer, Evas_Object* obj);
+
+    Evas_Object* createWindow(unsigned long pid);
+    Evas_Object* createBg(Evas_Object* parent);
+    Evas_Object* createConformant(Evas_Object* parent);
+    Evas_Object* createConformantBg(Evas_Object* parent);
+    Evas_Object* createTopLayout(Evas_Object* parent);
+    Evas_Object* createNaviframe(Evas_Object* parent);
+    Evas_Object* createMainLayout(Evas_Object* parent);
+    Evas_Object* createFocus(Evas_Object* parent);
+    Evas_Object* createProgressBar(Evas_Object* window, Evas_Object* parent);
+
+    void toggleIndicator(bool fullscreen);
+    static void winDeleteRequestCallback(void* data,
+                                         Evas_Object* obj,
+                                         void* eventInfo);
+    static void winProfileChangedCallback(void* data,
+                                          Evas_Object* obj,
+                                          void* eventInfo);
+    static Eina_Bool naviframeItemPopCallback(void *data,
+                                          Elm_Object_Item *it);
+
+ };
+
+typedef std::shared_ptr<WindowData> WindowDataPtr;
+
+#endif /* WINDOW_INITIALIZE_H_ */
diff --git a/src/wrt-client/wrt-client-lite.cpp b/src/wrt-client/wrt-client-lite.cpp
new file mode 100644 (file)
index 0000000..db5de74
--- /dev/null
@@ -0,0 +1,928 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include "wrt-client-lite.h"
+
+#include <string>
+
+#include <app_control.h>
+#include <dpl/availability.h>
+#include <dpl/bind.h>
+#include <dpl/localization/w3c_file_localization.h>
+#include <dpl/localization/LanguageTagsProvider.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/optional_typedefs.h>
+#include <dpl/platform.h>
+#include <efl_assist.h>
+#include <Elementary.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <vconf.h>
+
+#include <application_data.h>
+#include <core_module.h>
+#include <localization_setting.h>
+#include <security_support.h>
+#include <user_delegates.h>
+#include <message_support.h>
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+#include <web_internal_eventloop.h>
+#include <dpl/wrt-dao-ro/global_config.h>
+#endif
+
+#include "client_command_line_parser.h"
+#include "client_ide_support.h"
+#include "client_orientation_support.h"
+
+#define POOL_PROCESS_TIMER 2
+//W3C PACKAGING enviroment variable name
+#define W3C_DEBUG_ENV_VARIABLE "DEBUG_LOAD_FINISH"
+
+//Tizen Extensible API String
+const char* const EXTENSIBLE_API_PRERENDERING_FOR_ROTATION = "prerendering,for,rotation";
+const char* const EXTENSIBLE_API_MEDIA_VOLUME_CONTROL = "media,volume,control";
+
+// window signal callback
+const char* const EDJE_SHOW_PROGRESS_SIGNAL = "show,progress,signal";
+const char* const EDJE_HIDE_PROGRESS_SIGNAL = "hide,progress,signal";
+const std::string VIEWMODE_TYPE_FULLSCREEN = "fullscreen";
+const std::string VIEWMODE_TYPE_MAXIMIZED = "maximized";
+const std::string VIEWMODE_TYPE_WINDOWED = "windowed";
+const char* const ELM_SWALLOW_CONTENT = "elm.swallow.content";
+const char* const BUNDLE_PATH = "/usr/lib/libwrt-injected-bundle.so";
+
+// env
+const char* const WRT_CONSOLE_LOG_ENABLE = "WRT_CONSOLE_LOG_ENABLE";
+
+WrtClientLite::WrtClientLite(const std::string& appId, Ewk_Context* context, WindowData* winData) :
+    m_tizenId(appId),
+    m_debugMode(false),
+    m_widgetState(WidgetState_Stopped),
+    m_initialViewMode(VIEWMODE_TYPE_MAXIMIZED),
+    m_currentViewMode(VIEWMODE_TYPE_MAXIMIZED),
+#if USE(WEBKIT_MANUAL_ROTATION)
+    m_isWebkitHandleManualRotationDone(false),
+#endif
+    m_isWebkitFullscreen(false),
+    m_savedContext(context),
+    m_savedWindowData(winData),
+    m_didCreatePool(false),
+    m_processPoolTimer(NULL)
+{
+    if (m_savedContext) {
+        WrtLogD("init injected bundle");
+        std::string msg = "1 " + m_tizenId; // 1 specifies argument count
+        ewk_context_message_post_to_injected_bundle(
+                        m_savedContext,
+                        Message::ToInjectedBundle::INIT,
+                        msg.c_str());
+    }
+}
+
+WrtClientLite::~WrtClientLite()
+{
+}
+
+bool WrtClientLite::OnCreate(bundle *b)
+{
+    WrtLogD("create");
+
+    ApplicationDataSingleton::Instance().setBundleData(m_tizenId, b);
+    m_widget = WRT::CoreModuleSingleton::Instance().getRunnableWidgetObject(m_tizenId);
+    if (!m_widget) {
+        WrtLogE("RunnableWidgetObject is NULL");
+        return false;
+    }
+
+    m_dao.reset(new WrtDB::WidgetDAOReadOnly(DPL::FromASCIIString(m_tizenId)));
+    WrtDB::WidgetSettings widgetSettings;
+    m_dao->getWidgetSettings(widgetSettings);
+    m_settingList.reset(new WidgetSettingList(widgetSettings));
+
+    DPL::OptionalString defloc = m_dao->getDefaultlocale();
+    if (!!defloc) {
+        LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(*defloc);
+    }
+
+    setInitialViewMode();
+
+    /* remove language change callback */
+    /*
+    LocalizationSetting::SetLanguageChangedCallback(
+            languageChangedCallback, this);
+    */
+
+    if (m_savedWindowData) {
+        m_windowData.reset(m_savedWindowData);
+    } else {
+        m_windowData.reset(new WindowData(static_cast<unsigned long>(getpid()), true));
+    }
+#if USE(EA_SCREEN_READER)
+    if (!m_windowData->initScreenReaderSupport(
+            m_settingList->getAccessibility() == Accessibility_Enable))
+    {
+        WrtLogW("Fail to set screen reader support set");
+    }
+#endif
+
+    // rotate window to initial value
+    initWindowOrientation();
+
+    WRT::UserDelegatesPtr cbs(new WRT::UserDelegates);
+
+    DPL::OptionalString startUrl = W3CFileLocalization::getStartFile(m_dao);
+#if USE(WEB_PROVIDER_EXCEPTION_IN_EWK_CONTEXT)
+    // TODO: need api to get Ewk_Context
+    //ewk_context_tizen_extensible_api_string_set(s_preparedEwkContext, EXTENSIBLE_API_MEDIA_VOLUME_CONTROL, EINA_TRUE);
+#endif
+    if (!m_widget->PrepareView(DPL::ToUTF8String(*startUrl), m_windowData->getEvasObject(Layer::WINDOW), m_savedContext)) {
+        return false;
+    }
+    // send rotate information to ewk
+    m_orientationSupport->setEwkInitialOrientation(m_settingList->getRotationValue());
+
+    //you can't show window with splash screen before PrepareView
+    //ewk_view_add_with_context() in viewLogic breaks window
+    m_windowData->init();
+    m_windowData->postInit();
+    m_windowData->setAppId(m_tizenId);
+    m_windowData->smartCallbackAdd(Layer::FOCUS, "focused", focusedCallback, this);
+    m_windowData->smartCallbackAdd(Layer::FOCUS, "unfocused", unfocusedCallback, this);
+
+    WrtDB::WidgetLocalizedInfo localizedInfo =
+        W3CFileLocalization::getLocalizedInfo(m_dao);
+    std::string name = "";
+    if (!!localizedInfo.name) {
+        name = DPL::ToUTF8String(*(localizedInfo.name));
+    }
+    elm_win_title_set(m_windowData->getEvasObject(Layer::WINDOW),
+                      name.c_str());
+
+    // window show
+    evas_object_show(m_windowData->getEvasObject(Layer::WINDOW));
+
+    initializeWindowModes();
+
+    cbs->loadProgressStartedCallback = DPL::Bind(&WrtClientLite::loadProgressStartedCallback, this);
+    cbs->loadProgressCallback = DPL::Bind(&WrtClientLite::loadProgressCallback, this);
+    cbs->loadProgressFinishedCallback = DPL::Bind(&WrtClientLite::loadProgressFinishedCallback, this);
+    cbs->loadStartedCallback = DPL::Bind(&WrtClientLite::loadStartedCallback, this);
+    cbs->loadFinishedCallback = DPL::Bind(&WrtClientLite::loadFinishedCallback, this);
+    cbs->setWebviewCallback = DPL::Bind(&WrtClientLite::setLayout, this);
+    cbs->unsetWebviewCallback = DPL::Bind(&WrtClientLite::unsetLayout, this);
+    cbs->processExitCallback = DPL::Bind(&WrtClientLite::processExitCallback, this);
+    cbs->webProcessCrashedCallback = DPL::Bind(&WrtClientLite::webProcessCrashedCallback, this);
+    cbs->processCrashedCallback = DPL::Bind(&WrtClientLite::processCrashedCallback, this);
+    cbs->enterFullscreenCallback = DPL::Bind(&WrtClientLite::enterFullscreenCallback, this);
+    cbs->exitFullscreenCallback = DPL::Bind(&WrtClientLite::exitFullscreenCallback, this);
+    cbs->orientationLockCallback = DPL::Bind(&WrtClientLite::setWindowOrientation, this);
+    cbs->keyCallback = DPL::Bind(&WrtClientLite::keyCallback, this);
+    cbs->consoleMessageCallback = DPL::Bind(&WrtClientLite::consoleMessageCallback, this);
+    cbs->rotatePreparedCallback = DPL::Bind(&WrtClientLite::rotatePreparedCallback, this);
+    cbs->enableVideoHwOverlayCallback = DPL::Bind(&WrtClientLite::enableVideoHwOverlayCallback, this);
+    cbs->disableVideoHwOverlayCallback = DPL::Bind(&WrtClientLite::disableVideoHwOverlayCallback, this);
+    cbs->popupReplyWaitStartCallback = DPL::Bind(&WrtClientLite::popupReplyWaitStartCallback, this);
+    cbs->popupReplyWaitFinishCallback = DPL::Bind(&WrtClientLite::popupReplyWaitFinishCallback, this);
+    cbs->frameRenderedCallback = DPL::Bind(&WrtClientLite::frameRenderedCallback, this);
+    cbs->blockedUrlPolicyCallback = DPL::Bind(&WrtClientLite::blockedUrlPolicyCallback, this);
+    cbs->isCreateNewWindowAllowedCallback = DPL::Bind(&WrtClientLite::isCreateNewWindowAllowedCallback, this);
+    cbs->createContextMenuCallback = DPL::Bind(&WrtClientLite::createContextMenuCallback, this);
+
+    m_widget->SetUserDelegates(cbs);
+
+    vconf_notify_key_changed(VCONFKEY_SYSMAN_LOW_MEMORY, WrtClientLite::appcoreLowMemoryCallback, this);
+
+    // TODO: Need to check how to gurantee width & height of screen
+    //if (!m_orientationSupport->isOrientationPrepared(m_settingList->getRotationValue())) {
+    //    m_orientationSupport->registerRotationCallback(initialOrientationCheckCallback, this);
+    //}
+
+    // As AUL registration is done is WebProcess so the reset event is reaching WLD with delay.
+    // Due to this window is shown but there is delay in screen paint. So add show in create
+    // and change only the state when reset event is called
+    m_widget->Show();
+    m_widgetState = WidgetState_Created;
+
+    return true;
+}
+
+void WrtClientLite::OnResume()
+{
+    WrtLogD("resume");
+
+    if (m_widgetState != WidgetState_Suspended) {
+        WrtLogW("Widget is not suspended, resuming was skipped");
+        return;
+    }
+    m_widget->Resume();
+    m_widgetState = WidgetState_Running;
+}
+
+void WrtClientLite::OnSuspend()
+{
+    WrtLogD("pause");
+
+    if (m_widgetState != WidgetState_Running) {
+        WrtLogW("Widget is not running to be suspended");
+        return;
+    }
+    m_widget->Suspend();
+    m_widgetState = WidgetState_Suspended;
+}
+
+void WrtClientLite::OnReset(bundle *b)
+{
+    WrtLogD("OnReset");
+
+    setDebugMode(b);
+
+    if (m_widgetState == WidgetState_Created) {
+        m_widgetState = WidgetState_Running;
+    } else if (m_widgetState == WidgetState_Running || m_widgetState == WidgetState_Suspended) {
+        ApplicationDataSingleton::Instance().setBundleData(m_tizenId, b);
+        m_widget->Reset();
+        m_orientationSupport->resetOrientation();
+        m_widgetState = WidgetState_Running;
+    } else {
+        WrtLogW("Unexpected life-cycle");
+    }
+}
+
+void WrtClientLite::OnTerminate()
+{
+    WrtLogD("Wrt Shutdown now");
+    vconf_ignore_key_changed(VCONFKEY_SYSMAN_LOW_MEMORY,
+                             WrtClientLite::appcoreLowMemoryCallback);
+    if (m_processPoolTimer) {
+        ecore_timer_del(m_processPoolTimer);
+    }
+
+    if (m_widgetState == WidgetState_Stopped) {
+        WrtLogW("Not yet started");
+        return;
+    }
+
+    m_widgetState = WidgetState_Stopped;
+    // (un)focusCallback MUST be detached before hiding widget starts
+    m_windowData->smartCallbackDel(Layer::FOCUS, "focused", focusedCallback);
+    m_windowData->smartCallbackDel(Layer::FOCUS, "unfocused", unfocusedCallback);
+    m_widget->Hide();
+    // AutoRotation use m_widget pointer internally.
+    // It must be unset before m_widget is released.
+    deinitWindowOrientation();
+    m_widget.reset();
+    m_windowData.reset();
+}
+
+void WrtClientLite::OnResetAulConnection()
+{
+   WrtLogD("reset aul connection");
+   m_widget->ResetAulConnection();
+}
+
+void WrtClientLite::setDebugMode(bundle* b)
+{
+    m_debugMode = ClientModule::IDESupport::getDebugMode(b);
+    WrtLogD("debug mode : %s", m_debugMode ? "ture" : "false");
+}
+
+void WrtClientLite::loadStartedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if USE(WEBKIT_SHOW_PROGRESS_BAR_EARLIER)
+    if (m_settingList->getProgressBarPresence() == ProgressBar_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        m_windowData->signalEmit(Layer::MAIN_LAYOUT,
+                                 EDJE_SHOW_PROGRESS_SIGNAL,
+                                 "");
+        m_windowData->updateProgress(0);
+    }
+#endif
+}
+
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+std::string WrtClientLite::createInitMessage(bundle* b, unsigned int portNum)
+{
+    DPL::OptionalString installedPath = m_dao->getWidgetInstalledPath();
+    std::string appPath;
+    std::string tzPkgId = DPL::ToUTF8String(m_dao->getTizenPkgId());
+    if (!installedPath) {
+        appPath = std::string(WrtDB::GlobalConfig::GetUserInstalledWidgetPath()) + "/" +
+            tzPkgId + WrtDB::GlobalConfig::GetUserWidgetExecPath() + "/" + m_tizenId;
+    } else {
+        appPath = DPL::ToUTF8String(*installedPath) +
+            WrtDB::GlobalConfig::GetUserWidgetExecPath() + "/" + m_tizenId;
+    }
+
+    if (!b) {
+        return std::string();
+    }
+    char **argv;
+    int argc = bundle_export_to_argv(b, &argv);
+
+    std::stringstream ssMsg;
+    ssMsg << portNum; // Add port number
+    ssMsg << " " << argc; // count for argv
+    ssMsg << " " << appPath; // argv[0]
+
+    for (int ittr = 1; ittr < argc; ++ittr) {
+        ssMsg << " " << argv[ittr];
+    }
+    return ssMsg.str();
+}
+#endif
+
+void WrtClientLite::loadFinishedCallback(Evas_Object* obj, void* eventInfo)
+{
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    WrtLogD("Post result of launch");
+
+    //w3c packaging test debug (message on 4>)
+    const char * makeScreen = getenv(W3C_DEBUG_ENV_VARIABLE);
+    if (makeScreen != NULL && strcmp(makeScreen, "1") == 0) {
+        FILE* doutput = fdopen(4, "w");
+        fprintf(doutput, "didFinishLoadForFrameCallback: ready\n");
+        fclose(doutput);
+    }
+
+    WrtLogD("Launch succesfull");
+
+    setlinebuf(stdout);
+    printf("launched\n");
+    fflush(stdout);
+
+    if (m_debugMode) {
+        Ewk_Context* ewkContext = ewk_view_context_get(obj);
+        Assert(ewkContext);
+        unsigned int portNum =
+            ewk_context_inspector_server_start(ewkContext, 0);
+        WrtLogD("Port for inspector : %u", portNum);
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+        m_widget->SendIDEReply(createInitMessage(ApplicationDataSingleton::Instance().getBundle(m_tizenId), portNum));
+#else
+        bool ret = ClientModule::IDESupport::sendReply(
+                       ApplicationDataSingleton::Instance().getBundle(m_tizenId),
+                       portNum);
+        if (!ret) {
+            WrtLogW("Fail to send reply");
+        }
+#endif
+    }
+    ApplicationDataSingleton::Instance().freeBundleData(m_tizenId);
+    if (!m_didCreatePool) {
+        if (m_processPoolTimer) {
+            ecore_timer_del(m_processPoolTimer);
+        }
+        m_processPoolTimer = ecore_timer_add(POOL_PROCESS_TIMER, sendRequestForPoolProcess, this);
+    }
+}
+
+void WrtClientLite::loadProgressStartedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if !USE(WEBKIT_SHOW_PROGRESS_BAR_EARLIER)
+    if (m_settingList->getProgressBarPresence() == ProgressBar_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        m_windowData->signalEmit(Layer::MAIN_LAYOUT,
+                                 EDJE_SHOW_PROGRESS_SIGNAL,
+                                 "");
+        m_windowData->updateProgress(0);
+    }
+#endif
+}
+
+void WrtClientLite::loadProgressCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+
+    if (m_settingList->getProgressBarPresence() == ProgressBar_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        Assert(eventInfo);
+        double* progress = static_cast<double*>(eventInfo);
+        m_windowData->updateProgress(*progress);
+    }
+}
+
+void WrtClientLite::loadProgressFinishedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    if (m_settingList->getProgressBarPresence() == ProgressBar_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        m_windowData->signalEmit(Layer::MAIN_LAYOUT,
+                                 EDJE_HIDE_PROGRESS_SIGNAL,
+                                 "");
+    }
+}
+
+void WrtClientLite::processExitCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("process exit");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    char *appId = strdup(m_tizenId.c_str());
+    WebInternalEventSingleton::Instance().sendEvent(WebInternalEventSingleton::Instance().WEB_APP_TERMINATE, appId);
+    m_widgetState = WidgetState_Stopping;
+}
+
+void WrtClientLite::webProcessCrashedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogE("webProcess crashed");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    char *appId = strdup(m_tizenId.c_str());
+    WebInternalEventSingleton::Instance().sendEvent(WebInternalEventSingleton::Instance().WEB_APP_TERMINATE, appId);
+    m_widgetState = WidgetState_Stopping;
+}
+
+void WrtClientLite::processCrashedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogE("Process crashed");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+}
+
+void WrtClientLite::enterFullscreenCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    // enter fullscreen
+    m_windowData->toggleFullscreen(true);
+    m_currentViewMode = VIEWMODE_TYPE_FULLSCREEN;
+    m_isWebkitFullscreen = true;
+}
+
+void WrtClientLite::exitFullscreenCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    // exit fullscreen
+    m_windowData->toggleFullscreen(false);
+    m_currentViewMode = m_initialViewMode;
+    m_isWebkitFullscreen = false;
+}
+
+void WrtClientLite::enableVideoHwOverlayCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    ewk_view_draws_transparent_background_set(obj, EINA_TRUE);
+    m_windowData->toggleTransparent(true);
+}
+
+void WrtClientLite::disableVideoHwOverlayCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    m_windowData->toggleTransparent(false);
+    ewk_view_draws_transparent_background_set(obj, EINA_FALSE);
+}
+
+void WrtClientLite::popupReplyWaitStartCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    char *appId = strdup(m_tizenId.c_str());
+    WebInternalEventSingleton::Instance().sendEvent(WebInternalEventSingleton::Instance().POPUP_REPLY_WAIT_START, appId);
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+    m_orientationSupport->setManualRotation(false);
+    Ewk_Context* ewkContext = ewk_view_context_get(obj);
+    Assert(ewkContext);
+    ewk_context_tizen_extensible_api_string_set(ewkContext, EXTENSIBLE_API_PRERENDERING_FOR_ROTATION, EINA_FALSE);
+#endif
+}
+
+void WrtClientLite::popupReplyWaitFinishCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    char *appId = strdup(m_tizenId.c_str());
+    WebInternalEventSingleton::Instance().sendEvent(WebInternalEventSingleton::Instance().POPUP_REPLY_WAIT_FINISH, appId);
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+    m_orientationSupport->setManualRotation(true);
+    Ewk_Context* ewkContext = ewk_view_context_get(obj);
+    Assert(ewkContext);
+    ewk_context_tizen_extensible_api_string_set(ewkContext, EXTENSIBLE_API_PRERENDERING_FOR_ROTATION, EINA_TRUE);
+#endif
+}
+
+void WrtClientLite::frameRenderedCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+    if (m_isWebkitHandleManualRotationDone == false) {
+        WrtLogD("start manual roatation");
+        m_orientationSupport->setManualRotation(true);
+        m_isWebkitHandleManualRotationDone = true;
+        Ewk_Context* ewkContext = ewk_view_context_get(obj);
+        Assert(ewkContext);
+        ewk_context_tizen_extensible_api_string_set(ewkContext, EXTENSIBLE_API_PRERENDERING_FOR_ROTATION, EINA_TRUE);
+    }
+#endif
+}
+
+void WrtClientLite::blockedUrlPolicyCallback (const std::string& blockedUrl)
+{
+     // block this page and open it in browser
+    WrtLogD("Request was blocked : %s", blockedUrl.c_str());
+
+    app_control_h app_control = NULL;
+    app_control_create(&app_control);
+    app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
+    app_control_set_uri(app_control, blockedUrl.c_str());
+
+    if(APP_CONTROL_ERROR_NONE != app_control_send_launch_request(app_control, NULL, NULL)) {
+        WrtLogE("Failed to run app_control");
+    }
+
+    app_control_destroy(app_control);
+    return;
+}
+
+bool WrtClientLite::isCreateNewWindowAllowedCallback (void)
+{
+    return true;
+}
+
+void WrtClientLite::createContextMenuCallback(void* eventInfo)
+{
+    WrtLogD("createContextMenuCallback");
+    Ewk_Context_Menu* menu = static_cast<Ewk_Context_Menu*>(eventInfo);
+    unsigned int menu_num = ewk_context_menu_item_count(menu);
+    unsigned int idx = 0;
+    do {
+        Ewk_Context_Menu_Item* item = ewk_context_menu_nth_item_get(menu, idx);
+        if (!item) {
+            idx++;
+            continue;
+        }
+        Ewk_Context_Menu_Item_Tag tag = ewk_context_menu_item_tag_get(item);
+
+        switch (tag) {
+        case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_FRAME_IN_NEW_WINDOW:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+#if USE(WEBKIT_UPVERSION)
+        case EWK_CONTEXT_MENU_ITEM_OPEN_MEDIA_IN_NEW_WINDOW:
+#else
+        case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_MEDIA_IN_NEW_WINDOW:
+#endif
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        case EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        case EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_IMAGE_TO_DISK:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        default:
+            idx++;
+            break;
+        }
+    } while (idx < menu_num);
+
+    return;
+}
+
+void WrtClientLite::initializeWindowModes()
+{
+    Assert(m_windowData);
+    bool backbutton =
+        (m_settingList->getBackButtonPresence() == BackButton_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED);
+    m_windowData->setViewMode(m_currentViewMode == VIEWMODE_TYPE_FULLSCREEN,
+                              backbutton);
+}
+
+void WrtClientLite::appcoreLowMemoryCallback(keynode_t* node, void* userData)
+{
+    WrtLogD("appcoreLowMemoryCallback");
+
+    Assert(userData);
+
+    char* key = vconf_keynode_get_name(node);
+    if (NULL == key) {
+        WrtLogE("key is null");
+        return;
+    }
+
+    WrtClientLite* This = static_cast<WrtClientLite*>(userData);
+    if (!strcmp(key, VCONFKEY_SYSMAN_LOW_MEMORY)) {
+        if (This->m_widget) {
+            This->m_widget->HandleLowMemory();
+        }
+    }
+}
+
+void WrtClientLite::setInitialViewMode(void)
+{
+    Assert(m_dao);
+    WrtDB::WindowModeList windowModes = m_dao->getWindowModes();
+    FOREACH(it, windowModes) {
+        std::string viewMode = DPL::ToUTF8String(*it);
+        switch(viewMode[0]) {
+            case 'f':
+                if (viewMode == VIEWMODE_TYPE_FULLSCREEN) {
+                    m_initialViewMode = viewMode;
+                    m_currentViewMode = m_initialViewMode;
+                    break;
+                }
+                break;
+            case 'm':
+                if (viewMode == VIEWMODE_TYPE_MAXIMIZED) {
+                    m_initialViewMode = viewMode;
+                    m_currentViewMode = m_initialViewMode;
+                    break;
+                }
+                break;
+            case 'w':
+                if (viewMode == VIEWMODE_TYPE_WINDOWED) {
+                    m_initialViewMode = viewMode;
+                    m_currentViewMode = m_initialViewMode;
+                    break;
+                }
+                break;
+            default:
+                break;
+        }
+    }
+}
+
+void WrtClientLite::initWindowOrientation(void)
+{
+    Assert(m_windowData);
+
+    m_orientationSupport.reset(
+            new ClientModule::OrientationSupport(m_windowData, m_widget));
+    m_orientationSupport->setInitialWindowOrientation(
+            m_settingList->getRotationValue());
+    if (!m_orientationSupport->setAutoRotation()) {
+        WrtLogE("Fail to set rotation callback");
+    }
+}
+
+void WrtClientLite::deinitWindowOrientation(void)
+{
+    Assert(m_orientationSupport);
+
+    m_orientationSupport->unregisterRotationCallbacks();
+    m_orientationSupport.reset();
+}
+
+void WrtClientLite::setWindowOrientation(int angle)
+{
+    Assert(m_windowData);
+    m_windowData->setOrientation(angle);
+}
+
+void WrtClientLite::keyCallback(Evas_Object* obj, void* eventInfo)
+{
+    Ea_Callback_Type keyType = static_cast<Ea_Callback_Type>(reinterpret_cast<int>(eventInfo));
+
+    // TODO: Remove keycallback when application moves to suspend
+    if (m_widgetState == WidgetState_Suspended) {
+        // Key event is faster than resume event
+        WrtLogW("Application is not ready to handle key");
+        return;
+    }
+    if (m_settingList->getBackButtonPresence() == BackButton_Enable
+        || m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        // windowed UX - hosted application
+        if (keyType == EA_CALLBACK_BACK) {
+            if (m_isWebkitFullscreen) {
+                ewk_view_fullscreen_exit(obj);
+            } else {
+                m_widget->Backward();
+            }
+        } else if (keyType == EA_CALLBACK_MORE) {
+            // UX isn't confirmed
+        }
+    }
+}
+
+void WrtClientLite::consoleMessageCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+
+    static bool logEnable = (getenv(WRT_CONSOLE_LOG_ENABLE) != NULL);
+
+    if (m_debugMode || logEnable) {
+        Assert(eventInfo);
+        Ewk_Console_Message* consoleMessage = static_cast<Ewk_Console_Message*>(eventInfo);
+
+        std::stringstream buf;
+        unsigned int lineNumber = ewk_console_message_line_get(consoleMessage);
+        const char* text = ewk_console_message_text_get(consoleMessage);
+        const char* source = ewk_console_message_source_get(consoleMessage);
+        if (lineNumber) {
+            buf << source << ":";
+            buf << lineNumber << ":";
+        }
+        buf << text;
+
+        ConsoleLogLevel level;
+        switch (ewk_console_message_level_get(consoleMessage)) {
+        case EWK_CONSOLE_MESSAGE_LEVEL_TIP:
+        case EWK_CONSOLE_MESSAGE_LEVEL_LOG:
+        case EWK_CONSOLE_MESSAGE_LEVEL_DEBUG:
+            level = ConsoleLogLevel::Debug;
+            break;
+        case EWK_CONSOLE_MESSAGE_LEVEL_WARNING:
+            level = ConsoleLogLevel::Warning;
+            break;
+        case EWK_CONSOLE_MESSAGE_LEVEL_ERROR:
+            level = ConsoleLogLevel::Error;
+            break;
+        default:
+            level = ConsoleLogLevel::Debug;
+            break;
+        }
+        ClientModule::IDESupport::consoleMessage(
+            level,
+            "%s",
+            buf.str().c_str());
+    }
+}
+
+void WrtClientLite::rotatePreparedCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+    WrtLogD("Rotate by webkit");
+    m_orientationSupport->setRotationDone();
+#endif
+}
+
+
+void WrtClientLite::setLayout(Evas_Object* webview)
+{
+    WrtLogD("add new webkit buffer to window");
+
+    Assert(webview);
+    m_windowData->setWebview(webview);
+
+    evas_object_show(webview);
+    evas_object_show(m_windowData->getEvasObject(Layer::WINDOW));
+}
+
+void WrtClientLite::unsetLayout(Evas_Object* webview)
+{
+    WrtLogD("remove current webkit buffer from window");
+    Assert(webview);
+    evas_object_hide(webview);
+    m_windowData->unsetWebview();
+}
+
+void WrtClientLite::autoRotationCallback(void* data,
+                                     Evas_Object* obj,
+                                     void* event)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(event);
+    //WrtLogD("entered");
+    //Assert(data);
+    //WrtClientLite* This = static_cast<WrtClientLite*>(data);
+    // TODO - To be implemented when splash screen is added
+}
+
+void WrtClientLite::initialOrientationCheckCallback(void* data, Evas_Object* obj, void* event)
+{
+    WrtLogD("entered");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(event);
+
+    Assert(data);
+    WrtClientLite* This = static_cast<WrtClientLite*>(data);
+    if (This->m_orientationSupport->isOrientationPrepared(This->m_settingList->getRotationValue())) {
+        WrtLogD("initial orientation is ready");
+        This->m_orientationSupport->unregisterRotationCallback(initialOrientationCheckCallback);
+    }
+}
+
+void WrtClientLite::focusedCallback(void* data,
+                                Evas_Object* /*obj*/,
+                                void* /*eventInfo*/)
+{
+    WrtLogD("entered");
+    Assert(data);
+    WrtClientLite* This = static_cast<WrtClientLite*>(data);
+    elm_object_focus_set(This->m_widget->GetCurrentWebview(), EINA_TRUE);
+}
+
+void WrtClientLite::unfocusedCallback(void* data,
+                                Evas_Object* /*obj*/,
+                                void* /*eventInfo*/)
+{
+    WrtLogD("entered");
+    Assert(data);
+    WrtClientLite* This = static_cast<WrtClientLite*>(data);
+    elm_object_focus_set(This->m_widget->GetCurrentWebview(), EINA_FALSE);
+}
+
+int WrtClientLite::languageChangedCallback(void *data)
+{
+    WrtLogD("Language Changed");
+    if (!data) {
+        return 0;
+    }
+    WrtClientLite* wrtClient = static_cast<WrtClientLite*>(data);
+    if (!(wrtClient->m_dao)) {
+        return 0;
+    }
+
+    // reset function fetches system locales and recreates language tags
+    LanguageTagsProviderSingleton::Instance().resetLanguageTags();
+    // widget default locales are added to language tags below
+    DPL::OptionalString defloc = wrtClient->m_dao->getDefaultlocale();
+    if (!!defloc) {
+        LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(
+            *defloc);
+    }
+
+    if (wrtClient->m_widgetState != WidgetState_Stopped) {
+        wrtClient->m_widget->ReloadStartPage();
+    }
+    return 0;
+}
+
+Eina_Bool WrtClientLite::sendRequestForPoolProcess(void* data)
+{
+    Assert(data);
+    WrtClientLite *This = static_cast<WrtClientLite*>(data);
+    char *appId = strdup(This->m_tizenId.c_str());
+    WebInternalEventSingleton::Instance().sendEvent(WebInternalEvent::WEB_APP_START_POOL_PROCESS, appId);
+    This->m_didCreatePool = true;
+    This->m_processPoolTimer = NULL;
+
+    return ECORE_CALLBACK_CANCEL;
+}
diff --git a/src/wrt-client/wrt-client-lite.h b/src/wrt-client/wrt-client-lite.h
new file mode 100644 (file)
index 0000000..b92d349
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+#ifndef WRT_CLIENT_LITE_H_
+#define WRT_CLIENT_LITE_H_
+
+#include <memory>
+#include <string>
+
+#include <bundle.h>
+
+#include <dpl/platform.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include <Elementary.h>
+#include <Evas.h>
+#include <i_runnable_widget_object.h>
+#include <widget_data_types.h>
+#include <vconf.h>
+
+#include "widget_state.h"
+#include "window_data.h"
+
+namespace ClientModule {
+class SubmodeSupport;
+class OrientationSupport;
+}
+class SplashScreenSupport;
+namespace WrtDB {
+class WidgetDAOReadOnly;
+}
+class WidgetSettingList;
+
+class WrtClientLite
+{
+  public:
+    WrtClientLite(const std::string& appId, Ewk_Context* context, WindowData* winData);
+    virtual ~WrtClientLite();
+
+    static std::string getTizenIdFromArgument(int argc, char **argv);
+
+    bool OnCreate(bundle *b);
+    void OnResume();
+    void OnSuspend();
+    void OnReset(bundle *b);
+    void OnTerminate();
+    static Eina_Bool sendRequestForPoolProcess(void* data);
+    void OnResetAulConnection();
+
+  private:
+    void setDebugMode(bundle* b);
+    void initializeWindowModes();
+
+    // static Callback
+    static void appcoreLowMemoryCallback(keynode_t* node, void* userData);
+    static int languageChangedCallback(void *data);
+    static void autoRotationCallback(void* data, Evas_Object* obj, void* event);
+    static void initialOrientationCheckCallback(void* data, Evas_Object* obj, void* event);
+    static void focusedCallback(void* data, Evas_Object* obj, void* eventInfo);
+    static void unfocusedCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+    //view-mode
+    void setInitialViewMode();
+
+    //orientation
+    void setWindowOrientation(int angle);
+    void initWindowOrientation();
+    void deinitWindowOrientation();
+
+    // hwkey
+    void keyCallback(Evas_Object* obj, void* eventInfo);
+
+    void consoleMessageCallback(Evas_Object* obj, void* eventInfo);
+    void rotatePreparedCallback(Evas_Object* obj, void* eventInfo);
+
+    // launching steps
+    void loadStartedCallback(Evas_Object* obj, void* eventInfo);
+    void loadFinishedCallback(Evas_Object* obj, void* eventInfo);
+    void loadProgressStartedCallback(Evas_Object* obj, void* eventInfo);
+    void loadProgressCallback(Evas_Object* obj, void* eventInfo);
+    void loadProgressFinishedCallback(Evas_Object* obj, void* eventInfo);
+    void processExitCallback(Evas_Object* obj, void* eventInfo);
+    void webProcessCrashedCallback(Evas_Object* obj, void* eventInfo);
+    void processCrashedCallback(Evas_Object* obj, void* eventInfo);
+    void enterFullscreenCallback(Evas_Object* obj, void* eventInfo);
+    void exitFullscreenCallback(Evas_Object* obj, void* eventInfo);
+    void enableVideoHwOverlayCallback(Evas_Object* obj, void* eventInfo);
+    void disableVideoHwOverlayCallback(Evas_Object* obj, void* eventInfo);
+    void setLayout(Evas_Object* newBuffer);
+    void unsetLayout(Evas_Object* currentBuffer);
+    void popupReplyWaitStartCallback(Evas_Object* obj, void* eventInfo);
+    void popupReplyWaitFinishCallback(Evas_Object* obj, void* eventInfo);
+    void frameRenderedCallback(Evas_Object* obj, void* eventInfo);
+    void blockedUrlPolicyCallback(const std::string& blockedUrl) ;
+    bool isCreateNewWindowAllowedCallback(void);
+    void createContextMenuCallback(void* eventInfo);
+#if ENABLE(ONE_UI_PROCESS_MODEL)
+    std::string createInitMessage(bundle* b, unsigned int portNum);
+#endif
+
+    // Private data
+    std::string m_tizenId;
+
+    bool m_debugMode;
+    WRT::RunnableWidgetObjectPtr m_widget;
+    WrtDB::WidgetDAOReadOnlyPtr m_dao;
+    WidgetSettingListPtr m_settingList;
+    WidgetState m_widgetState;
+    WindowDataPtr m_windowData;
+    std::string m_initialViewMode;
+    std::string m_currentViewMode;
+#if USE(WEBKIT_MANUAL_ROTATION)
+    bool m_isWebkitHandleManualRotationDone;
+#endif
+    bool m_isWebkitFullscreen;
+    std::unique_ptr<ClientModule::OrientationSupport> m_orientationSupport;
+    Ewk_Context* m_savedContext; // For Pooled process
+    WindowData* m_savedWindowData; // For Pooled process
+    bool m_didCreatePool; // For Pooled process
+    Ecore_Timer *m_processPoolTimer; // For Pooled process Timer handle
+};
+
+typedef std::shared_ptr<WrtClientLite> WrtClientLitePtr;
+
+#endif // WRT_CLIENT_LITE_H_
diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp
new file mode 100644 (file)
index 0000000..3d96460
--- /dev/null
@@ -0,0 +1,1378 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include "wrt-client.h"
+
+#include <cstdlib>
+#include <cstdio>
+#include <string>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+#include <aul.h>
+#include <app_control.h>
+#include <appcore-efl.h>
+#include <appcore-common.h>
+#include <dpl/availability.h>
+#include <dpl/bind.h>
+#include <dpl/exception.h>
+#include <dpl/localization/w3c_file_localization.h>
+#include <dpl/localization/LanguageTagsProvider.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/optional_typedefs.h>
+#include <dpl/platform.h>
+#include <efl_assist.h>
+#include <Elementary.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <popup-runner/PopupInvoker.h>
+#include <vconf.h>
+
+#include <application_data.h>
+#include <core_module.h>
+#include <localization_setting.h>
+#include <message_support.h>
+#if ENABLE(PRE_LAUNCH)
+#include <pre_launching_support.h>
+#endif
+#include <security_support.h>
+#include <process_pool.h>
+#include <process_pool_launchpad_util.h>
+#include <user_delegates.h>
+#include <widget_deserialize_model.h>
+#include "client_command_line_parser.h"
+#include "client_ide_support.h"
+#include "client_orientation_support.h"
+#include "client_submode_support.h"
+#include "splash_screen_support.h"
+
+//W3C PACKAGING enviroment variable name
+#define W3C_DEBUG_ENV_VARIABLE "DEBUG_LOAD_FINISH"
+
+//Tizen Extensible API String
+const char *EXTENSIBLE_API_PRERENDERING_FOR_ROTATION = "prerendering,for,rotation";
+const char *EXTENSIBLE_API_MEDIA_VOLUME_CONTROL = "media,volume,control";
+
+// window signal callback
+const char *EDJE_SHOW_PROGRESS_SIGNAL = "show,progress,signal";
+const char *EDJE_HIDE_PROGRESS_SIGNAL = "hide,progress,signal";
+const std::string VIEWMODE_TYPE_FULLSCREEN = "fullscreen";
+const std::string VIEWMODE_TYPE_MAXIMIZED = "maximized";
+const std::string VIEWMODE_TYPE_WINDOWED = "windowed";
+char const* const ELM_SWALLOW_CONTENT = "elm.swallow.content";
+const char* const BUNDLE_PATH = "/usr/lib/libwrt-injected-bundle.so";
+const unsigned int UID_ROOT = 0;
+
+// process pool
+const char* const DUMMY_PROCESS_PATH = "/usr/bin/wrt_launchpad_daemon_candidate";
+static Ewk_Context* s_preparedEwkContext = NULL;
+static WindowData*  s_preparedWindowData = NULL;
+static int    app_argc = 0;
+static char** app_argv = NULL;
+
+// env
+const char* const HOME = "HOME";
+const char* const APP_HOME_PATH = "/opt/home/app";
+const char* const ROOT_HOME_PATH = "/opt/home/root";
+const char* const WRT_CONSOLE_LOG_ENABLE = "WRT_CONSOLE_LOG_ENABLE";
+
+WrtClient::WrtClient(int argc, char **argv) :
+    Application(argc, argv, "wrt-client", false),
+    DPL::TaskDecl<WrtClient>(this),
+    m_launched(false),
+    m_initializing(false),
+    m_initialized(false),
+    m_debugMode(false),
+    m_returnStatus(ReturnStatus::Succeeded),
+    m_widgetState(WidgetState::WidgetState_Stopped),
+    m_initialViewMode(VIEWMODE_TYPE_MAXIMIZED),
+    m_currentViewMode(VIEWMODE_TYPE_MAXIMIZED),
+    m_isWebkitFullscreen(false),
+#if USE(WEBKIT_MANUAL_ROTATION)
+    m_isWebkitHandleManualRotationDone(false),
+#endif
+    m_submodeSupport(new ClientModule::SubmodeSupport())
+{
+    Touch();
+    WrtLogD("App Created");
+}
+
+WrtClient::~WrtClient()
+{
+    WrtLogD("App Finished");
+}
+
+WrtClient::ReturnStatus::Type WrtClient::getReturnStatus() const
+{
+    return m_returnStatus;
+}
+
+void WrtClient::OnStop()
+{
+    WrtLogD("Stopping Dummy Client");
+}
+
+void WrtClient::OnCreate()
+{
+    WrtLogD("On Create");
+    ADD_PROFILING_POINT("OnCreate callback", "point");
+    ewk_init();
+}
+
+void WrtClient::OnResume()
+{
+    if (m_widgetState != WidgetState_Suspended) {
+        WrtLogW("Widget is not suspended, resuming was skipped");
+        return;
+    }
+    m_widget->Resume();
+    m_widgetState = WidgetState_Running;
+}
+
+void WrtClient::OnPause()
+{
+    if (m_widgetState != WidgetState_Running) {
+        WrtLogW("Widget is not running to be suspended");
+        return;
+    }
+    if (m_submodeSupport->isNeedTerminateOnSuspend()) {
+        WrtLogD("Current mode cannot support suspend");
+        elm_exit();
+        return;
+    }
+    m_widget->Suspend();
+    m_widgetState = WidgetState_Suspended;
+}
+
+void WrtClient::OnReset(bundle *b)
+{
+    WrtLogD("OnReset");
+
+    if (true == m_initializing) {
+        WrtLogD("can not handle reset event");
+        return;
+    }
+    if (true == m_launched) {
+        if (m_widgetState == WidgetState_Stopped) {
+            WrtLogE("Widget is not running to be reset");
+            return;
+        }
+#if ENABLE(PRE_LAUNCH)
+        if (PreLaunchingSupportSingleton::Instance().isPreLaunching())
+        {
+            if (m_widget->GetCurrentWebview())
+            {
+                PreLaunchingSupportSingleton::Instance().setJavascriptExecuteFlag(false);
+            }
+
+            evas_object_show(m_windowData->getEvasObject(Layer::WINDOW));
+            PreLaunchingSupportSingleton::Instance().finalize();
+        }
+#endif
+        ApplicationDataSingleton::Instance().setBundleData(m_tizenId, b);
+        m_widget->Reset();
+        m_orientationSupport->resetOrientation();
+        m_widgetState = WidgetState_Running;
+    } else {
+        m_tizenId =
+            ClientModule::CommandLineParser::getTizenId(m_argc, m_argv);
+        if (m_tizenId.empty()) {
+            showHelpAndQuit();
+        } else {
+            setDebugMode(b);
+#if ENABLE(PRE_LAUNCH)
+            PreLaunchingSupportSingleton::Instance().setPreLaunching(b);
+#endif
+            ApplicationDataSingleton::Instance().setBundleData(m_tizenId, b);
+            setStep();
+        }
+    }
+
+    // low memory callback set
+    appcore_set_event_callback(
+            APPCORE_EVENT_LOW_MEMORY,
+            WrtClient::appcoreLowMemoryCallback,
+            this);
+}
+
+void WrtClient::OnTerminate()
+{
+    WrtLogD("Wrt Shutdown now");
+    shutdownStep();
+}
+
+void WrtClient::showHelpAndQuit()
+{
+    printf("Usage: wrt-client [OPTION]... [WIDGET: ID]...\n"
+           "launch widgets.\n"
+           "Mandatory arguments to long options are mandatory for short "
+           "options too.\n"
+           "  -h,    --help                                 show this help\n"
+           "  -l,    --launch                               "
+           "launch widget with given tizen ID\n"
+           "  -t,    --tizen                                "
+           "launch widget with given tizen ID\n"
+           "\n");
+
+    Quit();
+}
+
+void WrtClient::setStep()
+{
+    WrtLogD("setStep");
+
+    AddStep(&WrtClient::initStep);
+    AddStep(&WrtClient::launchStep);
+    AddStep(&WrtClient::showStep);
+    AddStep(&WrtClient::shutdownStep);
+
+    m_initializing = true;
+
+    DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(NextStepEvent());
+}
+
+void WrtClient::setDebugMode(bundle* b)
+{
+    m_debugMode = ClientModule::IDESupport::getDebugMode(b);
+    WrtLogD("debug mode : %d", m_debugMode);
+}
+
+void WrtClient::OnEventReceived(const NextStepEvent& /*event*/)
+{
+    size_t count = GetStepCount();
+    WrtLogD("Step Count : %d", count);
+
+    if (count) {
+        WrtLogD("Executing next step");
+        NextStep();
+    }
+}
+
+void WrtClient::initStep()
+{
+    WrtLogD("");
+    if (WRT::CoreModuleSingleton::Instance().Init()) {
+        m_initialized = true;
+    } else {
+        m_returnStatus = ReturnStatus::Failed;
+        switchToShutdownStep();
+        return;
+    }
+
+    DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(NextStepEvent());
+}
+
+void WrtClient::loadStartedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if USE(WEBKIT_SHOW_PROGRESS_BAR_EARLIER)
+    if (m_settingList->getProgressBarPresence() == ProgressBar_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        m_windowData->signalEmit(Layer::MAIN_LAYOUT,
+                                 EDJE_SHOW_PROGRESS_SIGNAL,
+                                 "");
+        m_windowData->updateProgress(0);
+    }
+#endif
+
+#if ENABLE(PRE_LAUNCH)
+    if (PreLaunchingSupportSingleton::Instance().isPreLaunching())
+    {
+        PreLaunchingSupportSingleton::Instance().setJavascriptExecuteFlag(true);
+    }
+#endif
+}
+void WrtClient::loadFinishedCallback(Evas_Object* obj, void* eventInfo)
+{
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    ADD_PROFILING_POINT("loadFinishedCallback", "start");
+
+    // Splash screen
+    if (m_splashScreen && m_splashScreen->isShowing())
+    {
+        m_splashScreen->stopSplashScreenBuffered();
+    }
+
+    WrtLogD("Post result of launch");
+
+    //w3c packaging test debug (message on 4>)
+    const char * makeScreen = getenv(W3C_DEBUG_ENV_VARIABLE);
+    if (makeScreen != NULL && strcmp(makeScreen, "1") == 0) {
+        FILE* doutput = fdopen(4, "w");
+        if (doutput == NULL) {
+            WrtLogW("Fail to load output file");
+        } else {
+            fprintf(doutput, "didFinishLoadForFrameCallback: ready\n");
+            fclose(doutput);
+        }
+    }
+
+    WrtLogD("Launch succesfull");
+
+    m_launched = true;
+    m_initializing = false;
+    setlinebuf(stdout);
+    ADD_PROFILING_POINT("loadFinishedCallback", "stop");
+    printf("launched\n");
+    fflush(stdout);
+
+    if (m_debugMode) {
+        Ewk_Context* ewkContext = ewk_view_context_get(obj);
+        Assert(ewkContext);
+        unsigned int portNum =
+            ewk_context_inspector_server_start(ewkContext, 0);
+        WrtLogD("Port for inspector : %d", portNum);
+        bool ret = ClientModule::IDESupport::sendReply(
+                       ApplicationDataSingleton::Instance().getBundle(m_tizenId),
+                       portNum);
+        if (!ret) {
+            WrtLogW("Fail to send reply");
+        }
+    }
+    ApplicationDataSingleton::Instance().freeBundleData(m_tizenId);
+}
+
+void WrtClient::loadProgressStartedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if !USE(WEBKIT_SHOW_PROGRESS_BAR_EARLIER)
+    if (m_settingList->getProgressBarPresence() == ProgressBar_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        m_windowData->signalEmit(Layer::MAIN_LAYOUT,
+                                 EDJE_SHOW_PROGRESS_SIGNAL,
+                                 "");
+        m_windowData->updateProgress(0);
+    }
+#endif
+}
+
+void WrtClient::loadProgressCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+
+    if (m_settingList->getProgressBarPresence() == ProgressBar_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        Assert(eventInfo);
+        double* progress = static_cast<double*>(eventInfo);
+        m_windowData->updateProgress(*progress);
+    }
+}
+
+void WrtClient::loadProgressFinishedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    if (m_settingList->getProgressBarPresence() == ProgressBar_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        m_windowData->signalEmit(Layer::MAIN_LAYOUT,
+                                 EDJE_HIDE_PROGRESS_SIGNAL,
+                                 "");
+    }
+}
+
+void WrtClient::processExitCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("process exit");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    elm_exit();
+}
+
+void WrtClient::webProcessCrashedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogE("webProcess crashed");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    switchToShutdownStep();
+}
+
+void WrtClient::processCrashedCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogE("Process crashed");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+}
+
+void WrtClient::enterFullscreenCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    // enter fullscreen
+    m_windowData->toggleFullscreen(true);
+    m_currentViewMode = VIEWMODE_TYPE_FULLSCREEN;
+    m_isWebkitFullscreen = true;
+}
+
+void WrtClient::exitFullscreenCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    // exit fullscreen
+    m_windowData->toggleFullscreen(false);
+    m_currentViewMode = m_initialViewMode;
+    m_isWebkitFullscreen = false;
+}
+
+void WrtClient::enableVideoHwOverlayCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    ewk_view_draws_transparent_background_set(obj, EINA_TRUE);
+    m_windowData->toggleTransparent(true);
+}
+
+void WrtClient::disableVideoHwOverlayCallback(Evas_Object* obj, void* eventInfo)
+{
+    WrtLogD("called");
+
+    Assert(obj);
+
+    DPL_UNUSED_PARAM(eventInfo);
+
+    m_windowData->toggleTransparent(false);
+    ewk_view_draws_transparent_background_set(obj, EINA_FALSE);
+}
+
+void WrtClient::popupReplyWaitStartCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+    m_orientationSupport->setManualRotation(false);
+    ewk_context_tizen_extensible_api_string_set(s_preparedEwkContext,
+                                         EXTENSIBLE_API_PRERENDERING_FOR_ROTATION,
+                                         EINA_FALSE);
+#endif
+}
+
+void WrtClient::popupReplyWaitFinishCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+    m_orientationSupport->setManualRotation(true);
+    ewk_context_tizen_extensible_api_string_set(s_preparedEwkContext,
+                                         EXTENSIBLE_API_PRERENDERING_FOR_ROTATION,
+                                         EINA_TRUE);
+#endif
+}
+
+void WrtClient::frameRenderedCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+    if (m_isWebkitHandleManualRotationDone == false) {
+        WrtLogD("start manual roatation");
+        m_orientationSupport->setManualRotation(true);
+        m_isWebkitHandleManualRotationDone = true;
+        ewk_context_tizen_extensible_api_string_set(s_preparedEwkContext,
+                                             EXTENSIBLE_API_PRERENDERING_FOR_ROTATION,
+                                             EINA_TRUE);
+    }
+#endif
+#if ENABLE(PRE_LAUNCH)
+    PreLaunchingSupportSingleton::Instance().updateRender();
+#endif
+}
+
+void WrtClient::blockedUrlPolicyCallback (const std::string& blockedUrl)
+{
+    // block this page and open it in browser
+    WrtLogD("Request was blocked : %s", blockedUrl.c_str());
+
+    m_launched = true;
+    m_initializing = false;
+
+    app_control_h app_control = NULL;
+    app_control_create(&app_control);
+    app_control_set_operation(app_control, APP_CONTROL_OPERATION_VIEW);
+    app_control_set_uri(app_control, blockedUrl.c_str());
+
+    if(APP_CONTROL_ERROR_NONE != app_control_send_launch_request(app_control, NULL, NULL)) {
+        WrtLogE("Failed to run app_control");
+    }
+
+    app_control_destroy(app_control);
+    return;
+}
+
+bool WrtClient::isCreateNewWindowAllowedCallback (void)
+{
+    return true;
+}
+
+void WrtClient::createContextMenuCallback(void* eventInfo)
+{
+    WrtLogD("createContextMenuCallback");
+    Ewk_Context_Menu* menu = static_cast<Ewk_Context_Menu*>(eventInfo);
+    unsigned int menu_num = ewk_context_menu_item_count(menu);
+    unsigned int idx = 0;
+    do {
+        Ewk_Context_Menu_Item* item = ewk_context_menu_nth_item_get(menu, idx);
+        if (!item) {
+            idx++;
+            continue;
+        }
+        Ewk_Context_Menu_Item_Tag tag = ewk_context_menu_item_tag_get(item);
+
+        switch (tag) {
+        case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_FRAME_IN_NEW_WINDOW:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+#if USE(WEBKIT_UPVERSION)
+        case EWK_CONTEXT_MENU_ITEM_OPEN_MEDIA_IN_NEW_WINDOW:
+#else
+        case EWK_CONTEXT_MENU_ITEM_TAG_OPEN_MEDIA_IN_NEW_WINDOW:
+#endif
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        case EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        case EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_IMAGE_TO_DISK:
+            ewk_context_menu_item_remove(menu, item);
+            continue;
+
+        default:
+            idx++;
+            break;
+        }
+    } while (idx < menu_num);
+
+    return;
+}
+
+void WrtClient::launchStep()
+{
+    ADD_PROFILING_POINT("launchStep", "start");
+    WrtLogD("Launching widget ...");
+
+    ADD_PROFILING_POINT("getRunnableWidgetObject", "start");
+    m_widget = WRT::CoreModuleSingleton::Instance()
+            .getRunnableWidgetObject(m_tizenId);
+    ADD_PROFILING_POINT("getRunnableWidgetObject", "stop");
+
+    if (!m_widget) {
+        WrtLogE("RunnableWidgetObject is NULL, stop launchStep");
+        switchToShutdownStep();
+        elm_exit();
+        return;
+    }
+
+    if (m_widgetState == WidgetState_Running) {
+        WrtLogW("Widget already running, stop launchStep");
+        switchToShutdownStep();
+        return;
+    }
+
+    m_dao.reset(new WrtDB::WidgetDAOReadOnly(DPL::FromASCIIString(m_tizenId)));
+    WrtDB::WidgetSettings widgetSettings;
+    m_dao->getWidgetSettings(widgetSettings);
+    m_settingList.reset(new WidgetSettingList(widgetSettings));
+    m_submodeSupport->initialize(DPL::FromASCIIString(m_tizenId));
+
+    DPL::OptionalString defloc = m_dao->getDefaultlocale();
+    if (!!defloc) {
+        LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(
+            *defloc);
+    }
+
+    setInitialViewMode();
+
+    /* remove language change callback */
+    /*
+    LocalizationSetting::SetLanguageChangedCallback(
+            languageChangedCallback, this);
+    */
+
+    ADD_PROFILING_POINT("CreateWindow", "start");
+    if (s_preparedWindowData == NULL) {
+        m_windowData.reset(new WindowData(static_cast<unsigned long>(getpid()), true));
+    } else {
+        m_windowData.reset(s_preparedWindowData);
+        s_preparedWindowData = NULL;
+    }
+    ADD_PROFILING_POINT("CreateWindow", "stop");
+#if USE(EA_SCREEN_READER)
+    if (!m_windowData->initScreenReaderSupport(
+            m_settingList->getAccessibility() == Accessibility_Enable))
+    {
+        WrtLogW("Fail to set screen reader support set");
+    }
+#endif
+
+    // rotate window to initial value
+    initWindowOrientation();
+
+    WRT::UserDelegatesPtr cbs(new WRT::UserDelegates);
+
+    ADD_PROFILING_POINT("Create splash screen", "start");
+    DPL::OptionalString splashImgSrc = m_dao->getSplashImgSrc();
+    if (!!splashImgSrc)
+    {
+        m_splashScreen.reset(
+            new SplashScreenSupport(
+                m_windowData->getEvasObject(Layer::WINDOW),
+                (DPL::ToUTF8String(*splashImgSrc)).c_str(),
+                m_currentViewMode != VIEWMODE_TYPE_FULLSCREEN,
+                m_settingList->getRotationValue() == Screen_Landscape));
+        m_splashScreen->startSplashScreen();
+    }
+    ADD_PROFILING_POINT("Create splash screen", "stop");
+
+    DPL::OptionalString startUrl = W3CFileLocalization::getStartFile(m_dao);
+#if USE(WEB_PROVIDER_EXCEPTION_IN_EWK_CONTEXT)
+    ewk_context_tizen_extensible_api_string_set(s_preparedEwkContext, EXTENSIBLE_API_MEDIA_VOLUME_CONTROL, EINA_TRUE);
+#endif
+    if (!m_widget->PrepareView(
+            DPL::ToUTF8String(*startUrl),
+            m_windowData->getEvasObject(Layer::WINDOW),
+            s_preparedEwkContext))
+    {
+        switchToShutdownStep();
+        return;
+    }
+    // send rotate information to ewk
+    m_orientationSupport->setEwkInitialOrientation(
+            m_settingList->getRotationValue());
+
+    //you can't show window with splash screen before PrepareView
+    //ewk_view_add_with_context() in viewLogic breaks window
+    m_windowData->init();
+    m_windowData->postInit();
+
+    // sub-mode support
+    if (m_submodeSupport->isInlineMode()) {
+        if (m_submodeSupport->transientWindow(
+                elm_win_xwindow_get(
+                    m_windowData->getEvasObject(Layer::WINDOW))))
+        {
+            WrtLogD("Success to set submode");
+        } else {
+            WrtLogW("Fail to set submode");
+        }
+    }
+    m_windowData->smartCallbackAdd(Layer::FOCUS,
+                                   "focused",
+                                   focusedCallback,
+                                   this);
+    m_windowData->smartCallbackAdd(Layer::FOCUS,
+                                   "unfocused",
+                                   unfocusedCallback,
+                                   this);
+
+    WrtDB::WidgetLocalizedInfo localizedInfo =
+        W3CFileLocalization::getLocalizedInfo(m_dao);
+    std::string name = "";
+    if (!!localizedInfo.name) {
+        name = DPL::ToUTF8String(*(localizedInfo.name));
+    }
+    elm_win_title_set(m_windowData->getEvasObject(Layer::WINDOW),
+                      name.c_str());
+
+    // window show
+#if ENABLE(PRE_LAUNCH)
+    if (PreLaunchingSupportSingleton::Instance().isPreLaunching()) {
+        PreLaunchingSupportSingleton::Instance().initialize(
+            m_widget->GetCurrentWebview(),
+            m_windowData->getEvasObject(Layer::WINDOW));
+    } else {
+        evas_object_show(m_windowData->getEvasObject(Layer::WINDOW));
+    }
+#else
+    evas_object_show(m_windowData->getEvasObject(Layer::WINDOW));
+#endif
+
+    initializeWindowModes();
+
+    m_widgetState = WidgetState_Running;
+
+    cbs->loadProgressStartedCallback = DPL::Bind(&WrtClient::loadProgressStartedCallback, this);
+    cbs->loadProgressCallback = DPL::Bind(&WrtClient::loadProgressCallback, this);
+    cbs->loadProgressFinishedCallback = DPL::Bind(&WrtClient::loadProgressFinishedCallback, this);
+    cbs->loadStartedCallback = DPL::Bind(&WrtClient::loadStartedCallback, this);
+    cbs->loadFinishedCallback = DPL::Bind(&WrtClient::loadFinishedCallback, this);
+    cbs->setWebviewCallback = DPL::Bind(&WrtClient::setLayout, this);
+    cbs->unsetWebviewCallback = DPL::Bind(&WrtClient::unsetLayout, this);
+    cbs->processExitCallback = DPL::Bind(&WrtClient::processExitCallback, this);
+    cbs->webProcessCrashedCallback = DPL::Bind(&WrtClient::webProcessCrashedCallback, this);
+    cbs->processCrashedCallback = DPL::Bind(&WrtClient::processCrashedCallback, this);
+    cbs->enterFullscreenCallback = DPL::Bind(&WrtClient::enterFullscreenCallback, this);
+    cbs->exitFullscreenCallback = DPL::Bind(&WrtClient::exitFullscreenCallback, this);
+    cbs->orientationLockCallback = DPL::Bind(&WrtClient::setWindowOrientation, this);
+    cbs->keyCallback = DPL::Bind(&WrtClient::keyCallback, this);
+    cbs->consoleMessageCallback = DPL::Bind(&WrtClient::consoleMessageCallback, this);
+    cbs->rotatePreparedCallback = DPL::Bind(&WrtClient::rotatePreparedCallback, this);
+    cbs->enableVideoHwOverlayCallback = DPL::Bind(&WrtClient::enableVideoHwOverlayCallback, this);
+    cbs->disableVideoHwOverlayCallback = DPL::Bind(&WrtClient::disableVideoHwOverlayCallback, this);
+    cbs->popupReplyWaitStartCallback = DPL::Bind(&WrtClient::popupReplyWaitStartCallback, this);
+    cbs->popupReplyWaitFinishCallback = DPL::Bind(&WrtClient::popupReplyWaitFinishCallback, this);
+    cbs->frameRenderedCallback = DPL::Bind(&WrtClient::frameRenderedCallback, this);
+    cbs->blockedUrlPolicyCallback = DPL::Bind(&WrtClient::blockedUrlPolicyCallback, this);
+    cbs->isCreateNewWindowAllowedCallback = DPL::Bind(&WrtClient::isCreateNewWindowAllowedCallback, this);
+    cbs->createContextMenuCallback = DPL::Bind(&WrtClient::createContextMenuCallback, this);
+
+    m_widget->SetUserDelegates(cbs);
+
+    if (m_orientationSupport->isOrientationPrepared(m_settingList->getRotationValue())) {
+        DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(NextStepEvent());
+    } else {
+        m_orientationSupport->registerRotationCallback(initialOrientationCheckCallback, this);
+    }
+    ADD_PROFILING_POINT("launchStep", "stop");
+}
+
+void WrtClient::showStep()
+{
+    WrtLogD("Show widget ...");
+    m_widget->Show();
+}
+
+void WrtClient::switchToShutdownStep()
+{
+    WrtLogD("switchToShutdownStep");
+    // webProcessCrashedCallback was called twice by webkit which called NexStepEvent
+    // again while no step was left in the Queue and Assert failed in Task.h
+    if(WidgetState_Stopped == m_widgetState){
+        WrtLogE("shutdownStep was called already!");
+        return;
+    }
+    SwitchToStep(&WrtClient::shutdownStep);
+    DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(NextStepEvent());
+}
+
+void WrtClient::initializeWindowModes()
+{
+    Assert(m_windowData);
+    bool backbutton =
+        (m_settingList->getBackButtonPresence() == BackButton_Enable ||
+        m_initialViewMode == VIEWMODE_TYPE_WINDOWED);
+    m_windowData->setViewMode(m_currentViewMode == VIEWMODE_TYPE_FULLSCREEN,
+                              backbutton);
+}
+
+Eina_Bool WrtClient::naviframeBackButtonCallback(void* data,
+                                                 Elm_Object_Item* /*it*/)
+{
+    WrtLogD("BackButtonCallback");
+    Assert(data);
+
+    WrtClient* This = static_cast<WrtClient*>(data);
+    This->m_widget->Backward();
+    return EINA_FALSE;
+}
+
+int WrtClient::appcoreLowMemoryCallback(void* /* event_info*/, void* data)
+{
+    WrtLogD("appcoreLowMemoryCallback");
+    Assert(data);
+    WrtClient* This = static_cast<WrtClient*>(data);
+
+    if (This->m_widget) {
+        This->m_widget->HandleLowMemory();
+    }
+
+    return 0;
+}
+
+void WrtClient::setInitialViewMode(void)
+{
+    Assert(m_dao);
+    WrtDB::WindowModeList windowModes = m_dao->getWindowModes();
+    FOREACH(it, windowModes) {
+        std::string viewMode = DPL::ToUTF8String(*it);
+        switch(viewMode[0]) {
+            case 'f':
+                if (viewMode == VIEWMODE_TYPE_FULLSCREEN) {
+                    m_initialViewMode = viewMode;
+                    m_currentViewMode = m_initialViewMode;
+                    break;
+                }
+                break;
+            case 'm':
+                if (viewMode == VIEWMODE_TYPE_MAXIMIZED) {
+                    m_initialViewMode = viewMode;
+                    m_currentViewMode = m_initialViewMode;
+                    break;
+                }
+                break;
+            case 'w':
+                if (viewMode == VIEWMODE_TYPE_WINDOWED) {
+                    m_initialViewMode = viewMode;
+                    m_currentViewMode = m_initialViewMode;
+                    break;
+                }
+                break;
+            default:
+                break;
+        }
+    }
+}
+
+void WrtClient::initWindowOrientation(void)
+{
+    Assert(m_windowData);
+
+    m_orientationSupport.reset(
+            new ClientModule::OrientationSupport(m_windowData, m_widget));
+    m_orientationSupport->setInitialWindowOrientation(
+            m_settingList->getRotationValue());
+    if (!m_orientationSupport->setAutoRotation()) {
+        WrtLogE("Fail to set rotation callback");
+    } else {
+        m_orientationSupport->registerRotationCallback(autoRotationCallback,
+                                                       this);
+    }
+}
+
+void WrtClient::deinitWindowOrientation(void)
+{
+    Assert(m_orientationSupport);
+
+    m_orientationSupport->unregisterRotationCallbacks();
+    m_orientationSupport.reset();
+}
+
+void WrtClient::setWindowOrientation(int angle)
+{
+    Assert(m_windowData);
+    m_windowData->setOrientation(angle);
+}
+
+void WrtClient::keyCallback(Evas_Object* obj, void* eventInfo)
+{
+    Ea_Callback_Type keyType = static_cast<Ea_Callback_Type>(reinterpret_cast<int>(eventInfo));
+
+    // TODO: Remove keycallback when application moves to suspend
+    if (m_widgetState == WidgetState_Suspended) {
+        // Key event is faster than resume event
+        WrtLogW("Application is not ready to handle key");
+        return;
+    }
+    if (m_settingList->getBackButtonPresence() == BackButton_Enable
+        || m_initialViewMode == VIEWMODE_TYPE_WINDOWED)
+    {
+        // windowed UX - hosted application
+        if (keyType == EA_CALLBACK_BACK) {
+            if (m_isWebkitFullscreen) {
+                ewk_view_fullscreen_exit(obj);
+            } else {
+                m_widget->Backward();
+            }
+        } else if (keyType == EA_CALLBACK_MORE) {
+            // UX isn't confirmed
+        }
+    }
+}
+
+void WrtClient::consoleMessageCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+
+    static bool logEnable = (getenv(WRT_CONSOLE_LOG_ENABLE) != NULL);
+
+    if (m_debugMode || logEnable) {
+        Assert(eventInfo);
+        Ewk_Console_Message* consoleMessage = static_cast<Ewk_Console_Message*>(eventInfo);
+
+        std::stringstream buf;
+        unsigned int lineNumber = ewk_console_message_line_get(consoleMessage);
+        const char* text = ewk_console_message_text_get(consoleMessage);
+        const char* source = ewk_console_message_source_get(consoleMessage);
+        if (lineNumber) {
+            buf << source << ":";
+            buf << lineNumber << ":";
+        }
+        buf << text;
+
+        ConsoleLogLevel level;
+        switch (ewk_console_message_level_get(consoleMessage)) {
+        case EWK_CONSOLE_MESSAGE_LEVEL_TIP:
+        case EWK_CONSOLE_MESSAGE_LEVEL_LOG:
+        case EWK_CONSOLE_MESSAGE_LEVEL_DEBUG:
+            level = ConsoleLogLevel::Debug;
+            break;
+        case EWK_CONSOLE_MESSAGE_LEVEL_WARNING:
+            level = ConsoleLogLevel::Warning;
+            break;
+        case EWK_CONSOLE_MESSAGE_LEVEL_ERROR:
+            level = ConsoleLogLevel::Error;
+            break;
+        default:
+            level = ConsoleLogLevel::Debug;
+            break;
+        }
+        ClientModule::IDESupport::consoleMessage(
+            level,
+            "%s",
+            buf.str().c_str());
+    }
+}
+
+void WrtClient::rotatePreparedCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+#if USE(WEBKIT_MANUAL_ROTATION)
+    WrtLogD("Rotate by webkit");
+    m_orientationSupport->setRotationDone();
+#endif
+}
+
+
+void WrtClient::setLayout(Evas_Object* webview)
+{
+    WrtLogD("add new webkit buffer to window");
+
+     Assert(webview);
+    m_windowData->setWebview(webview);
+
+    evas_object_show(webview);
+
+#if ENABLE(PRE_LAUNCH)
+    if (PreLaunchingSupportSingleton::Instance().isPreLaunching() == false) {
+        evas_object_show(m_windowData->getEvasObject(Layer::WINDOW));
+    }
+#else
+    evas_object_show(m_windowData->getEvasObject(Layer::WINDOW));
+#endif
+}
+
+void WrtClient::unsetLayout(Evas_Object* webview)
+{
+    WrtLogD("remove current webkit buffer from window");
+    Assert(webview);
+    evas_object_hide(webview);
+    m_windowData->unsetWebview();
+}
+
+void WrtClient::shutdownStep()
+{
+    WrtLogD("Closing Wrt connection ...");
+
+    if (m_widget && m_widgetState) {
+        m_widgetState = WidgetState_Stopped;
+        Abort();
+        // (un)focusCallback MUST be detached before hiding widget starts
+        m_windowData->smartCallbackDel(Layer::FOCUS,
+                                       "focused",
+                                       focusedCallback);
+        m_windowData->smartCallbackDel(Layer::FOCUS,
+                                       "unfocused",
+                                       unfocusedCallback);
+        m_widget->Hide();
+        // AutoRotation use m_widget pointer internally.
+        // It must be unset before m_widget is released.
+        m_submodeSupport->deinitialize();
+        deinitWindowOrientation();
+        m_widget.reset();
+#if USE(WEBKIT_UPVERSION)
+        ewk_object_unref(s_preparedEwkContext);
+#else
+        ewk_context_delete(s_preparedEwkContext);
+#endif
+        WRT::CoreModuleSingleton::Instance().Terminate();
+    }
+    if (m_initialized) {
+        m_initialized = false;
+    }
+    m_windowData.reset();
+    Quit();
+}
+
+void WrtClient::autoRotationCallback(void* data,
+                                     Evas_Object* obj,
+                                     void* event)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(event);
+    WrtLogD("entered");
+    Assert(data);
+    WrtClient* This = static_cast<WrtClient*>(data);
+    // Splash screen
+    if (This->m_splashScreen && This->m_splashScreen->isShowing()) {
+        This->m_splashScreen->resizeSplashScreen();
+    }
+}
+
+void WrtClient::initialOrientationCheckCallback(void* data, Evas_Object* obj, void* event)
+{
+    WrtLogD("entered");
+
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(event);
+
+    Assert(data);
+    WrtClient* This = static_cast<WrtClient*>(data);
+    if (This->m_orientationSupport->isOrientationPrepared(This->m_settingList->getRotationValue())) {
+        WrtLogD("initial orientation is ready");
+        This->m_orientationSupport->unregisterRotationCallback(initialOrientationCheckCallback);
+        This->DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(NextStepEvent());
+    }
+}
+
+void WrtClient::focusedCallback(void* data,
+                                Evas_Object* /*obj*/,
+                                void* /*eventInfo*/)
+{
+    WrtLogD("entered");
+    Assert(data);
+    WrtClient* This = static_cast<WrtClient*>(data);
+    elm_object_focus_set(This->m_widget->GetCurrentWebview(), EINA_TRUE);
+}
+
+void WrtClient::unfocusedCallback(void* data,
+                                Evas_Object* /*obj*/,
+                                void* /*eventInfo*/)
+{
+    WrtLogD("entered");
+    Assert(data);
+    WrtClient* This = static_cast<WrtClient*>(data);
+    elm_object_focus_set(This->m_widget->GetCurrentWebview(), EINA_FALSE);
+}
+
+int WrtClient::languageChangedCallback(void *data)
+{
+    WrtLogD("Language Changed");
+    if (!data) {
+        return 0;
+    }
+    WrtClient* wrtClient = static_cast<WrtClient*>(data);
+    if (!(wrtClient->m_dao)) {
+        return 0;
+    }
+
+    // reset function fetches system locales and recreates language tags
+    LanguageTagsProviderSingleton::Instance().resetLanguageTags();
+    // widget default locales are added to language tags below
+    DPL::OptionalString defloc = wrtClient->m_dao->getDefaultlocale();
+    if (!!defloc) {
+        LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(
+            *defloc);
+    }
+
+    if (wrtClient->m_launched &&
+        wrtClient->m_widgetState != WidgetState_Stopped)
+    {
+        wrtClient->m_widget->ReloadStartPage();
+    }
+    return 0;
+}
+
+void WrtClient::Quit()
+{
+    ewk_shutdown();
+    DPL::Application::Quit();
+}
+
+static Eina_Bool proces_pool_fd_handler(void* /*data*/, Ecore_Fd_Handler *handler)
+{
+    int fd = ecore_main_fd_handler_fd_get(handler);
+
+    if (fd == -1)
+    {
+        WrtLogD("ECORE_FD_GET");
+        exit(-1);
+    }
+
+    if (ecore_main_fd_handler_active_get(handler, ECORE_FD_ERROR))
+    {
+        WrtLogD("ECORE_FD_ERROR");
+        close(fd);
+        exit(-1);
+    }
+
+    if (ecore_main_fd_handler_active_get(handler, ECORE_FD_READ))
+    {
+        WrtLogD("ECORE_FD_READ");
+        {
+            app_pkt_t* pkt = (app_pkt_t*) malloc(sizeof(char) * AUL_SOCK_MAXBUFF);
+            if (pkt == NULL) {
+                WrtLogD("malloc is failed");
+                close(fd);
+                exit(-1);
+            }
+            memset(pkt, 0, AUL_SOCK_MAXBUFF);
+
+            int recv_ret = recv(fd, pkt, AUL_SOCK_MAXBUFF, 0);
+            close(fd);
+
+            if (recv_ret == -1)
+            {
+                WrtLogD("recv error!");
+                free(pkt);
+                exit(-1);
+            }
+
+            WrtLogD("recv_ret : %d, pkt->len : %d", recv_ret, pkt->len);
+            ecore_main_fd_handler_del(handler);
+            process_pool_launchpad_main_loop(pkt, app_argv[0], &app_argc, &app_argv);
+            free(pkt);
+        }
+        ecore_main_loop_quit();
+    }
+
+    return ECORE_CALLBACK_CANCEL;
+}
+
+static void vconf_changed_handler(keynode_t* /*key*/, void* /*data*/)
+{
+    WrtLogD("VCONFKEY_LANGSET vconf-key was changed!");
+
+    // When system language is changed, the candidate process will be created again.
+    exit(-1);
+}
+
+void set_env()
+{
+#ifndef TIZEN_PUBLIC
+    setenv("COREGL_FASTPATH", "1", 1);
+#endif
+    setenv("CAIRO_GL_COMPOSITOR", "msaa", 1);
+    setenv("CAIRO_GL_LAZY_FLUSHING", "yes", 1);
+    setenv("ELM_IMAGE_CACHE", "0", 1);
+}
+
+int main(int argc,
+         char *argv[])
+{
+    // process pool - store arg's value
+    app_argc = argc;
+    app_argv = argv;
+
+    UNHANDLED_EXCEPTION_HANDLER_BEGIN
+    {
+        ADD_PROFILING_POINT("main-entered", "point");
+
+        // Set environment variables
+        set_env();
+
+        if (argc > 1 && argv[1] != NULL && !strcmp(argv[1], "-d"))
+        {
+            WrtLogD("Entered dummy process mode");
+            sprintf(argv[0], "%s", DUMMY_PROCESS_PATH);
+
+            // Temporarily change HOME path to app
+            // This change is needed for getting elementary profile
+            // /opt/home/app/.elementary/config/mobile/base.cfg
+            setenv(HOME, APP_HOME_PATH, 1);
+            WrtLogD("elm_init()");
+            elm_init(argc, argv);
+#if USE(EFL_LITE)
+            elm_app_base_scale_set(1.8);
+#else
+            elm_app_base_scale_set(2.4);
+#endif
+
+            // Set 'root' home directory
+            setenv(HOME, ROOT_HOME_PATH, 1);
+
+            WrtLogD("Prepare ewk_context");
+            appcore_set_i18n("wrt-client", NULL);
+            ewk_set_arguments(argc, argv);
+            // Temporary block until fix crash issue in Webkit side
+            //setenv("WRT_LAUNCHING_PERFORMANCE", "1", 1);
+            setenv("WEB_PROCESS_EXECUTABLE_PATH", "/usr/bin/WebProcess", 1);
+            setenv("WEB_PROCESS_EXECUTABLE_PATH_FOR_PROCESS_POOL","1", 1);
+            s_preparedEwkContext = ewk_context_new_with_injected_bundle_path(BUNDLE_PATH);
+
+            if (s_preparedEwkContext == NULL)
+            {
+                WrtLogD("Creating webkit context was failed!");
+                exit(-1);
+            }
+
+            int client_fd = __connect_process_pool_server();
+
+            if (client_fd == -1)
+            {
+                WrtLogD("Connecting process_pool_server was failed!");
+                exit(-1);
+            }
+
+            // register language changed callback
+            vconf_notify_key_changed(VCONFKEY_LANGSET, vconf_changed_handler, NULL);
+
+            Ecore_Fd_Handler* fd_handler = ecore_main_fd_handler_add(client_fd,
+                                           (Ecore_Fd_Handler_Flags)(ECORE_FD_READ|ECORE_FD_ERROR),
+                                           proces_pool_fd_handler, NULL, NULL, NULL);
+
+            if (fd_handler == NULL)
+            {
+                WrtLogD("fd_handler is NULL");
+                exit(-1);
+            }
+
+            setpriority(PRIO_PROCESS, 0, 0);
+
+            WrtLogD("ecore_main_loop_begin()");
+            ecore_main_loop_begin();
+            WrtLogD("ecore_main_loop_begin()_end");
+
+            // deregister language changed callback
+            vconf_ignore_key_changed(VCONFKEY_LANGSET, vconf_changed_handler);
+
+            std::string tizenId =
+                ClientModule::CommandLineParser::getTizenId(argc, argv);
+
+            // CapabilitySupport
+            std::string pluginProcessPath =
+                WRT::SecuritySupport::getPluginProcessSoftLinkPath(tizenId);
+
+            if (pluginProcessPath.empty()) {
+                WrtLogE("Failed to get plugin process path");
+                exit(-1);
+            }
+
+            setenv("PLUGIN_PROCESS_EXECUTABLE_PATH_FOR_PROCESS_POOL",
+                    pluginProcessPath.c_str(), 1);
+            WrtLogD("PLUGIN_PROCESS_EXECUTABLE_PATH_FOR_PROCESS_POOL = %s",
+                pluginProcessPath.c_str());
+            ewk_context_message_post_to_injected_bundle(
+                s_preparedEwkContext,
+                Message::ToInjectedBundle::INIT,
+                tizenId.c_str());
+
+            // Process Pool cannot initialize elm_win because of thread blocked signal to change label of samck
+            s_preparedWindowData = new WindowData(static_cast<unsigned long>(getpid()));
+
+        }
+        else
+        {
+            // This code is to fork a web process without exec.
+            std::string tizenId =
+                ClientModule::CommandLineParser::getTizenId(argc, argv);
+
+            if (!tizenId.empty()) {
+                if (UID_ROOT == getuid()) {
+                    // Drop root permission
+                    // Only launch web application by console command case has root permission
+                    if (!WRT::SecuritySupport::setAppPrivilege(tizenId)) {
+                        WrtLogE("Fail to set app privilege : [%s]", tizenId.c_str());
+                        exit(-1);
+                    }
+                }
+
+                WrtLogD("Launching by fork mode");
+                // Language env setup
+                appcore_set_i18n("wrt-client", NULL);
+                ewk_set_arguments(argc, argv);
+                // Temporary block until fix crash issue in Webkit side
+                //setenv("WRT_LAUNCHING_PERFORMANCE", "1", 1);
+
+                elm_init(argc, argv);
+#if USE(EFL_LITE)
+                elm_app_base_scale_set(1.8);
+#else
+                elm_app_base_scale_set(2.4);
+#endif
+                // CapabilitySupport
+                std::string pluginProcessPath =
+                    WRT::SecuritySupport::getPluginProcessSoftLinkPath(tizenId);
+
+                if (pluginProcessPath.empty()) {
+                    WrtLogE("Failed to get plugin process path");
+                    exit(-1);
+                }
+
+                setenv("PLUGIN_PROCESS_EXECUTABLE_PATH",
+                       pluginProcessPath.c_str(), 1);
+                WrtLogD("PLUGIN_PROCESS_EXECUTABLE_PATH = %s",
+                    pluginProcessPath.c_str());
+
+                s_preparedEwkContext = ewk_context_new_with_injected_bundle_path(
+                        BUNDLE_PATH);
+
+                if (s_preparedEwkContext == NULL)
+                {
+                    WrtLogD("Creating webkit context was failed!");
+                    Wrt::Popup::PopupInvoker().showInfo("Error", "Creating webkit context was failed.", "OK");
+                    exit(-1);
+                }
+
+                // plugin init
+                ewk_context_message_post_to_injected_bundle(
+                    s_preparedEwkContext,
+                    Message::ToInjectedBundle::INIT,
+                    tizenId.c_str());
+            }
+        }
+
+        // Output on stdout will be flushed after every newline character,
+        // even if it is redirected to a pipe. This is useful for running
+        // from a script and parsing output.
+        // (Standard behavior of stdlib is to use full buffering when
+        // redirected to a pipe, which means even after an end of line
+        // the output may not be flushed).
+        setlinebuf(stdout);
+
+        WrtClient app(app_argc, app_argv);
+
+        ADD_PROFILING_POINT("Before appExec", "point");
+        int ret = app.Exec();
+        WrtLogD("App returned: %d", ret);
+        ret = app.getReturnStatus();
+        WrtLogD("WrtClient returned: %d", ret);
+        return ret;
+    }
+    UNHANDLED_EXCEPTION_HANDLER_END
+}
diff --git a/src/wrt-client/wrt-client.h b/src/wrt-client/wrt-client.h
new file mode 100755 (executable)
index 0000000..35ba249
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+#ifndef WRT_CLIENT_H
+#define WRT_CLIENT_H
+
+#include <memory>
+#include <string>
+
+#include <bundle.h>
+#include <dpl/application.h>
+#include <dpl/platform.h>
+#include <dpl/event/controller.h>
+#include <dpl/generic_event.h>
+#include <dpl/task.h>
+#include <dpl/type_list.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include <Elementary.h>
+#include <Evas.h>
+#include <i_runnable_widget_object.h>
+#include <widget_data_types.h>
+
+#include "widget_state.h"
+#include "window_data.h"
+
+DECLARE_GENERIC_EVENT_0(NextStepEvent)
+
+namespace ClientModule {
+class SubmodeSupport;
+class OrientationSupport;
+}
+class SplashScreenSupport;
+namespace WrtDB {
+class WidgetDAOReadOnly;
+}
+class WidgetSettingList;
+
+class WrtClient :
+    public DPL::Application,
+    private DPL::Event::Controller<DPL::TypeListDecl<NextStepEvent>::Type>,
+    public DPL::TaskDecl<WrtClient>
+{
+  public:
+    WrtClient(int argc,
+              char **argv);
+    virtual ~WrtClient();
+
+    class ReturnStatus
+    {
+      public:
+        enum Type
+        {
+            Failed = -1,
+            Succeeded = 0
+        };
+    };
+
+    ReturnStatus::Type   getReturnStatus() const;
+    virtual void Quit();
+    static std::string getTizenIdFromArgument(int argc, char **argv);
+
+  protected:
+    virtual void OnStop();
+    virtual void OnCreate();
+    virtual void OnResume();
+    virtual void OnPause();
+    virtual void OnReset(bundle *b);
+    virtual void OnTerminate();
+
+    void setStep();
+
+  private:
+    void showHelpAndQuit();
+    void setDebugMode(bundle* b);
+    void initializeWindowModes();
+
+    // Events
+    virtual void OnEventReceived(const NextStepEvent& event);
+
+    // static Callback
+    static Eina_Bool naviframeBackButtonCallback(void* data,
+                                                 Elm_Object_Item* it);
+    static int appcoreLowMemoryCallback(void* eventInfo, void* data);
+    static int languageChangedCallback(void *data);
+    static void autoRotationCallback(void* data, Evas_Object* obj, void* event);
+    static void initialOrientationCheckCallback(void* data, Evas_Object* obj, void* event);
+    static void focusedCallback(void* data,
+                                Evas_Object* obj,
+                                void* eventInfo);
+    static void unfocusedCallback(void* data,
+                                  Evas_Object* obj,
+                                  void* eventInfo);
+
+    //view-mode
+    void setInitialViewMode();
+
+    //orientation
+    void setWindowOrientation(int angle);
+    void initWindowOrientation();
+    void deinitWindowOrientation();
+
+    // hwkey
+    void keyCallback(Evas_Object* obj, void* eventInfo);
+
+    void consoleMessageCallback(Evas_Object* obj, void* eventInfo);
+    void rotatePreparedCallback(Evas_Object* obj, void* eventInfo);
+
+    // launching steps
+    void initStep();
+    void launchStep();
+    void shutdownStep();
+    void showStep();
+    void switchToShutdownStep();
+    void loadStartedCallback(Evas_Object* obj, void* eventInfo);
+    void loadFinishedCallback(Evas_Object* obj, void* eventInfo);
+    void loadProgressStartedCallback(Evas_Object* obj, void* eventInfo);
+    void loadProgressCallback(Evas_Object* obj, void* eventInfo);
+    void loadProgressFinishedCallback(Evas_Object* obj, void* eventInfo);
+    void processExitCallback(Evas_Object* obj, void* eventInfo);
+    void webProcessCrashedCallback(Evas_Object* obj, void* eventInfo);
+    void processCrashedCallback(Evas_Object* obj, void* eventInfo);
+    void enterFullscreenCallback(Evas_Object* obj, void* eventInfo);
+    void exitFullscreenCallback(Evas_Object* obj, void* eventInfo);
+    void enableVideoHwOverlayCallback(Evas_Object* obj, void* eventInfo);
+    void disableVideoHwOverlayCallback(Evas_Object* obj, void* eventInfo);
+    void setLayout(Evas_Object* newBuffer);
+    void unsetLayout(Evas_Object* currentBuffer);
+    void popupReplyWaitStartCallback(Evas_Object* obj, void* eventInfo);
+    void popupReplyWaitFinishCallback(Evas_Object* obj, void* eventInfo);
+    void frameRenderedCallback(Evas_Object* obj, void* eventInfo);
+    void blockedUrlPolicyCallback(const std::string& blockedUrl) ;
+    bool isCreateNewWindowAllowedCallback(void);
+    void createContextMenuCallback(void* eventInfo);
+
+    // Private data
+    std::string m_tizenId;
+
+    bool m_launched;
+    bool m_initializing;
+    bool m_initialized;
+    bool m_debugMode;
+    ReturnStatus::Type m_returnStatus;
+    WRT::RunnableWidgetObjectPtr m_widget;
+    WrtDB::WidgetDAOReadOnlyPtr m_dao;
+    WidgetSettingListPtr m_settingList;
+    WidgetState m_widgetState;
+    WindowDataPtr m_windowData;
+    std::unique_ptr<SplashScreenSupport> m_splashScreen;
+    std::string m_initialViewMode;
+    std::string m_currentViewMode;
+    bool m_isWebkitFullscreen;
+#if USE(WEBKIT_MANUAL_ROTATION)
+    bool m_isWebkitHandleManualRotationDone;
+#endif
+    std::unique_ptr<ClientModule::SubmodeSupport> m_submodeSupport;
+    std::unique_ptr<ClientModule::OrientationSupport> m_orientationSupport;
+};
+
+#endif // WRT_CLIENT_H
diff --git a/src/wrt-launcher/CMakeLists.txt b/src/wrt-launcher/CMakeLists.txt
new file mode 100644 (file)
index 0000000..2e30846
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+GROUP_DEPS(LAUNCHER_PKGS DEPS
+    dpl-efl
+    dpl-db-efl
+    dpl-wrt-dao-rw
+    dpl-wrt-dao-ro
+    capi-appfw-app-manager
+    capi-appfw-application
+    appsvc
+    libsmack
+)
+
+SET(LAUNCHER_SRCS
+    wrt-launcher.cpp
+)
+
+INCLUDE_DIRECTORIES(
+    ${LAUNCHER_PKGS_INCLUDE_DIRS}
+)
+
+ADD_DEFINITIONS("-fPIE")
+
+ADD_EXECUTABLE(${TARGET_LAUNCHER}
+    ${LAUNCHER_SRCS}
+)
+
+TARGET_LINK_LIBRARIES(${TARGET_LAUNCHER}
+    ${LAUNCHER_PKGS_LIBRARIES}
+)
+
+SET_TARGET_PROPERTIES(${TARGET_LAUNCHER} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_LAUNCHER} PROPERTIES
+    LINK_FLAGS "-Wl,--as-needed -pie -Wl,--hash-style=both -Wl,--version-script=${PROJECT_SOURCE_DIR}/wrt-engine.map"
+    BUILD_WITH_INSTALL_RPATH ON
+    INSTALL_RPATH_USE_LINK_PATH ON
+)
+
+INSTALL(TARGETS ${TARGET_LAUNCHER}
+    DESTINATION bin
+    PERMISSIONS OWNER_READ
+                OWNER_WRITE
+                OWNER_EXECUTE
+)
diff --git a/src/wrt-launcher/wrt-launcher.cpp b/src/wrt-launcher/wrt-launcher.cpp
new file mode 100755 (executable)
index 0000000..04473a1
--- /dev/null
@@ -0,0 +1,517 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+#include <iostream>
+#include <string>
+#include <app.h>
+#include <app_manager.h>
+#include <string.h>
+#include <getopt.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <sys/types.h>
+#include <sys/smack.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/exception.h>
+#include <dpl/optional_typedefs.h>
+#include <dpl/wrt-dao-ro/WrtDatabase.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
+#include <dpl/wrt-dao-ro/feature_dao_read_only.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
+#include <dpl/wrt-dao-ro/config_parser_data.h>
+#include <appsvc.h>
+
+#define TIMEOUT_DEFAULT     10
+#define ROOT_DEFAULT_UID 0
+#define ROOT_DEFAULT_GID 0
+#define WEBAPP_DEFAULT_UID  5000
+#define WEBAPP_DEFAULT_GID  5000
+#define LOGGING_DEFAULT_GID 6509
+#define RETURN_ERROR -1
+#define BUF_SIZE 1024
+#define PKG_ID_LENGTH   11
+#define DEBUG_NETWORK "system::debugging_network"
+
+static const char *program;
+
+class DBConnection
+{
+  public:
+    void AttachDatabase()
+    {
+        WrtDB::WrtDatabase::attachToThreadRW();
+    }
+
+    void DetachDatabase()
+    {
+        WrtDB::WrtDatabase::detachFromThread();
+    }
+};
+
+static std::unique_ptr<DBConnection> g_dbConnection;
+
+static bool attachDbConnection()
+{
+    if (NULL == g_dbConnection.get()) {
+        Try {
+            g_dbConnection.reset(new DBConnection());
+            g_dbConnection->AttachDatabase();
+        }
+        Catch(DPL::DB::SqlConnection::Exception::Base) {
+            WrtLogD("Fail to connect DB");
+            return FALSE;
+        }
+    }
+    return TRUE;
+}
+
+static bool display_widget_info()
+{
+    if (!attachDbConnection()) {
+        return FALSE;
+    }
+
+    WidgetDAOReadOnlyList widgetList;
+
+    Try {
+        widgetList = WrtDB::WidgetDAOReadOnly::getWidgetList();
+    } Catch (WrtDB::WidgetDAOReadOnly::Exception::DatabaseError) {
+        WrtLogE("Fail to get WidgetList");
+        return FALSE;
+    }
+
+    printf("%3s %32s %16s %64s %16s %24s\n",
+           "No", "Name", "Version", "GUID", "Package ID", "App ID");
+    printf("%3s %32s %16s %64s %16s %24s\n",
+           "--", "--", "----", "-------", "-----", "-----");
+
+    int number = 1;
+    const char *null_str = "[NULL]";
+    FOREACH(dao, widgetList) {
+        Try {
+
+            WrtDB::WidgetGUID guid = (*dao)->getGUID();
+            DPL::OptionalString version = (*dao)->getVersion();
+            WrtDB::TizenAppId appid = (*dao)->getTizenAppId();
+            WrtDB::TizenPkgId pkgid = (*dao)->getTizenPkgId();
+
+            /*get WidgetName*/
+            DPL::OptionalString widget_name;
+            DPL::OptionalString dl = (*dao)->getDefaultlocale();
+            WrtDB::WidgetLocalizedInfo localizedInfo;
+            if (!dl) {
+                DPL::String languageTag(L"");
+                localizedInfo = (*dao)->getLocalizedInfo(languageTag);
+            } else {
+                localizedInfo = (*dao)->getLocalizedInfo(*dl);
+            }
+
+            widget_name = localizedInfo.name;
+            /*end get WidgetName*/
+
+            std::string widget_name_disp;
+            if (widget_name)
+                widget_name_disp = DPL::ToUTF8String(*widget_name);
+
+            std::string version_disp;
+            if (version)
+                version_disp = DPL::ToUTF8String(*version);
+
+            std::string guid_disp;
+            if (guid)
+                guid_disp = DPL::ToUTF8String(*guid);
+
+            std::string pkgid_disp;
+            pkgid_disp = DPL::ToUTF8String(pkgid);
+
+            std::string appid_disp;
+            appid_disp = DPL::ToUTF8String(appid);
+
+            printf("%3i %32s %16s %64s %16s %24s\n",
+                    number++,
+                    widget_name_disp.empty() ? null_str : widget_name_disp.c_str(),
+                    version_disp.c_str(),
+                    guid_disp.empty()  ? null_str : guid_disp.c_str(),
+                    pkgid_disp.empty() ? null_str : pkgid_disp.c_str(),
+                    appid_disp.empty() ? null_str : appid_disp.c_str());
+
+        } Catch (WrtDB::WidgetDAOReadOnly::Exception::WidgetNotExist) {
+            WrtLogE("Installed application list is updated");
+        }
+    }
+
+    return 1;
+}
+
+static void print_help(FILE *stream, int /*exit_code*/)
+{
+    fprintf(stream, "Usage : %s [ ... ]\n", program);
+    fprintf(
+        stream,
+        "   -h                        --help              Display this usage information.\n"
+        "   -l                        --list              Display installed widgets list\n"
+        "   -s [tizen application ID] --start             Launch widget with tizen application ID\n"
+        "   -k [tizen application ID] --kill              Kill widget with tizen application ID\n"
+        "   -r [tizen application ID] --is-running        Check whether widget is running by tizen application ID,\n"
+        "                                                 If widget is running, 0(zero) will be returned.\n"
+        "   -d                        --debug             Activate debug mode\n"
+        "   -t [second]               --timeout           Set timeout of response from widget in debug mode\n"
+        "    if you emit this option, 5 seconds is set in debug mode\n"
+        );
+}
+
+extern "C" int app_control_to_bundle(app_control_h app_control, bundle** data);
+
+static void app_control_ReplyCallback(app_control_h /*request*/,
+                                 app_control_h reply,
+                                 app_control_result_e /*result*/,
+                                 void* data)
+{
+    Ecore_Timer* app_control_Timer = static_cast<Ecore_Timer*>(data);
+    if (app_control_Timer != NULL) {
+        ecore_timer_del(app_control_Timer);
+    }
+
+    bundle* b = NULL;
+    app_control_to_bundle(reply, &b);
+    const char* port = appsvc_get_data(b, "port");
+    if (port != NULL && strlen(port) > 0) {
+        printf("port: %s\n", port);
+        printf("result: %s\n", "launched");
+    } else {
+        printf("result: %s\n", "failed");
+    }
+    ecore_main_loop_quit();
+    return;
+}
+
+static Eina_Bool timerCallback(void* /*data*/)
+{
+    printf("result: %s\n", "failed");
+    ecore_main_loop_quit();
+    return EINA_FALSE;
+}
+
+
+static int add_smack_rule(const char* subject, const char* object, const char *access){
+    int ret = 0;
+    struct smack_accesses *rules = NULL;
+    if((ret = smack_accesses_new(&rules)) != 0 ){
+        WrtLogE("error smack_accesses_new %d", ret);
+        return ret;
+    }
+    if((ret = smack_accesses_add(rules, subject, object, access)) != 0){
+        WrtLogE("error smack_accesses_add %d", ret);
+        smack_accesses_free(rules);
+        return ret;
+    }
+    if((ret = smack_accesses_apply(rules)) != 0){
+        WrtLogE("error smack_accesses_apply %d", ret);
+        smack_accesses_free(rules);
+        return ret;
+    }
+    smack_accesses_free(rules);
+    return ret;
+}
+
+static int set_debug_network_smack_rule(const char *pkg_id)
+{
+    int ret = 0;
+    WrtLogD("Add system::debugging_network smack rule");
+    ret = add_smack_rule(pkg_id, DEBUG_NETWORK, "rw");
+    if(!ret){
+       ret = add_smack_rule(DEBUG_NETWORK, pkg_id, "w");
+    }
+    return ret;
+}
+
+
+int main(int argc, char* argv[])
+{
+    UNHANDLED_EXCEPTION_HANDLER_BEGIN
+    {
+        int next_opt, opt_idx = 0;
+        int timeout = TIMEOUT_DEFAULT;
+        char applicationId[BUF_SIZE] = "";
+        char temp_arg[BUF_SIZE] = "";
+        char pid[6] = "";
+        char op = '\0';
+        bool isDebugMode = false;
+        bool dispHelp = false;
+        bool dispList = false;
+        Ecore_Timer* app_control_Timer = NULL;
+
+        app_control_h app_control = NULL;
+        int ret = APP_CONTROL_ERROR_NONE;
+
+        program = argv[0];
+
+        static struct option long_options[] = {
+            { "help", no_argument, 0, 'h' },
+            { "list", no_argument, 0, 'l' },
+            { "start", required_argument, 0, 's' },
+            { "kill", required_argument, 0, 'k' },
+            { "is-running", required_argument, 0, 'r' },
+            { "debug", no_argument, 0, 'd' },
+            { "timeout", required_argument, 0, 't' },
+            { 0, 0, 0, 0 }
+        };
+
+        if (argv[1] == NULL) {
+            /* exit if any argument doesn't exist */
+            print_help(stdout, 0);
+            return -1;
+        }
+
+        if (ROOT_DEFAULT_UID == geteuid()) {
+            if (RETURN_ERROR == setuid(ROOT_DEFAULT_UID)) {
+                perror("Fail to set uid");
+            }
+        }
+        if (ROOT_DEFAULT_GID == getegid()) {
+            if (RETURN_ERROR == setgid(ROOT_DEFAULT_GID)) {
+                perror("Fail to set gid");
+            }
+        }
+
+        do {
+            next_opt = getopt_long(argc,
+                                   argv,
+                                   "hls:k:r:dt:v:c:i:m:",
+                                   long_options,
+                                   &opt_idx);
+
+            switch (next_opt) {
+            case 'h':
+                if (!dispHelp) {
+                    print_help(stdout, 0);
+                    dispHelp = true;
+                }
+                break;
+
+            case 'l':
+                if (dispList) {
+                    break;
+                }
+                if (!display_widget_info()) {
+                    printf("Fail to display the list of installed widgets");
+                    return -1;
+                }
+                dispList = true;
+                break;
+
+            case 's':
+            case 'k':
+            case 'r':
+                strncpy(temp_arg, optarg, BUF_SIZE);
+                temp_arg[BUF_SIZE-1] = '\0';
+                op = next_opt;
+                break;
+
+            case 't':
+                timeout = atoi(optarg);
+                if (timeout < 0) {
+                    timeout = TIMEOUT_DEFAULT;
+                }
+                break;
+
+            case 'd':
+                isDebugMode = true;
+                break;
+
+            case -1:
+                break;
+
+            default:
+                print_help(stdout, 0);
+                break;
+            }
+        } while (next_opt != -1);
+
+        if ((op == 's') || (op == 'k') || (op == 'r')) {
+            std::string temp;
+
+            if (NULL == g_dbConnection.get()) {
+                Try {
+                    g_dbConnection.reset(new DBConnection());
+                    g_dbConnection->AttachDatabase();
+                }
+                Catch(DPL::DB::SqlConnection::Exception::Base) {
+                    WrtLogD("Fail to connect DB");
+                    return FALSE;
+                }
+            }
+            DPL::OptionalString normal_str = DPL::FromUTF8String(temp_arg);
+            WrtDB::NormalizeAndTrimSpaceString(normal_str);
+            std::string normal_arg = DPL::ToUTF8String(*normal_str);
+
+            WidgetDAOReadOnlyList widgetList =
+                WrtDB::WidgetDAOReadOnly::getWidgetList();
+            FOREACH(dao, widgetList) {
+                WrtDB::TizenAppId tizenAppId = (*dao)->getTizenAppId();
+                if (!strcmp(DPL::ToUTF8String(tizenAppId).c_str(),
+                            normal_arg.c_str()))
+                {
+                    temp = DPL::ToUTF8String(tizenAppId);
+                    break;
+                }
+            }
+            if (!temp.empty()) {
+                strncpy(applicationId, temp.c_str(), BUF_SIZE);
+                applicationId[BUF_SIZE-1] = '\0';
+            } else {
+                printf("result: %s\n", "failed");
+                return -1;
+            }
+        }
+
+        if (op == 's') {
+            if (strlen(applicationId) <= 0) {
+                printf("result: %s\n", "failed");
+                return -1;
+            }
+
+            // create app_control
+            ret = app_control_create(&app_control);
+            if (APP_CONTROL_ERROR_NONE != ret && NULL == app_control) {
+                printf("result: %s\n", "failed");
+                return -1;
+            }
+
+            // set package
+            ret = app_control_set_app_id(app_control, applicationId);
+            if (APP_CONTROL_ERROR_NONE != ret) {
+                printf("result: %s\n", "failed");
+                app_control_destroy(app_control);
+                return -1;
+            }
+
+            if (true == isDebugMode) {
+
+                char pkg_id[PKG_ID_LENGTH];
+                memset(pkg_id, '\0', PKG_ID_LENGTH);
+                snprintf(pkg_id, PKG_ID_LENGTH, "%s", applicationId);
+
+                //set SMACK label for debugging
+                if (set_debug_network_smack_rule((const char *)pkg_id)){
+                    WrtLogE("Add system::debugging_network smack rule failed");
+                    app_control_destroy(app_control);
+                    return FALSE;
+                }
+
+                // set debug mode
+                ret = app_control_add_extra_data(app_control, "debug", "true");
+                if (APP_CONTROL_ERROR_NONE != ret) {
+                    WrtLogE("Fail to set debug mode [%d]", ret);
+                    app_control_destroy(app_control);
+                    return FALSE;
+                }
+
+                // set pid
+                snprintf(pid, sizeof(pid), "%d", getpid());
+                ret = app_control_add_extra_data(app_control, "pid", pid);
+                if (APP_CONTROL_ERROR_NONE != ret) {
+                    WrtLogE("Fail to set pid [%d]", ret);
+                    app_control_destroy(app_control);
+                    return FALSE;
+                }
+
+                ecore_init();
+                app_control_Timer = ecore_timer_add(timeout, timerCallback, NULL);
+                ret = app_control_send_launch_request(app_control,
+                                                  app_control_ReplyCallback,
+                                                  app_control_Timer);
+            } else {
+                ret = app_control_send_launch_request(app_control, NULL, NULL);
+            }
+
+            if (APP_CONTROL_ERROR_NONE != ret) {
+                printf("result: %s\n", "");
+                app_control_destroy(app_control);
+                return -1;
+            }
+
+            app_control_destroy(app_control);
+
+            if (true == isDebugMode) {
+                // wait response from callee
+                ecore_main_loop_begin();
+                return 0;
+            } else {
+                // This text should be showed for IDE
+                printf("result: %s\n", "launched");
+            }
+            return 0;
+        } else if (op == 'k') {
+            bool isRunning = false;
+
+            //checks whether the application is running
+            ret = app_manager_is_running(applicationId, &isRunning);
+            if (APP_MANAGER_ERROR_NONE != ret) {
+                printf("result: %s\n", "failed");
+                return -1;
+            }
+
+            if (true == isRunning) {
+                // get app_context for running application
+                // app_context must be released with app_context_destroy
+                app_context_h appCtx = NULL;
+                ret = app_manager_get_app_context(applicationId, &appCtx);
+                if (APP_MANAGER_ERROR_NONE != ret) {
+                    printf("result: %s\n", "failed");
+                    return -1;
+                }
+
+                // terminate app_context_h
+                ret = app_manager_terminate_app(appCtx);
+                if (APP_MANAGER_ERROR_NONE != ret) {
+                    printf("result: %s\n", "failed");
+                    app_context_destroy(appCtx);
+                    return -1;
+                } else {
+                    printf("result: %s\n", "killed");
+                    app_context_destroy(appCtx);
+                    return 0;
+                }
+            } else {
+                printf("result: %s\n", "App isn't running");
+                return 0;
+            }
+        } else if (op == 'r') {
+            bool isRunning = false;
+            ret = app_manager_is_running(applicationId, &isRunning);
+
+            if (APP_MANAGER_ERROR_NONE != ret) {
+                printf("result: %s\n", "failed");
+                return -1;
+            }
+
+            if (true == isRunning) {
+                printf("result: %s\n", "running");
+                return 0;
+            } else {
+                printf("result: %s\n", "not running");
+                return -1;
+            }
+        }
+
+        return 0 ;
+    }
+    UNHANDLED_EXCEPTION_HANDLER_END
+}
+
diff --git a/src/wrt-launchpad-daemon/CMakeLists.txt b/src/wrt-launchpad-daemon/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0e1ad0b
--- /dev/null
@@ -0,0 +1,124 @@
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+# @file     CMakeLists.txt
+# @author   Tae-Jeong Lee (taejeong.lee@samsung.com)
+# @version     0.1
+#
+GROUP_DEPS(WRT_LAUNCH_PAD_DEPS DEPS
+    aul
+    dlog
+    app-checker
+    bundle
+    dbus-glib-1
+    glib
+    libsmack
+    libprivilege-control
+    x11
+    sqlite3
+    libsystemd-daemon
+    capi-appfw-application
+    rua
+)
+
+SET(WRT_LAUNCH_PAD_INCLUDE_DIRS
+    ${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/include
+    ${WRT_LAUNCH_PAD_DEPS_INCLUDE_DIRS}
+)
+
+INCLUDE_DIRECTORIES(${WRT_LAUNCH_PAD_INCLUDE_DIRS})
+
+SET(WRT_LAUNCH_PAD_SRCS
+    src/access_control.cpp
+    src/app_sock.cpp
+    src/process_pool.cpp
+    src/simple_util.cpp
+)
+
+IF(WRT_ENABLE_PRE_LAUNCH)
+SET(WRT_LAUNCH_PAD_SRCS
+    ${WRT_LAUNCH_PAD_SRCS}
+    src/pre_launching.cpp
+)
+ENDIF(WRT_ENABLE_PRE_LAUNCH)
+
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+SET(WRT_LAUNCH_PAD_SRCS
+    ${WRT_LAUNCH_PAD_SRCS}
+    src/launchpad_lite.cpp
+    src/web_app_core.cpp
+    src/web_app_core_data.cpp
+    src/web_app_core_tskmgr_util.cpp
+    src/web_app_core_x_util.cpp
+)
+ELSE(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+SET(WRT_LAUNCH_PAD_SRCS
+    ${WRT_LAUNCH_PAD_SRCS}
+    src/launchpad.cpp
+)
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+ADD_DEFINITIONS("-fPIE")
+
+#build executable
+ADD_EXECUTABLE( ${TARGET_WRT_LAUNCH_PAD_NAME}
+    ${WRT_LAUNCH_PAD_SRCS}
+)
+
+IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+#link libraries
+TARGET_LINK_LIBRARIES( ${TARGET_WRT_LAUNCH_PAD_NAME}
+    ${WRT_LAUNCH_PAD_DEPS_LIBRARIES}
+    ${TARGET_CLIENT_SUPPORT_STATIC}
+    ${TARGET_CORE_MODULE_LIB}
+    ${TARGET_WRT_EVENT_LOOP_LIB}
+    ${CMAKE_DL_LIBS}
+    "-lcap"
+    "-lXext"
+)
+ELSE(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+#link libraries
+TARGET_LINK_LIBRARIES( ${TARGET_WRT_LAUNCH_PAD_NAME}
+    ${WRT_LAUNCH_PAD_DEPS_LIBRARIES}
+    ${CMAKE_DL_LIBS}
+    "-lcap"
+)
+ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+
+#target properties
+SET_TARGET_PROPERTIES(${TARGET_WRT_LAUNCH_PAD_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_WRT_LAUNCH_PAD_NAME} PROPERTIES
+    LINK_FLAGS "-Wl,--as-needed -pie -Wl,--hash-style=both -Wl,--version-script=${PROJECT_SOURCE_DIR}/src/wrt-launchpad-daemon/${TARGET_WRT_LAUNCH_PAD_NAME}.map"
+    BUILD_WITH_INSTALL_RPATH ON
+    INSTALL_RPATH_USE_LINK_PATH ON
+)
+
+#install
+INSTALL(TARGETS ${TARGET_WRT_LAUNCH_PAD_NAME} DESTINATION bin)
+IF(PRODUCT_FEATURE_WRT_LITE)
+    IF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/data/preload_list_wrt_one_ui.in
+                   ${CMAKE_CURRENT_SOURCE_DIR}/data/preload_list_wrt.txt)
+    ELSE(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/data/preload_list_wrt_lite.in
+                   ${CMAKE_CURRENT_SOURCE_DIR}/data/preload_list_wrt.txt)
+    ENDIF(WRT_ENABLE_ONE_UI_PROCESS_MODEL)
+ELSE(PRODUCT_FEATURE_WRT_LITE)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/data/preload_list_wrt.in
+               ${CMAKE_CURRENT_SOURCE_DIR}/data/preload_list_wrt.txt)
+ENDIF(PRODUCT_FEATURE_WRT_LITE)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/preload_list_wrt.txt DESTINATION /usr/share/aul)
diff --git a/src/wrt-launchpad-daemon/data/preload_list_wrt.in b/src/wrt-launchpad-daemon/data/preload_list_wrt.in
new file mode 100644 (file)
index 0000000..52d38bc
--- /dev/null
@@ -0,0 +1,17 @@
+/usr/lib/libappcore-efl.so.1
+/usr/lib/libappcore-common.so.1
+/usr/lib/ecore/immodules/libisf-imf-module.so
+/usr/bin/wrt-client
+/usr/lib/libwrt-injected-bundle.so
+/usr/lib/wrt-plugins/w3c-widget-interface/libwrt-plugins-w3c-widget-interface.so
+/usr/lib/wrt-plugins/tizen-tizen/libwrt-plugins-tizen-tizen.so
+/usr/lib/wrt-plugins/mfc/libwrt-plugins-mfc.so
+/usr/lib/wrt-plugins/samsung-samsung/libwrt-plugins-samsung-samsung.so
+/usr/lib/wrt-plugins/sec-webapis/libwrt-plugins-sec-webapis.so
+/usr/lib/wrt-plugins/tizen-datacontrol/libwrt-plugins-tizen-datacontrol.so
+/usr/lib/wrt-plugins/tizen-application/libwrt-plugins-tizen-application.so
+/usr/lib/wrt-plugins/tizen-filesystem/libwrt-plugins-tizen-filesystem.so
+/usr/lib/wrt-plugins/tizen-timeutil/libwrt-plugins-tizen-timeutil.so
+/usr/lib/wrt-plugins/tizen-systeminfo/libwrt-plugins-tizen-systeminfo.so
+/usr/lib/wrt-plugins/tizen-messageport/libwrt-plugins-tizen-messageport.so
+/usr/lib/wrt-plugins/tizen-calendar/libwrt-plugins-tizen-calendar.so
diff --git a/src/wrt-launchpad-daemon/data/preload_list_wrt_lite.in b/src/wrt-launchpad-daemon/data/preload_list_wrt_lite.in
new file mode 100644 (file)
index 0000000..1e2b849
--- /dev/null
@@ -0,0 +1,8 @@
+/usr/lib/libappcore-efl.so.1
+/usr/lib/libappcore-common.so.1
+/usr/lib/ecore/immodules/libisf-imf-module.so
+/usr/bin/wrt-client
+/usr/lib/libwrt-injected-bundle.so
+/usr/lib/wrt-plugins/w3c-widget-interface/libwrt-plugins-w3c-widget-interface.so
+/usr/lib/wrt-plugins/tizen-tizen/libwrt-plugins-tizen-tizen.so
+/usr/lib/wrt-plugins/tizen-systeminfo/libwrt-plugins-tizen-systeminfo.so
diff --git a/src/wrt-launchpad-daemon/data/preload_list_wrt_one_ui.in b/src/wrt-launchpad-daemon/data/preload_list_wrt_one_ui.in
new file mode 100644 (file)
index 0000000..a974718
--- /dev/null
@@ -0,0 +1,4 @@
+/usr/lib/libappcore-efl.so.1
+/usr/lib/libappcore-common.so.1
+/usr/lib/ecore/immodules/libisf-imf-module.so
+/usr/lib/libewebkit2.so
diff --git a/src/wrt-launchpad-daemon/include/access_control.h b/src/wrt-launchpad-daemon/include/access_control.h
new file mode 100644 (file)
index 0000000..929a5fa
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef ACCESS_CONTROL_H_
+#define ACCESS_CONTROL_H_
+
+namespace AccessControl {
+int setPriviledge(const char* pkg_name, const char* pkg_type, const char* app_path);
+int setWLDPrivilege(void);
+int setWLDCapability(void);
+} // namespace AccessControl
+
+#endif //ACCESS_CONTROL_H_
+
diff --git a/src/wrt-launchpad-daemon/include/app_signal.h b/src/wrt-launchpad-daemon/include/app_signal.h
new file mode 100644 (file)
index 0000000..70bc099
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef __APP_DBUS_H__
+#define __APP_DBUS_H__
+
+#include <glib.h>
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+#define AUL_DBUS_PATH "/aul/dbus_handler"
+#define AUL_DBUS_SIGNAL_INTERFACE "org.tizen.aul.signal"
+#define AUL_DBUS_APPDEAD_SIGNAL "app_dead"
+#define AUL_DBUS_APPLAUNCH_SIGNAL       "app_launch"
+
+#endif
diff --git a/src/wrt-launchpad-daemon/include/app_sock.h b/src/wrt-launchpad-daemon/include/app_sock.h
new file mode 100644 (file)
index 0000000..b10a709
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef __APP_PKT_H_
+#define __APP_PKT_H_
+
+#include <unistd.h>
+#ifndef __USE_GNU
+#define __USE_GNU
+#endif
+#include <sys/socket.h>
+#include <linux/un.h>
+
+// forward declare
+struct ucred;
+
+enum app_cmd {
+    APP_START,
+    APP_OPEN,
+    APP_RESUME,
+    APP_RESUME_BY_PID,
+    APP_TERM_BY_PID,
+    APP_RESULT,
+    APP_START_RES,
+    APP_CANCEL,
+    APP_KILL_BY_PID,
+    APP_ADD_HISTORY,
+    APP_RUNNING_INFO,
+    APP_RUNNING_INFO_MEMORY,
+    APP_RUNNING_INFO_RESULT,
+    APP_IS_RUNNING,
+    APP_GET_APPID_BYPID,
+    APP_GET_PKGID_BYPID,
+    APP_GET_INFO_OK,
+    APP_GET_INFO_ERROR,
+    APP_KEY_EVENT,
+    APP_KEY_RESERVE,
+    APP_KEY_RELEASE,
+    APP_STATUS_UPDATE,
+    APP_RELEASED,
+    APP_RUNNING_LIST_UPDATE,
+    APP_TERM_REQ_BY_PID,
+    APP_START_ASYNC
+};
+
+#define AUL_SOCK_PREFIX "/tmp/alaunch"
+#define AUL_SOCK_MAXBUFF 65535
+#define LAUNCHPAD_PID -1
+#define WRT_LAUNCHPAD_PID -3
+#define ELOCALLAUNCH_ID 128
+
+typedef struct _app_pkt_t {
+    int cmd;
+    int len;
+    unsigned char data[1];
+} app_pkt_t;
+
+int __create_server_sock(int pid);
+int __create_client_sock(int pid);
+int __app_send_raw(int pid, int cmd, unsigned char *kb_data, int datalen);
+int __app_send_result_to_launchpad(int fd, int res);
+app_pkt_t *__app_recv_raw(int fd, int *clifd, struct ucred *cr);
+app_pkt_t *__app_send_cmd_with_result(int pid, int cmd);
+
+#endif
+
diff --git a/src/wrt-launchpad-daemon/include/config.h b/src/wrt-launchpad-daemon/include/config.h
new file mode 100644 (file)
index 0000000..355de2f
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef __LAUNCHPAD_CONFIG_H_
+#define __LAUNCHPAD_CONFIG_H_
+
+#define DAC_ACTIVATE
+#define PRELOAD_ACTIVATE
+#define PREEXEC_ACTIVATE
+/*#define GL_ACTIVATE*/
+/*#define HEAPDGB_ACTIVATE*/
+/*#define PERF_ACTIVATE*/
+
+#endif // __LAUNCHPAD_CONFIG_H_
diff --git a/src/wrt-launchpad-daemon/include/execute_on_whole_thread_util.h b/src/wrt-launchpad-daemon/include/execute_on_whole_thread_util.h
new file mode 100644 (file)
index 0000000..fde4e68
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    execute_on_whole_thread_util.h
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 1.0
+ */
+
+#ifndef __EXECUTE_ON_WHOLE_THREAD_UTIL_H__
+#define __EXECUTE_ON_WHOLE_THREAD_UTIL_H__
+
+#include <assert.h>
+#include <unistd.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <sys/syscall.h>
+
+// define
+#define _EXEC_FILE_MAX_LEN 1024
+#define _EXEC_MAX_RETRY_CNT 1000
+
+// typedef
+typedef void (*exec_func_t)();
+
+// static variable
+static exec_func_t  _s_exec_func    = NULL;
+static sighandler_t _s_prev_handler = NULL;
+static int _s_exec_waiting_task_cnt = 0;
+
+// internal function
+static void _exec_signal_handler(int signum)
+{
+    (void) signum;
+
+    if (_s_exec_func)
+    {
+        _s_exec_func();
+    }
+
+    _s_exec_waiting_task_cnt--;
+}
+
+static int _set_exec_signal_handler(int signum)
+{
+    sighandler_t ret;
+
+    ret = signal(signum, _exec_signal_handler);
+
+    if (ret == SIG_ERR)
+    {
+        return -1;
+    }
+    else
+    {
+        _s_prev_handler = ret;
+    }
+
+    return 0;
+}
+
+static int _restore_signal_handler(int signum)
+{
+    if (_s_prev_handler)
+    {
+        if (signal(signum, _s_prev_handler) == SIG_ERR)
+        {
+            return -1;
+        }
+
+        _s_prev_handler = NULL;
+    }
+    else
+    {
+        if (signal(signum, SIG_DFL) == SIG_ERR)
+        {
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+static int _send_signal_to_whole_thread(int signum)
+{
+    int ret;
+    DIR *dir;
+    struct dirent entry, *result;
+    char proc_self_task_path[_EXEC_FILE_MAX_LEN + 1] = {0, };
+
+    sprintf(proc_self_task_path, "/proc/self/task");
+
+    dir = opendir(proc_self_task_path);
+
+    if (dir)
+    {
+        for (ret = readdir_r(dir, &entry, &result);
+             result != NULL && ret == 0;
+             ret = readdir_r(dir, &entry, &result))
+        {
+            if (strncmp(entry.d_name, ".", 2) == 0 ||
+                strncmp(entry.d_name, "..", 3) == 0)
+            {
+                continue;
+            }
+
+            _s_exec_waiting_task_cnt++;
+            if (syscall(__NR_tkill, atoi(entry.d_name), signum) != 0)
+            {
+                // syscall failed
+                _s_exec_waiting_task_cnt--;
+            }
+        }
+
+        closedir(dir);
+    }
+    else
+    {
+        return -1;
+    }
+
+    return 0;
+}
+
+static int _is_main_thread()
+{
+    int pid = getpid();
+    int tid = syscall(__NR_gettid);
+
+    return (pid == tid);
+}
+
+static int _waiting_for_done()
+{
+    int i;
+
+    for (i=0; _s_exec_waiting_task_cnt && i < _EXEC_MAX_RETRY_CNT; i++)
+    {
+        usleep(100); // 0.1ms
+    }
+
+    if (i == _EXEC_MAX_RETRY_CNT)
+    {
+        // time over
+        return -1;
+    }
+
+    return 0;
+}
+
+// external API
+int EXECUTE_ON_WHOLE_THREAD(exec_func_t exec_func, int using_signum)
+{
+    int signum;
+
+    assert(_s_exec_waiting_task_cnt == 0 && exec_func != NULL);
+    assert(using_signum == SIGUSR1 || using_signum == SIGUSR2);
+
+    // check main thread
+    if (!_is_main_thread())
+    {
+        return -1;
+    }
+
+    signum       = using_signum;
+    _s_exec_func = exec_func;
+
+    // set signal handler
+    if (_set_exec_signal_handler(signum) != 0)
+    {
+        goto onerr_EXECUTE_ON_WHOLE_THREAD;
+    }
+
+    // send signal
+    if (_send_signal_to_whole_thread(signum) != 0)
+    {
+        goto onerr_EXECUTE_ON_WHOLE_THREAD;
+    }
+
+    // waiting
+    if (_waiting_for_done() != 0)
+    {
+        goto onerr_EXECUTE_ON_WHOLE_THREAD;
+    }
+
+    // restore signal handler to previous
+    _restore_signal_handler(signum);
+    _s_exec_waiting_task_cnt = 0;
+    _s_exec_func    = NULL;
+    _s_prev_handler = NULL;
+
+    return 0;
+
+
+onerr_EXECUTE_ON_WHOLE_THREAD:
+    _restore_signal_handler(signum);
+    _s_exec_waiting_task_cnt = 0;
+    _s_exec_func    = NULL;
+    _s_prev_handler = NULL;
+
+    return -1;
+}
+
+#endif // __EXECUTE_ON_WHOLE_THREAD_UTIL_H__
diff --git a/src/wrt-launchpad-daemon/include/launchpad_util.h b/src/wrt-launchpad-daemon/include/launchpad_util.h
new file mode 100755 (executable)
index 0000000..af40a53
--- /dev/null
@@ -0,0 +1,325 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    launchpad_util.h
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 0.1
+ * @brief   Api library to support launchpad operation.
+ */
+
+#ifndef __LAUNCHPAD_UTIL_H_
+#define __LAUNCHPAD_UTIL_H_
+
+#include <aul.h>
+#include <bundle.h>
+#include <errno.h>
+#include <privilege-control.h>
+#include <sys/prctl.h>
+#include <sys/capability.h>
+#include <unistd.h>
+#include <dpl/platform.h>
+
+#include "config.h"
+#include "app_sock.h"
+#include "menu_db_util.h"
+#include "simple_util.h"
+#include "access_control.h"
+
+#define _static_ static inline
+#define WRT_AUL_PR_NAME 16
+#define PKG_ID_LENGTH   11
+#define SDK_CODE_COVERAGE "CODE_COVERAGE"
+#define SDK_DYNAMIC_ANALYSIS "DYNAMIC_ANALYSIS"
+#define PATH_DA_SO "/home/developer/sdk_tools/da/da_probe.so"
+#define PATH_APP_ROOT "/opt/usr/apps"
+#define PATH_DATA "/data"
+
+// Prototype
+_static_ char** __create_argc_argv(bundle * kb, int *margc);
+_static_ void   __set_sdk_env(app_info_from_db* menu_info, char* str);
+_static_ int    __parser(const char *arg, char *out, int out_size);
+_static_ void   __modify_bundle(bundle * kb, int caller_pid, app_info_from_db * menu_info, int cmd);
+_static_ void   __set_env(app_info_from_db * menu_info, bundle * kb);
+_static_ void   __set_inherit_bit_for_CAP_MAC_ADMIN();
+
+// Implementation
+_static_ char** __create_argc_argv(bundle * kb, int *margc)
+{
+    char **argv;
+    int argc;
+
+    argc = bundle_export_to_argv(kb, &argv);
+
+    *margc = argc;
+    return argv;
+}
+
+_static_ void __set_sdk_env(app_info_from_db* menu_info, char* str)
+{
+    char buf[MAX_LOCAL_BUFSZ];
+    int ret;
+
+    WrtLogD("key : %s / value : %s", AUL_K_SDK, str);
+    /* http://gcc.gnu.org/onlinedocs/gcc/Cross_002dprofiling.html*/
+    /* GCOV_PREFIX contains the prefix to add to the absolute paths in the
+     *object file. */
+    /*         Prefix can be absolute, or relative. The default is no prefix.
+     * */
+    /* GCOV_PREFIX_STRIP indicates the how many initial directory names */
+    /*         to stripoff the hardwired absolute paths. Default value is 0. */
+    if (strncmp(str, SDK_CODE_COVERAGE, strlen(str)) == 0) {
+        snprintf(buf,
+                 MAX_LOCAL_BUFSZ,
+                 PATH_APP_ROOT "/%s"PATH_DATA,
+                 _get_pkgname(menu_info));
+        ret = setenv("GCOV_PREFIX", buf, 1);
+        WrtLogD("GCOV_PREFIX : %d", ret);
+        ret = setenv("GCOV_PREFIX_STRIP", "4096", 1);
+        WrtLogD("GCOV_PREFIX_STRIP : %d", ret);
+    } else if (strncmp(str, SDK_DYNAMIC_ANALYSIS, strlen(str)) == 0) {
+        ret = setenv("LD_PRELOAD", PATH_DA_SO, 1);
+        WrtLogD("LD_PRELOAD : %d", ret);
+    }
+}
+
+
+/*
+ * Parsing original app path to retrieve default bundle
+ *
+ * -1 : Invalid sequence
+ * -2 : Buffer overflow
+ *
+ */
+_static_ int __parser(const char *arg, char *out, int out_size)
+{
+    register int i;
+    int state = 1;
+    char *start_out = out;
+
+    if (arg == NULL || out == NULL) {
+        /* Handles null buffer*/
+        return 0;
+    }
+
+    for (i = 0; out_size > 1; i++) {
+        switch (state) {
+        case 1:
+            switch (arg[i]) {
+            case ' ':
+            case '\t':
+                state = 5;
+                break;
+            case '\0':
+                state = 7;
+                break;
+            case '\"':
+                state = 2;
+                break;
+            case '\\':
+                state = 4;
+                break;
+            default:
+                *out = arg[i];
+                out++;
+                out_size--;
+                break;
+            }
+            break;
+        case 2:         /* escape start*/
+            switch (arg[i]) {
+            case '\0':
+                state = 6;
+                break;
+            case '\"':
+                state = 1;
+                break;
+            default:
+                *out = arg[i];
+                out++;
+                out_size--;
+                break;
+            }
+            break;
+        case 4:         /* character escape*/
+            if (arg[i] == '\0') {
+                state = 6;
+            } else {
+                *out = arg[i];
+                out++;
+                out_size--;
+                state = 1;
+            }
+            break;
+        case 5:         /* token*/
+            if (out != start_out) {
+                *out = '\0';
+                out_size--;
+                return i;
+            }
+            i--;
+            state = 1;
+            break;
+        case 6:
+            return -1;                  /* error*/
+        case 7:         /* terminate*/
+            *out = '\0';
+            out_size--;
+            return 0;
+        default:
+            state = 6;
+            break;              /* error*/
+        }
+    }
+
+    if (out_size == 1) {
+        *out = '\0';
+    }
+    /* Buffer overflow*/
+    return -2;
+}
+
+
+_static_ void __modify_bundle(bundle * kb, int caller_pid,
+                              app_info_from_db * menu_info, int cmd)
+{
+    // warning: unused parameter
+    (void) caller_pid;
+
+#if !ENABLE(ONE_UI_PROCESS_MODEL)
+    bundle_del(kb, AUL_K_PKG_NAME);
+#endif
+    bundle_del(kb, AUL_K_EXEC);
+    bundle_del(kb, AUL_K_PACKAGETYPE);
+    bundle_del(kb, AUL_K_HWACC);
+
+    /* Parse app_path to retrieve default bundle*/
+    if (cmd == APP_START || cmd == APP_START_RES || cmd == APP_OPEN || cmd ==
+        APP_RESUME)
+    {
+        char *ptr;
+        char exe[MAX_PATH_LEN];
+        int flag;
+
+        ptr = _get_original_app_path(menu_info);
+
+        flag = __parser(ptr, exe, sizeof(exe));
+        if (flag > 0) {
+            char key[256];
+            char value[256];
+
+            ptr += flag;
+            WrtLogD("parsing app_path: EXEC - %s\n", exe);
+
+            do {
+                flag = __parser(ptr, key, sizeof(key));
+                if (flag <= 0) {
+                    break;
+                }
+                ptr += flag;
+
+                flag = __parser(ptr, value, sizeof(value));
+                if (flag < 0) {
+                    break;
+                }
+                ptr += flag;
+
+                /*bundle_del(kb, key);*/
+                bundle_add(kb, key, value);
+            } while (flag > 0);
+        } else if (flag == 0) {
+            WrtLogD("parsing app_path: No arguments\n");
+        } else {
+            WrtLogD("parsing app_path: Invalid argument\n");
+        }
+    }
+}
+
+_static_ void __set_env(app_info_from_db * menu_info, bundle * kb)
+{
+    const char *str;
+    const char **str_array;
+    int len;
+    int i;
+
+    if (menu_info->pkg_name == NULL) {
+        WrtLogE("menu_info's pkg_name is null");
+        return;
+    }
+
+    setenv("PKG_NAME", _get_pkgname(menu_info), 1);
+
+    str = bundle_get_val(kb, AUL_K_STARTTIME);
+    if (str != NULL) {
+        setenv("APP_START_TIME", str, 1);
+    }
+
+    if (bundle_get_type(kb, AUL_K_SDK) & BUNDLE_TYPE_ARRAY) {
+        str_array = bundle_get_str_array(kb, AUL_K_SDK, &len);
+        if (str_array != NULL) {
+            for (i = 0; i < len; i++) {
+                WrtLogD("index : [%d]", i);
+                __set_sdk_env(menu_info, (char *)str_array[i]);
+            }
+        }
+    } else {
+        str = bundle_get_val(kb, AUL_K_SDK);
+        if (str != NULL) {
+            __set_sdk_env(menu_info, (char *)str);
+        }
+    }
+    if (menu_info->hwacc != NULL) {
+        setenv("HWACC", menu_info->hwacc, 1);
+    }
+}
+
+_static_ void __set_inherit_bit_for_CAP_MAC_ADMIN()
+{
+    cap_t caps = NULL;
+    cap_value_t target_caps[] = { CAP_MAC_ADMIN };
+
+    caps = cap_init();
+
+    if (caps == NULL) {
+        goto err_set_inherit_bit_for_CAP_MAC_ADMIN;
+    }
+
+    if (cap_set_flag(caps, CAP_INHERITABLE,
+                     sizeof(target_caps)/sizeof(cap_value_t),
+                     target_caps, CAP_SET)) {
+        WrtLogE("cap_set_flag() failed!! : %s", strerror(errno));
+        goto err_set_inherit_bit_for_CAP_MAC_ADMIN;
+    }
+
+    if (cap_set_proc(caps)) {
+        WrtLogE("cap_set_proc() failed!! : %s", strerror(errno));
+        goto err_set_inherit_bit_for_CAP_MAC_ADMIN;
+    }
+
+    if (cap_free(caps)) {
+        WrtLogE("cap_free() failed!!");
+    }
+
+    return;
+
+err_set_inherit_bit_for_CAP_MAC_ADMIN:
+    if (caps != NULL) {
+        cap_free(caps);
+    }
+
+    return;
+}
+
+#endif // __LAUNCHPAD_UTIL_H_
diff --git a/src/wrt-launchpad-daemon/include/menu_db_util.h b/src/wrt-launchpad-daemon/include/menu_db_util.h
new file mode 100644 (file)
index 0000000..7d56233
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef __MENU_DB_UTIL_H_
+#define __MENU_DB_UTIL_H_
+
+#include <ail.h>
+#include <string.h>
+#include "simple_util.h"
+
+#define MAX_PATH_LEN    1024
+
+#define AUL_APP_INFO_FLD_PKG_NAME               "package"
+#define AUL_APP_INFO_FLD_APP_PATH               "exec"
+#define AUL_APP_INFO_FLD_APP_TYPE               "x_slp_packagetype"
+#define AUL_APP_INFO_FLD_WIDTH                  "x_slp_baselayoutwidth"
+#define AUL_APP_INFO_FLD_HEIGHT                 "x_slp_baselayoutheight"
+#define AUL_APP_INFO_FLD_VERTICAL               "x_slp_ishorizontalscale"
+#define AUL_APP_INFO_FLD_MULTIPLE               "x_slp_multiple"
+#define AUL_APP_INFO_FLD_TASK_MANAGE    "x_slp_taskmanage"
+#define AUL_APP_INFO_FLD_MIMETYPE               "mimetype"
+#define AUL_APP_INFO_FLD_SERVICE                "x_slp_service"
+
+#define AUL_RETRIEVE_PKG_NAME                   "package = '?'"
+#define AUL_RETRIEVE_APP_PATH                   "exec = '?'"
+#define AUL_RETRIEVE_MIMETYPE                   "mimetype like '?'"
+#define AUL_RETRIEVE_SERVICE                    "x_slp_service like '?'"
+
+typedef struct {
+    char *pkg_name;             /* package */
+    char *app_path;             /* exec */
+    char *original_app_path;            /* exec */
+    char *pkg_type;             /* x_slp_packagetype */
+    char *hwacc;                /* hwacceleration */
+} app_info_from_db;
+
+static inline char *_get_pkgname(app_info_from_db *menu_info)
+{
+    if (menu_info->pkg_name == NULL) {
+        return NULL;
+    }
+    return menu_info->pkg_name;
+}
+
+static inline char *_get_app_path(app_info_from_db *menu_info)
+{
+    int i = 0;
+    int path_len = -1;
+
+    if (menu_info->app_path == NULL) {
+        return NULL;
+    }
+
+    while (menu_info->app_path[i] != 0) {
+        if (menu_info->app_path[i] == ' '
+            || menu_info->app_path[i] == '\t')
+        {
+            path_len = i;
+            break;
+        }
+        i++;
+    }
+
+    if (path_len == 0) {
+        free(menu_info->app_path);
+        menu_info->app_path = NULL;
+    } else if (path_len > 0) {
+        char *tmp_app_path = (char *)malloc(sizeof(char) * (path_len + 1));
+        if (tmp_app_path == NULL) {
+            return NULL;
+        }
+        snprintf(tmp_app_path, path_len + 1, "%s", menu_info->app_path);
+        free(menu_info->app_path);
+        menu_info->app_path = tmp_app_path;
+    }
+
+    return menu_info->app_path;
+}
+
+static inline char *_get_original_app_path(app_info_from_db *menu_info)
+{
+    if (menu_info->original_app_path == NULL) {
+        return NULL;
+    }
+    return menu_info->original_app_path;
+}
+
+static inline void _free_app_info_from_db(app_info_from_db *menu_info)
+{
+    if (menu_info != NULL) {
+        if (menu_info->pkg_name != NULL) {
+            free(menu_info->pkg_name);
+        }
+        if (menu_info->app_path != NULL) {
+            free(menu_info->app_path);
+        }
+        if (menu_info->original_app_path != NULL) {
+            free(menu_info->original_app_path);
+        }
+        if (menu_info->hwacc != NULL) {
+            free(menu_info->hwacc);
+        }
+        free(menu_info);
+    }
+}
+
+static inline app_info_from_db *_get_app_info_from_db_by_pkgname(
+    const char *pkgname)
+{
+    app_info_from_db *menu_info;
+    ail_appinfo_h handle;
+    ail_error_e ret;
+    char *str = NULL;
+
+    menu_info = (app_info_from_db *)calloc(1, sizeof(app_info_from_db));
+    if (menu_info == NULL) {
+        return NULL;
+    }
+
+    ret = ail_get_appinfo(pkgname, &handle);
+    if (ret != AIL_ERROR_OK) {
+        _free_app_info_from_db(menu_info);
+        return NULL;
+    }
+
+    ret = ail_appinfo_get_str(handle, AIL_PROP_PACKAGE_STR, &str);
+    if (str) {
+        menu_info->pkg_name = strdup(str);
+        str = NULL;
+    }
+
+    ret = ail_appinfo_get_str(handle, AIL_PROP_EXEC_STR, &str);
+    if (str) {
+        menu_info->app_path = strdup(str);
+        str = NULL;
+    }
+
+    if (menu_info->app_path != NULL) {
+        menu_info->original_app_path = strdup(menu_info->app_path);
+    }
+
+    ret = ail_appinfo_get_str(handle, AIL_PROP_X_SLP_PACKAGETYPE_STR, &str);
+    if (str) {
+        menu_info->pkg_type = strdup(str);
+        str = NULL;
+    }
+
+    ret = ail_destroy_appinfo(handle);
+    if (ret != AIL_ERROR_OK) {
+        WrtLogE("ail_destroy_appinfo failed");
+    }
+
+    if (!_get_app_path(menu_info)) {
+        _free_app_info_from_db(menu_info);
+        return NULL;
+    }
+
+    return menu_info;
+}
+
+static inline ail_cb_ret_e __appinfo_func(const ail_appinfo_h appinfo,
+                                          void *user_data)
+{
+    app_info_from_db *menu_info = (app_info_from_db *)user_data;
+    char *package;
+
+    ail_appinfo_get_str(appinfo, AIL_PROP_PACKAGE_STR, &package);
+
+    menu_info->pkg_name = strdup(package);
+
+    return AIL_CB_RET_CANCEL;           /*return AIL_CB_RET_CONTINUE;*/
+}
+
+static inline app_info_from_db *_get_app_info_from_db_by_apppath(
+    const char *apppath)
+{
+    app_info_from_db *menu_info = NULL;
+    ail_filter_h filter;
+    ail_error_e ret;
+    int count;
+
+    if (apppath == NULL) {
+        return NULL;
+    }
+
+    menu_info = (app_info_from_db *)calloc(1, sizeof(app_info_from_db));
+    if (menu_info == NULL) {
+        return NULL;
+    }
+
+    ret = ail_filter_new(&filter);
+    if (ret != AIL_ERROR_OK) {
+        _free_app_info_from_db(menu_info);
+        return NULL;
+    }
+
+    ret = ail_filter_add_str(filter, AIL_PROP_X_SLP_EXE_PATH, apppath);
+    if (ret != AIL_ERROR_OK) {
+        ail_filter_destroy(filter);
+        _free_app_info_from_db(menu_info);
+        return NULL;
+    }
+
+    ret = ail_filter_count_appinfo(filter, &count);
+    if (ret != AIL_ERROR_OK) {
+        ail_filter_destroy(filter);
+        _free_app_info_from_db(menu_info);
+        return NULL;
+    }
+    if (count < 1) {
+        ail_filter_destroy(filter);
+        _free_app_info_from_db(menu_info);
+        return NULL;
+    }
+
+    ail_filter_list_appinfo_foreach(filter, __appinfo_func, (void *)menu_info);
+
+    ail_filter_destroy(filter);
+
+    menu_info->app_path = strdup(apppath);
+    menu_info->original_app_path = strdup(apppath);
+
+    return menu_info;
+}
+
+
+static inline app_info_from_db *_get_app_info_from_bundle_by_pkgname(
+    const char *pkgname, bundle *kb)
+{
+    app_info_from_db *menu_info;
+
+    menu_info = (app_info_from_db*)calloc(1, sizeof(app_info_from_db));
+    if (menu_info == NULL) {
+        return NULL;
+    }
+
+    menu_info->pkg_name = strdup(pkgname);
+    menu_info->app_path = strdup(bundle_get_val(kb, AUL_K_EXEC));
+    if (menu_info->app_path != NULL) {
+        menu_info->original_app_path = strdup(menu_info->app_path);
+    }
+    menu_info->pkg_type = strdup(bundle_get_val(kb, AUL_K_PACKAGETYPE));
+    menu_info->hwacc = strdup(bundle_get_val(kb, AUL_K_HWACC));
+
+    if (!_get_app_path(menu_info)) {
+        _free_app_info_from_db(menu_info);
+        return NULL;
+    }
+
+    return menu_info;
+}
+#endif //__MENU_DB_UTIL_H_
diff --git a/src/wrt-launchpad-daemon/include/pre_launching.h b/src/wrt-launchpad-daemon/include/pre_launching.h
new file mode 100644 (file)
index 0000000..db9ab38
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    pre_launching.h
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 1.0
+ * @brief   wrt pre-launching model api prototypes
+ */
+
+#ifndef __PRE_LAUNCHING_H_
+#define __PRE_LAUNCHING_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif //__cplusplus
+
+void pre_launch_webapps();
+void add_to_pre_launching_info_list(const char* app_id, int pid);
+int  re_pre_launch_by_pid(int pid, bool isCrashed);
+int  is_pre_launching_appid(const char* app_id);
+
+#ifdef __cplusplus
+}
+#endif //__cplusplus
+
+#endif //__PRE_LAUNCHING_H_
+
diff --git a/src/wrt-launchpad-daemon/include/preexec.h b/src/wrt-launchpad-daemon/include/preexec.h
new file mode 100644 (file)
index 0000000..02f7114
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifdef PREEXEC_ACTIVATE
+
+#include <dlfcn.h>
+#include <glib.h>
+#define PREEXEC_FILE SHARE_PREFIX "/preexec_list.txt"
+
+static int preexec_initialized = 0;
+
+GSList *preexec_list = NULL;
+
+typedef struct _preexec_list_t {
+    char *pkg_type;
+    char *so_path;
+    int (*dl_do_pre_exe)(char *, char *);
+    void *handle;
+} preexec_list_t;
+
+static void __preexec_list_free()
+{
+    GSList *iter = NULL;
+    preexec_list_t *type_t;
+
+    for (iter = preexec_list; iter != NULL; iter = g_slist_next(iter)) {
+        type_t = static_cast<preexec_list_t*>(iter->data);
+        if (type_t) {
+            if (type_t->pkg_type) {
+                free(type_t->pkg_type);
+            }
+            if (type_t->so_path) {
+                free(type_t->so_path);
+            }
+            if (type_t->handle) {
+                dlclose(type_t->handle);
+            }
+            free(type_t);
+        }
+    }
+    g_slist_free(preexec_list);
+    return;
+}
+
+static inline void __preexec_init(int argc, char **argv)
+{
+    void *handle = NULL;
+    FILE *preexec_file;
+    char *saveptr = NULL;
+    char line[MAX_LOCAL_BUFSZ] = { 0, };
+    char *type = NULL;
+    char *sopath = NULL;
+    char *symbol = NULL;
+    int (*func)(char *, char *) = NULL;
+    preexec_list_t *type_t = NULL;
+
+    // warning: unused parameter
+    argc = argc;
+    argv = argv;
+
+    preexec_file = fopen(PREEXEC_FILE, "rt");
+    if (preexec_file == NULL) {
+        WrtLogE("no preexec\n");
+        return;
+    }
+
+    WrtLogD("preexec start\n");
+
+    while (fgets(line, MAX_LOCAL_BUFSZ, preexec_file) > (char*)0) {
+        /* Parse each line */
+        if (line[0] == '#' || line[0] == '\0') {
+            continue;
+        }
+
+        type = strtok_r(line, ":\f\n\r\t\v ", &saveptr);
+        if (type == NULL) {
+            continue;
+        }
+        sopath = strtok_r(NULL, ",\f\n\r\t\v ", &saveptr);
+        if (sopath == NULL) {
+            continue;
+        }
+        symbol = strtok_r(NULL, ",\f\n\r\t\v ", &saveptr);
+        if (symbol == NULL) {
+            continue;
+        }
+
+        type_t = (preexec_list_t *) calloc(1, sizeof(preexec_list_t));
+        if (type_t == NULL) {
+            WrtLogE("no available memory\n");
+            __preexec_list_free();
+            fclose(preexec_file);
+            return;
+        }
+
+        handle = dlopen(sopath, RTLD_NOW);
+        if (handle == NULL) {
+            free(type_t);
+            continue;
+        }
+        WrtLogD("preexec %s %s# - handle : %p\n", type, sopath, handle);
+
+        func = reinterpret_cast<int (*)(char*, char*)>(dlsym(handle, symbol));
+        if (func == NULL) {
+            WrtLogE("failed to get symbol type:%s path:%s\n",
+               type, sopath);
+            free(type_t);
+            dlclose(handle);
+            handle = NULL;
+            continue;
+        }
+
+        type_t->pkg_type = strdup(type);
+        if (type_t->pkg_type == NULL) {
+            WrtLogE("no available memory\n");
+            free(type_t);
+            dlclose(handle);
+            handle = NULL;
+            __preexec_list_free();
+            fclose(preexec_file);
+            return;
+        }
+        type_t->so_path = strdup(sopath);
+        if (type_t->so_path == NULL) {
+            WrtLogE("no available memory\n");
+            free(type_t->pkg_type);
+            free(type_t);
+            dlclose(handle);
+            handle = NULL;
+            __preexec_list_free();
+            fclose(preexec_file);
+            return;
+        }
+        type_t->handle = handle;
+        type_t->dl_do_pre_exe = func;
+
+        preexec_list = g_slist_append(preexec_list, (void *)type_t);
+    }
+
+    fclose(preexec_file);
+    preexec_initialized = 1;
+}
+
+static inline void __preexec_run(const char *pkg_type, const char *pkg_name,
+                                 const char *app_path)
+{
+    GSList *iter = NULL;
+    preexec_list_t *type_t;
+
+    if (!preexec_initialized) {
+        return;
+    }
+
+    for (iter = preexec_list; iter != NULL; iter = g_slist_next(iter)) {
+        type_t = static_cast<preexec_list_t*>(iter->data);
+        if (type_t) {
+            if (!strcmp(pkg_type, type_t->pkg_type)) {
+                if (type_t->dl_do_pre_exe != NULL) {
+                    type_t->dl_do_pre_exe((char *)pkg_name,
+                                          (char *)app_path);
+                    WrtLogD("called dl_do_pre_exe() type: %s",
+                       pkg_type);
+                } else {
+                    WrtLogE("no symbol for this type: %s",
+                       pkg_type);
+                }
+            }
+        }
+    }
+}
+
+#else
+
+static inline void __preexec_init(int argc, char **argv)
+{}
+
+static inline void __preexec_run(const char *pkg_type, const char *pkg_name,
+                                 const char *app_path)
+{}
+
+#endif
diff --git a/src/wrt-launchpad-daemon/include/preload.h b/src/wrt-launchpad-daemon/include/preload.h
new file mode 100644 (file)
index 0000000..86b9961
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifdef PRELOAD_ACTIVATE
+
+#include <dlfcn.h>
+
+#define PRELOAD_FILE        SHARE_PREFIX "/preload_list.txt"
+#define PRELOAD_FILE_WRT    SHARE_PREFIX "/preload_list_wrt.txt"
+
+#define EFL_PREINIT_FUNC    "elm_quicklaunch_init"
+#define EFL_SHUTDOWN_FUNC   "elm_quicklaunch_shutdown"
+
+static int preload_initialized = 0;
+static int g_argc;
+static char **g_argv;
+static size_t max_cmdline_size = 0;
+
+typedef struct handle_list_t {
+    int (*dl_einit)();
+    int (*dl_efini)();
+    void *handle;
+} handle_list_t;
+
+static inline void __preload_init(int argc, char **argv)
+{
+    int i;
+
+    g_argc = argc;
+    g_argv = argv;
+    for (i = 0; i < argc; i++) {
+        max_cmdline_size += (strlen(argv[i]) + 1);
+    }
+    WrtLogD("max_cmdline_size = %d", max_cmdline_size);
+
+    preload_initialized = 1;
+}
+
+/* TODO : how to set cmdline gracefully ?? */
+static inline int __change_cmdline(char *cmdline)
+{
+    if (strlen(cmdline) > max_cmdline_size + 1) {
+        WrtLogE("cmdline exceed max size : %d", max_cmdline_size);
+        return -1;
+    }
+
+    memset(g_argv[0], '\0', max_cmdline_size);
+    snprintf(g_argv[0], max_cmdline_size, "%s", cmdline);
+
+    return 0;
+}
+
+static inline void __preload_exec(int argc, char **argv)
+{
+    void *handle = NULL;
+    int (*dl_main)(int, char **);
+
+    if (!preload_initialized) {
+        return;
+    }
+
+    handle = dlopen(argv[0], RTLD_LAZY | RTLD_GLOBAL);
+    if (handle == NULL) {
+        WrtLogE("dlopen failed. bad preloaded app - check fpie pie");
+        return;
+    }
+
+    dl_main = reinterpret_cast<int (*)(int, char **)>(dlsym(handle, "main"));
+    if (dl_main != NULL) {
+#ifndef NATIVE_LAUNCHPAD
+        /* do nothing */
+#else
+        if (__change_cmdline(argv[0]) < 0) {
+            WrtLogE("change cmdline fail");
+            return;
+        }
+#endif
+        dl_main(argc, argv);
+    } else {
+        WrtLogE("dlsym not founded. bad preloaded app - check fpie pie");
+    }
+
+    exit(0);
+}
+
+static int g_wrt_dlopen_size = 5;
+static int g_wrt_dlopen_count = 0;
+static void** g_wrt_dlopen_handle_list = NULL;
+
+static inline int __preload_save_dlopen_handle(void *handle)
+{
+    if (!handle) {
+        return 1;
+    }
+    if (g_wrt_dlopen_count == g_wrt_dlopen_size || !g_wrt_dlopen_handle_list) {
+        void** tmp = static_cast<void**>(realloc(g_wrt_dlopen_handle_list, 2 * g_wrt_dlopen_size * sizeof(void *)));
+        if (NULL == tmp) {
+            WrtLogE("out of memory\n");
+            dlclose(handle);
+            return 1;
+        }
+        g_wrt_dlopen_size *= 2;
+        g_wrt_dlopen_handle_list = tmp;
+    }
+    g_wrt_dlopen_handle_list[g_wrt_dlopen_count++] = handle;
+    return 0;
+}
+
+static inline void __preload_fini_for_wrt()
+{
+    int i = 0;
+    if (!g_wrt_dlopen_handle_list) {
+        return;
+    }
+    for (i = 0; i < g_wrt_dlopen_count; ++i)
+    {
+        void *handle = g_wrt_dlopen_handle_list[i];
+        if (handle) {
+            if (0 != dlclose(handle)) {
+                WrtLogE("dlclose failed\n");
+            }
+        }
+    }
+    free(g_wrt_dlopen_handle_list);
+    g_wrt_dlopen_handle_list = NULL;
+    g_wrt_dlopen_size = 5;
+    g_wrt_dlopen_count = 0;
+}
+
+static inline void __preload_init_for_wrt()
+{
+    if (0 != atexit(__preload_fini_for_wrt)) {
+        WrtLogE("Cannot register atexit callback. Libraries will not be unloaded");
+    }
+    void *handle = NULL;
+    FILE *preload_list;
+    char *soname =(char*)malloc(sizeof(char)*MAX_LOCAL_BUFSZ);
+    char soname_untaint[MAX_LOCAL_BUFSZ] = {0};
+
+    if (!soname) {
+        WrtLogE("Error allocating mem for soname\n");
+        return;
+    }
+
+    preload_list = fopen(PRELOAD_FILE_WRT, "rt");
+    if (preload_list == NULL) {
+        WrtLogE("no wrt preload\n");
+        free(soname);
+        return;
+    }
+
+    while (fgets(soname, MAX_LOCAL_BUFSZ, preload_list) != NULL) {
+        strcpy(soname_untaint,soname);
+        memset(soname,'\0',MAX_LOCAL_BUFSZ);
+        size_t len = strnlen(soname_untaint, MAX_LOCAL_BUFSZ);
+        if (len > 0) {
+            soname_untaint[len - 1] = '\0';
+        }
+        handle = dlopen(soname_untaint, RTLD_NOW | RTLD_GLOBAL);
+        if (handle == NULL) {
+            WrtLogE("dlopen(\"%s\") was failed!", soname_untaint);
+            memset(soname_untaint,'\0',MAX_LOCAL_BUFSZ);
+            continue;
+        }
+        if (0 != __preload_save_dlopen_handle(handle)) {
+            WrtLogE("Cannot save handle, no more preloads");
+            break;
+        }
+        WrtLogD("preload %s# - handle : %p\n", soname_untaint, handle);
+        memset(soname_untaint,'\0',MAX_LOCAL_BUFSZ);
+    }
+
+    fclose(preload_list);
+    free(soname);
+}
+
+#else
+
+static inline void __preload_init(int argc, char **argv);
+static inline void __preload_exec(int argc, char **argv);
+static inline void __preload_init_for_wrt();
+
+#endif
+
diff --git a/src/wrt-launchpad-daemon/include/process_pool.h b/src/wrt-launchpad-daemon/include/process_pool.h
new file mode 100644 (file)
index 0000000..4a1ed38
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    process_pool.h
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 0.1
+ * @brief   process pool socket api prototypes
+ */
+
+#ifndef __PROCESS_POOL_H_
+#define __PROCESS_POOL_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif //__cplusplus
+
+#include <app_sock.h>
+
+int  __create_process_pool_server();
+int  __connect_process_pool_server();
+int  __accept_dummy_process(int server_fd, int* out_client_fd, int* out_client_pid);
+void __refuse_dummy_process(int server_fd);
+int  __send_pkt_raw_data(int client_fd, app_pkt_t* pkt);
+
+#ifdef __cplusplus
+}
+#endif //__cplusplus
+
+#endif //__PROCESS_POOL_H_
+
diff --git a/src/wrt-launchpad-daemon/include/process_pool_launchpad_util.h b/src/wrt-launchpad-daemon/include/process_pool_launchpad_util.h
new file mode 100644 (file)
index 0000000..979723b
--- /dev/null
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    process_pool_launchpad_util.h
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 0.1
+ * @brief   Api library to support launchpad operation.
+ */
+
+#ifndef __PROCESS_POOL_LAUNCHPAD_UTIL_H_
+#define __PROCESS_POOL_LAUNCHPAD_UTIL_H_
+
+#include <stdlib.h>
+#include <launchpad_util.h>
+#include <smack_labeling_support.h>
+#include <execute_on_whole_thread_util.h>
+
+// Prototype
+_static_ int    __process_pool_prepare_exec(const char *pkg_name, const char *app_path, app_info_from_db * menu_info, bundle * kb);
+_static_ void   process_pool_launchpad_main_loop(app_pkt_t* pkt, char* out_app_path, int* out_argc, char ***out_argv);
+
+// Implementation
+_static_ int __process_pool_prepare_exec(const char *pkg_name,
+                            const char *app_path, app_info_from_db * menu_info,
+                            bundle * kb)
+{
+    const char *file_name;
+    char process_name[WRT_AUL_PR_NAME];
+
+    /* SET PRIVILEGES*/
+    char pkg_id[PKG_ID_LENGTH];
+    memset(pkg_id, '\0', PKG_ID_LENGTH);
+    snprintf(pkg_id, PKG_ID_LENGTH, "%s", pkg_name);
+
+    if (set_app_smack_label(app_path) != 0)
+    {
+        WrtLogE("set_app_smack_label() failed");
+    }
+
+    if (AccessControl::setPriviledge(pkg_id, menu_info->pkg_type, app_path) < 0) {
+        WrtLogD("fail to set privileges - check your package's credential\n");
+        return -1;
+    }
+
+    /* SET INHERIT BIT FOR CAP_MAC_ADMIN TO WHOLE THREAD */
+    EXECUTE_ON_WHOLE_THREAD(__set_inherit_bit_for_CAP_MAC_ADMIN, SIGUSR1);
+
+    /* SET PROCESS NAME*/
+    if (app_path == NULL) {
+        WrtLogD("app_path should not be NULL - check menu db");
+        return -1;
+    }
+    file_name = strrchr(app_path, '/');
+    if (file_name == NULL) {
+        WrtLogD("can't locate file name to execute");
+        return -1;
+    }
+
+    memset(process_name, '\0', WRT_AUL_PR_NAME);
+    snprintf(process_name, WRT_AUL_PR_NAME, "%s", file_name + 1);
+    prctl(PR_SET_NAME, process_name);
+
+    /* SET ENVIROMENT*/
+    __set_env(menu_info, kb);
+
+    return 0;
+}
+
+
+static bundle *_s_bundle = NULL;
+static void __at_exit_to_release_bundle()
+{
+    if (_s_bundle) {
+        bundle_free(_s_bundle);
+        _s_bundle = NULL;
+    }
+}
+
+_static_ void process_pool_launchpad_main_loop(app_pkt_t* pkt, char* out_app_path, int* out_argc, char ***out_argv)
+
+{
+    bundle *kb = NULL;
+    app_info_from_db *menu_info = NULL;
+
+    const char *pkg_name = NULL;
+    const char *app_path = NULL;
+
+    kb = bundle_decode(pkt->data, pkt->len);
+    if (!kb) {
+        WrtLogE("bundle decode error");
+        exit(-1);
+    }
+
+    if (_s_bundle != NULL) {
+        bundle_free(_s_bundle);
+    }
+    _s_bundle = kb;
+    atexit(__at_exit_to_release_bundle);
+
+    pkg_name = bundle_get_val(kb, AUL_K_PKG_NAME);
+    SECURE_LOGD("pkg name : %s", pkg_name);
+
+    menu_info = _get_app_info_from_bundle_by_pkgname(pkg_name, kb);
+    if (menu_info == NULL) {
+        WrtLogD("such pkg no found");
+        exit(-1);
+    }
+
+    app_path = _get_app_path(menu_info);
+
+    if (app_path == NULL) {
+        WrtLogE("app_path is NULL");
+        exit(-1);
+    }
+
+    if (app_path[0] != '/') {
+        WrtLogE("app_path is not absolute path");
+        exit(-1);
+    }
+
+    __modify_bundle(kb, /*cr.pid - unused parameter*/ 0, menu_info, pkt->cmd);
+    pkg_name = _get_pkgname(menu_info);
+    SECURE_LOGD("pkg name : %s", pkg_name);
+
+    __process_pool_prepare_exec(pkg_name, app_path, menu_info, kb);
+
+    if (out_app_path != NULL && out_argc != NULL && out_argv != NULL)
+    {
+        int i;
+
+        sprintf(out_app_path, "%s", app_path);
+
+        *out_argv = __create_argc_argv(kb, out_argc);
+        (*out_argv)[0] = out_app_path;
+
+        for (i = 0; i < *out_argc; i++)
+        {
+            WrtLogD("input argument %d : %s##", i, (*out_argv)[i]);
+        }
+    }
+    else
+    {
+        exit(-1);
+    }
+
+    if (menu_info != NULL) {
+        _free_app_info_from_db(menu_info);
+    }
+}
+
+#endif // __PROCESS_POOL_LAUNCHPAD_UTIL_H_
diff --git a/src/wrt-launchpad-daemon/include/sigchild.h b/src/wrt-launchpad-daemon/include/sigchild.h
new file mode 100644 (file)
index 0000000..5f62b5f
--- /dev/null
@@ -0,0 +1,281 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef SIG_CHILD_H
+#define SIG_CHILD_H
+
+#include <dirent.h>
+#include <sys/wait.h>
+
+#include <dpl/platform.h>
+
+#include "app_signal.h"
+#if ENABLE(PRE_LAUNCH)
+#include "pre_launching.h"
+#endif
+
+static struct sigaction old_sigchild;
+static DBusConnection *bus = NULL;
+static sigset_t oldmask;
+
+static inline void __socket_garbage_collector()
+{
+    DIR *dp;
+    struct dirent dentry;
+    struct dirent *result;
+    char tmp[MAX_LOCAL_BUFSZ];
+
+    dp = opendir(AUL_SOCK_PREFIX);
+    if (dp == NULL) {
+        return;
+    }
+
+    while (readdir_r(dp, &dentry, &result) == 0 && result != NULL) {
+        if (!isdigit(dentry.d_name[0])) {
+            continue;
+        }
+
+        snprintf(tmp, MAX_LOCAL_BUFSZ, "/proc/%s", dentry.d_name);
+        if (access(tmp, F_OK) < 0) {            /* Flawfinder: ignore */
+            snprintf(tmp, MAX_LOCAL_BUFSZ, "%s/%s", AUL_SOCK_PREFIX,
+                    dentry.d_name);
+            unlink(tmp);
+            continue;
+        }
+    }
+    closedir(dp);
+}
+
+static inline int __send_app_dead_signal(int dead_pid)
+{
+    DBusMessage *message;
+
+    if (bus == NULL) {
+        return -1;
+    }
+
+    message = dbus_message_new_signal(AUL_DBUS_PATH,
+                                      AUL_DBUS_SIGNAL_INTERFACE,
+                                      AUL_DBUS_APPDEAD_SIGNAL);
+
+    if (dbus_message_append_args(message,
+                                 DBUS_TYPE_UINT32, &dead_pid,
+                                 DBUS_TYPE_INVALID) == FALSE)
+    {
+        WrtLogE("Failed to load data error");
+        return -1;
+    }
+
+    if (dbus_connection_send(bus, message, NULL) == FALSE) {
+        WrtLogE("dbus send error");
+        return -1;
+    }
+
+    dbus_connection_flush(bus);
+    dbus_message_unref(message);
+
+    WrtLogD("send dead signal done\n");
+
+    return 0;
+}
+
+static inline int __send_app_launch_signal(int launch_pid)
+{
+    DBusMessage *message;
+
+    if (bus == NULL) {
+        return -1;
+    }
+
+    message = dbus_message_new_signal(AUL_DBUS_PATH,
+                                      AUL_DBUS_SIGNAL_INTERFACE,
+                                      AUL_DBUS_APPLAUNCH_SIGNAL);
+
+    if (dbus_message_append_args(message,
+                                 DBUS_TYPE_UINT32, &launch_pid,
+                                 DBUS_TYPE_INVALID) == FALSE)
+    {
+        WrtLogE("Failed to load data error");
+        return -1;
+    }
+
+    if (dbus_connection_send(bus, message, NULL) == FALSE) {
+        WrtLogE("dbus send error");
+        return -1;
+    }
+
+    dbus_connection_flush(bus);
+    dbus_message_unref(message);
+
+    WrtLogD("send launch signal done\n");
+
+    return 0;
+}
+
+static int __sigchild_action(void *data)
+{
+    pid_t dead_pid;
+    char buf[MAX_LOCAL_BUFSZ];
+
+    dead_pid = (pid_t) data;
+    if (dead_pid <= 0) {
+        goto end;
+    }
+
+    __send_app_dead_signal(dead_pid);
+
+    snprintf(buf, MAX_LOCAL_BUFSZ, "%s/%d", AUL_SOCK_PREFIX, dead_pid);
+    unlink(buf);
+
+    __socket_garbage_collector();
+end:
+    return 0;
+}
+
+static void __launchpad_sig_child(int signo, siginfo_t *info, void *data)
+{
+    int status;
+    pid_t child_pid;
+    pid_t child_pgid;
+
+    // warning: unused parameter
+    (void)signo;
+    (void)data;
+
+    child_pgid = getpgid(info->si_pid);
+    WrtLogD("dead_pid = %d pgid = %d", info->si_pid, child_pgid);
+
+    while ((child_pid = waitpid(-1, &status, WNOHANG)) > 0) {
+        if (child_pid == child_pgid) {
+            killpg(child_pgid, SIGKILL);
+        }
+        __sigchild_action((void *)child_pid);
+    }
+
+#if ENABLE(PRE_LAUNCH)
+    re_pre_launch_by_pid(child_pgid, (info->si_code==CLD_DUMPED));
+#endif
+
+    return;
+}
+
+static inline int __signal_init(void)
+{
+    int i;
+    for (i = 0; i < _NSIG; i++) {
+        switch (i) {
+        /* controlled by sys-assert package*/
+        case SIGQUIT:
+        case SIGILL:
+        case SIGABRT:
+        case SIGBUS:
+        case SIGFPE:
+        case SIGSEGV:
+        case SIGPIPE:
+            break;
+        default:
+            signal(i, SIG_DFL);
+            break;
+        }
+    }
+
+    return 0;
+}
+
+static inline int __signal_set_sigchld(void)
+{
+    struct sigaction act;
+    DBusError error;
+
+    dbus_error_init(&error);
+    dbus_threads_init_default();
+    bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error);
+    if (!bus) {
+        WrtLogE("Failed to connect to the D-BUS daemon: %s", error.message);
+        dbus_error_free(&error);
+        return -1;
+    }
+    /* TODO: if process stop mechanism is included,
+     * should be modified (SA_NOCLDSTOP)*/
+    act.sa_handler = NULL;
+    act.sa_sigaction = __launchpad_sig_child;
+    sigemptyset(&act.sa_mask);
+    act.sa_flags = SA_NOCLDSTOP | SA_SIGINFO;
+
+    if (sigaction(SIGCHLD, &act, &old_sigchild) < 0) {
+        return -1;
+    }
+
+    return 0;
+}
+
+static inline int __signal_unset_sigchld(void)
+{
+    struct sigaction dummy;
+
+    if (bus == NULL) {
+        return 0;
+    }
+
+    dbus_connection_close(bus);
+    dbus_connection_unref(bus);
+    if (sigaction(SIGCHLD, &old_sigchild, &dummy) < 0) {
+        return -1;
+    }
+
+    return 0;
+}
+
+static inline int __signal_block_sigchld(void)
+{
+    sigset_t newmask;
+
+    sigemptyset(&newmask);
+    sigaddset(&newmask, SIGCHLD);
+
+    if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0) {
+        WrtLogE("SIG_BLOCK error");
+        return -1;
+    }
+
+    WrtLogD("SIGCHLD blocked");
+
+    return 0;
+}
+
+static inline int __signal_unblock_sigchld(void)
+{
+    if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0) {
+        WrtLogE("SIG_SETMASK error");
+        return -1;
+    }
+
+    WrtLogD("SIGCHLD unblocked");
+    return 0;
+}
+
+static inline int __signal_fini(void)
+{
+#ifndef PRELOAD_ACTIVATE
+    int i;
+    for (i = 0; i < _NSIG; i++) {
+        signal(i, SIG_DFL);
+    }
+#endif
+    return 0;
+}
+
+#endif // #ifndef SIG_CHILD_H
diff --git a/src/wrt-launchpad-daemon/include/simple_util.h b/src/wrt-launchpad-daemon/include/simple_util.h
new file mode 100644 (file)
index 0000000..f9c9fd5
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef __SIMPLE_UTIL__
+#define __SIMPLE_UTIL__
+
+#include <unistd.h>
+#include <ctype.h>
+#include <dpl/log/wrt_log.h>
+
+#define MAX_LOCAL_BUFSZ 128
+#define MAX_PID_STR_BUFSZ 20
+
+#define retvm_if(expr, val, fmt, arg ...) do { \
+    if (expr) { \
+        WrtLogE(fmt,##arg); \
+        WrtLogE("(%s) -> %s() return", #expr, __FUNCTION__); \
+        return (val); \
+    } \
+} while (0)
+
+#define retv_if(expr, val) do { \
+    if (expr) { \
+        WrtLogE("(%s) -> %s() return", #expr, __FUNCTION__); \
+        return (val); \
+    } \
+} while (0)
+
+int __proc_iter_cmdline(int (*iterfunc)
+                        (const char *dname, const char *cmdline, void *priv),
+                        void *priv);
+int __proc_iter_pgid(int pgid, int (*iterfunc)(int pid, void *priv),
+                     void *priv);
+char *__proc_get_cmdline_bypid(int pid);
+
+static inline const char *FILENAME(const char *filename)
+{
+    const char *p;
+    const char *r;
+
+    if (!filename) {
+        return NULL;
+    }
+
+    r = p = filename;
+    while (*p) {
+        if (*p == '/') {
+            r = p + 1;
+        }
+        p++;
+    }
+
+    return r;
+}
+
+#endif
diff --git a/src/wrt-launchpad-daemon/include/web_app_core.h b/src/wrt-launchpad-daemon/include/web_app_core.h
new file mode 100644 (file)
index 0000000..f6a6ae5
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+ /**
+ * @file    web_app_core.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+#ifndef WEB_APP_CORE_H_
+#define WEB_APP_CORE_H_
+
+#include <memory>
+#include <string>
+#include <Ecore_X.h>
+
+#include <bundle.h>
+#include <Ecore.h>
+
+#include <app_sock.h>
+#include <web_app_core_data.h>
+#include <web_app_manager.h>
+
+class WebAppCore {
+  public:
+    WebAppCore();
+    virtual ~WebAppCore();
+
+    bool initialize();
+    bool launchRequest(int argc, char* argv[]);
+    void setPidToAppID(const char* appId, unsigned int pid);
+    void aulSocketHandler(app_pkt_t* pkt, int clifd, ucred cr);
+
+  private:
+
+    bool addEcoreXWindowHandlers();
+    static Eina_Bool ecoreXWindowShowCallback(void* data, int type, void* event);
+    static Eina_Bool ecoreXWindowHideCallback(void* data, int type, void* event);
+    static Eina_Bool ecoreXWindowVisibilityChangeCallback(void* data, int type, void* event);
+    static Eina_Bool ecoreXWindowEventClientCallback(void *data, int type, void *event);
+    static Eina_Bool terminateEventCallback(void *data, int type, void *event);
+    static Eina_Bool popupReplyWaitEventAulHandler(void* data, Ecore_Fd_Handler* handler);
+    static Eina_Bool popupReplyWaitStartEventCallback(void *data, int type, void *event);
+    static Eina_Bool popupReplyWaitFinishEventCallback(void *data, int type, void *event);
+
+    bool m_initialized;
+    std::unique_ptr<WebAppManager> m_manager;
+    std::unique_ptr<WebAppCoreDataManager> m_webAppCoreDataManager;
+
+    Ecore_X_Atom m_atomParent;
+    Ecore_Event_Handler* m_ecoreEventWindowShowHandler;
+    Ecore_Event_Handler* m_ecoreEventHideWindowShowHandler;
+    Ecore_Event_Handler* m_ecoreEventVisibilityChangeHandler;
+    Ecore_Event_Handler* m_ecoreEventTaskMgrImageCreationHandler;
+};
+
+#endif // WEB_APP_CORE_H_
diff --git a/src/wrt-launchpad-daemon/include/web_app_core_data.h b/src/wrt-launchpad-daemon/include/web_app_core_data.h
new file mode 100644 (file)
index 0000000..a923956
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+ /**
+ * @file    web_app_core_data.h
+ * @author  Leerang Song (leerang.song@samsung.com)
+ */
+#ifndef WEB_APP_CORE_DATA_H_
+#define WEB_APP_CORE_DATA_H_
+
+#include <map>
+#include <string>
+#include <unistd.h>
+
+#include <Ecore.h>
+
+class WebAppCoreDataManager {
+  public:
+    enum class Status {
+        CREATED,
+        RUNNING,
+        SUSPENDED
+    };
+
+    WebAppCoreDataManager();
+    virtual ~WebAppCoreDataManager();
+
+    bool add(const std::string& appId);
+    bool remove(const std::string& appId);
+
+    void show(const std::string& appId);
+    void hide(const std::string& appId);
+    void resume(const std::string& appId);
+    void suspend(const std::string& appId);
+
+    bool isResumed(const std::string& appId);
+    bool isSuspended(const std::string& appId);
+    bool isAppIdFound(const std::string& appId);
+
+    void setPid(const std::string& appId, pid_t pid);
+    pid_t getPid(const std::string& appId);
+    void setFd(const std::string& appId, Ecore_Fd_Handler* fd);
+    Ecore_Fd_Handler* getFd(const std::string& appId);
+    std::string getAppIdFromFd(int fd);
+
+  private:
+    typedef struct webAppCoreData {
+        Status status;
+        pid_t pid;
+        Ecore_Fd_Handler* fd;
+    } WebAppCoreData;
+
+    typedef std::map<std::string, WebAppCoreData*> WebAppCoreDataMap;
+    typedef std::pair<std::string, WebAppCoreData*> WebAppCoreDataPair;
+
+    WebAppCoreDataMap m_webAppCoreDataMap;
+
+    Status getStatus(const std::string& appId);
+    void setStatus(const std::string& appId, Status status);
+    bool compareStatus(const std::string& appId, Status status);
+};
+
+#endif // WEB_APP_CORE_DATA_H_
diff --git a/src/wrt-launchpad-daemon/include/web_app_core_tskmgr_util.h b/src/wrt-launchpad-daemon/include/web_app_core_tskmgr_util.h
new file mode 100755 (executable)
index 0000000..92c5f5b
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+ /**
+ * @file    web_app_core_tskmgr_util.h
+ * @author  prathmesh (prathmesh.m@samsung.com)
+ */
+#ifndef WEB_APP_CORE_TSKMGR_UTIL_H_
+#define WEB_APP_CORE_TSKMGR_UTIL_H_
+
+#include <Ecore_X.h>
+
+void captureAndMakeFileForTaskMgr(Ecore_X_Window win, const char* package);
+
+#endif //WEB_APP_CORE_TSKMGR_UTIL_H_
\ No newline at end of file
diff --git a/src/wrt-launchpad-daemon/include/web_app_core_x_util.h b/src/wrt-launchpad-daemon/include/web_app_core_x_util.h
new file mode 100755 (executable)
index 0000000..a054f5f
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file    web_app_core_x_util.h
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#ifndef WEB_APP_CORE_X_UTIL_H_
+#define WEB_APP_CORE_X_UTIL_H_
+
+#include <unistd.h>
+
+namespace WebAppCoreXUtil {
+bool raiseWin(pid_t pid);
+} // napespace WebAppCoreXUtil
+
+#endif // WEB_APP_CORE_X_UTIL_H_
\ No newline at end of file
diff --git a/src/wrt-launchpad-daemon/include/web_internal_eventloop.h b/src/wrt-launchpad-daemon/include/web_internal_eventloop.h
new file mode 100644 (file)
index 0000000..521259b
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+ /**
+ * @file    web_internal_eventloop.h
+ * @author  Prathmesh (prathmesh.m@samsung.com)
+ */
+#ifndef WEB_INTERNAL_EVENTLOOP_H_
+#define WEB_INTERNAL_EVENTLOOP_H_
+
+#define SUPPORT_MULTIPLE_REQUEST 1
+
+#include <memory>
+#include <Ecore.h>
+#include <dpl/singleton.h>
+#ifdef SUPPORT_MULTIPLE_REQUEST
+#include <map>
+#endif
+
+
+class WebInternalEvent
+{
+  public:
+    enum webInternalEventType {
+        POPUP_REPLY_WAIT_START,
+        POPUP_REPLY_WAIT_FINISH,
+        WEB_APP_TERMINATE,
+        WEB_APP_START_POOL_PROCESS,
+        WEB_APP_MAX // TODO - Add more events if required before this SUPPORT_MULTIPLE_REQUEST
+    };
+    void addListner(webInternalEventType type, Ecore_Event_Handler_Cb cbFunc, void *data);
+    void deleteListner(webInternalEventType type);
+    void sendEvent(webInternalEventType type, void *eventInfo);
+    static void freeEventInfo(void *user_data, void *func_data);
+    static Eina_Bool eventTriggeredCallback(void *data, int type, void *event);
+
+  private:
+    WebInternalEvent();
+    ~WebInternalEvent();
+
+#ifdef SUPPORT_MULTIPLE_REQUEST
+    typedef struct callbackData {
+        int m_event;
+        Ecore_Event_Handler_Cb m_callerCallback;
+        void *m_data;
+    }WebInternalUserCBData;
+
+    typedef std::map<int, WebInternalUserCBData*> WebInternalEventMap;
+    typedef std::pair<int, WebInternalUserCBData*> WebInternalEventPair;
+    WebInternalEventMap m_webInternalEventMap;
+#else
+    int m_backEvent;
+    void *m_callerData;
+    Ecore_Event_Handler_Cb m_callerCallback;
+#endif // SUPPORT_MULTIPLE_REQUEST
+    Ecore_Event_Handler *m_customEventHandler;
+    friend class DPL::Singleton<WebInternalEvent>;
+};
+
+typedef DPL::Singleton<WebInternalEvent> WebInternalEventSingleton;
+
+#endif // WEB_INTERNAL_EVENTLOOP_H_
diff --git a/src/wrt-launchpad-daemon/src/access_control.cpp b/src/wrt-launchpad-daemon/src/access_control.cpp
new file mode 100644 (file)
index 0000000..f616339
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include <errno.h>
+#include <grp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/capability.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <privilege-control.h>
+
+#include "access_control.h"
+#include "config.h"
+#include "simple_util.h"
+
+namespace {
+const char* const APP_USER_NAME = "app";
+const char* const APP_HOME_DIR = "/home/app";
+const char* const APP_GROUP_PATH = "/usr/share/privilege-control/2.2.1/app_group_list";
+const int APP_UID = 5000;
+const int APP_GID = 5000;
+} // anonymous namespace
+
+#ifdef DAC_ACTIVATE
+
+int AccessControl::setPriviledge(const char* pkg_name, const char* pkg_type, const char* app_path)
+{
+    return perm_app_set_privilege(pkg_name, pkg_type, app_path);
+}
+
+#else
+
+int AccessControl::setPriviledge(const char* pkg_name, const char* pkg_type, const char* app_path)
+{
+    return 0;
+}
+
+#endif
+
+int AccessControl::setWLDPrivilege(void)
+{
+    WrtLogD("setAccessForWLD");
+
+    // get app group info
+    FILE* fp = NULL;
+    if(!(fp = fopen(APP_GROUP_PATH, "r"))) {
+        WrtLogE("fopen failed.");
+        return -1;
+    }
+
+    int cnt = 0;
+    gid_t* glist = NULL;
+    char buf[10] = {0, };
+    while(fgets(buf, 10, fp) != NULL) {
+        errno = 0;
+        gid_t temp = strtoul(buf, 0, 10);
+        if(errno != 0) {
+            WrtLogE("Cannot change string to integer: %s", buf);
+            goto error;
+        }
+
+        glist = (gid_t*)realloc(glist, sizeof(gid_t) * (cnt + 1));
+        if(!glist) {
+            WrtLogE("Cannot allocate memory");
+            goto error;
+        }
+        glist[cnt] = temp;
+        cnt++;
+    }
+    fclose(fp);
+    fp = NULL;
+
+    // setgroups()
+    if(setgroups(cnt, glist) != 0) {
+        WrtLogE("setgroups failed");
+        goto error;
+    }
+    if(glist != NULL) {
+        free(glist);
+        glist = NULL;
+    }
+
+    // setuid() & setgid()
+    if(setgid(APP_GID) != 0) {
+        WrtLogE("Failed to execute setgid().");
+        goto error;
+    }
+    if(setuid(APP_UID) != 0) {
+        WrtLogE("Failed to execute setuid().");
+        goto error;
+    }
+
+    // setenv()
+    if(setenv("USER", APP_USER_NAME, 1) != 0) {
+        WrtLogE("Failed to execute setenv() USER");
+        goto error;
+    }
+    if(setenv("HOME", APP_HOME_DIR, 1) != 0) {
+        WrtLogE("Failed to execute setenv() HOME");
+        goto error;
+    }
+
+    return 0;
+
+error:
+    if(fp != NULL) {
+        fclose(fp);
+    }
+    if(glist != NULL) {
+        free(glist);
+    }
+
+    return -1;
+}
+
+int AccessControl::setWLDCapability(void)
+{
+    cap_user_header_t header;
+    cap_user_data_t data;
+
+    header = static_cast<cap_user_header_t>(malloc(sizeof(*header)));
+    if (header == NULL) {
+        WrtLogE("memory allocation error");
+        return -1;
+    }
+
+    data = static_cast<cap_user_data_t>(calloc(sizeof(*data), _LINUX_CAPABILITY_U32S_3));
+    if (data == NULL) {
+        WrtLogE("memory allocation error");
+        free(header);
+        return -1;
+    }
+
+    header->pid = getpid();
+    header->version = _LINUX_CAPABILITY_VERSION_3;
+
+    // read already granted capabilities of this process
+    if (capget(header, data) < 0) {
+        WrtLogE("capget error");
+        free(header);
+        free(data);
+        return -1;
+    }
+
+    // set only inheritable bit for CAP_MAC_ADMIN to '1'
+    data[CAP_TO_INDEX(CAP_MAC_ADMIN)].inheritable |= CAP_TO_MASK(CAP_MAC_ADMIN);
+
+    // remove capabilities not needed any more
+    data[CAP_TO_INDEX(CAP_MAC_ADMIN)].permitted &= ~CAP_TO_MASK(CAP_MAC_ADMIN);
+    data[CAP_TO_INDEX(CAP_MAC_ADMIN)].effective &= ~CAP_TO_MASK(CAP_MAC_ADMIN);
+    data[CAP_TO_INDEX(CAP_SETPCAP)].permitted &= ~CAP_TO_MASK(CAP_SETPCAP);
+    data[CAP_TO_INDEX(CAP_SETPCAP)].effective &= ~CAP_TO_MASK(CAP_SETPCAP);
+
+    int ret = 0;
+    if (capset(header, data) < 0) {
+        WrtLogE("capset error");
+        ret = -1;
+    }
+
+    free(header);
+    free(data);
+
+    return ret;
+}
+
diff --git a/src/wrt-launchpad-daemon/src/app_sock.cpp b/src/wrt-launchpad-daemon/src/app_sock.cpp
new file mode 100644 (file)
index 0000000..ba5bd6b
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/smack.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <time.h>
+#include <systemd/sd-daemon.h>
+
+#include "app_sock.h"
+#include "simple_util.h"
+
+static int __connect_client_sock(int sockfd,
+                                 const struct sockaddr *saptr,
+                                 socklen_t salen,
+                                 int nsec);
+
+static inline int __set_sock_option(int fd, int cli)
+{
+    int size;
+    struct timeval tv = { 3, 200 * 1000 };    /*  3.2 sec */
+
+    size = AUL_SOCK_MAXBUFF;
+    if (0 != setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size)) ||
+        0 != setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)))
+    {
+        return 1;
+    }
+    if (cli && 0 != setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv))) {
+        return 1;
+    }
+    return 0;
+}
+
+int __create_server_sock(int pid)
+{
+    struct sockaddr_un saddr;
+    struct sockaddr_un p_saddr;
+    int fd;
+
+    fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
+    // support above version 2.6.27
+    if (fd < 0) {
+        if (errno == EINVAL) {
+            fd = socket(AF_UNIX, SOCK_STREAM, 0);
+            if (fd < 0) {
+                WrtLogE("second chance - socket create error");
+                return -1;
+            }
+        } else {
+            WrtLogE("socket error");
+            return -1;
+        }
+    }
+
+    memset(&saddr, 0, sizeof(saddr));
+    saddr.sun_family = AF_UNIX;
+    snprintf(saddr.sun_path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, pid);
+    unlink(saddr.sun_path);
+
+    // labeling to socket for SMACK
+    if(getuid() == 0) {
+        // this is meaningful iff current user is ROOT
+        if(smack_fsetlabel(fd, "@", SMACK_LABEL_IPOUT) != 0) {
+            // in case of unsupported filesystem on 'socket'
+            // or permission error by using 'emulator', bypass
+            if((errno != EOPNOTSUPP) && (errno != EPERM)) {
+                WrtLogE("labeling to socket(IPOUT) error");
+                close(fd);
+                return -1;
+            }
+        }
+        if(smack_fsetlabel(fd, "*", SMACK_LABEL_IPIN) != 0) {
+            // in case of unsupported filesystem on 'socket'
+            // or permission error by using 'emulator', bypass
+            if((errno != EOPNOTSUPP) && (errno != EPERM)) {
+                WrtLogE("labeling to socket(IPIN) error");
+                close(fd);
+                return -1;
+            }
+        }
+    }
+
+    if (bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) {
+        WrtLogE("bind error");
+        close(fd);
+        return -1;
+    }
+
+    if (chmod(saddr.sun_path, (S_IRWXU | S_IRWXG | S_IRWXO)) < 0) {
+        // Flawfinder: ignore
+        WrtLogE("failed to change the socket permission");
+        close(fd);
+        return -1;
+    }
+
+    if (0 != __set_sock_option(fd, 0)) {
+        close(fd);
+        return -1;
+    }
+
+    if (listen(fd, 128) == -1) {
+        WrtLogE("listen error");
+        close(fd);
+        return -1;
+    }
+
+    // support app launched by shell script
+    if (pid != WRT_LAUNCHPAD_PID) {
+        int pgid;
+        pgid = getpgid(pid);
+        if (pgid > 1) {
+            snprintf(p_saddr.sun_path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, pgid);
+            if (link(saddr.sun_path, p_saddr.sun_path) < 0) {
+                if (errno == EEXIST) {
+                    WrtLogD("pg path - already exists");
+                } else {
+                    WrtLogE("pg path - unknown create error");
+                }
+            }
+        }
+    }
+
+    return fd;
+}
+
+int __create_client_sock(int pid)
+{
+    int fd = -1;
+    struct sockaddr_un saddr;
+    int retry = 1;
+    int ret = -1;
+
+    memset(&saddr, 0x00, sizeof(struct sockaddr_un));
+
+    fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
+    /*  support above version 2.6.27*/
+    if (fd < 0) {
+        if (errno == EINVAL) {
+            fd = socket(AF_UNIX, SOCK_STREAM, 0);
+            if (fd < 0) {
+                WrtLogE("second chance - socket create error");
+                return -1;
+            }
+        } else {
+            WrtLogE("socket error");
+            return -1;
+        }
+    }
+
+    saddr.sun_family = AF_UNIX;
+    snprintf(saddr.sun_path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, pid);
+
+    while ((ret = __connect_client_sock(fd, (struct sockaddr *)&saddr, sizeof(saddr),
+            100 * 1000)) < -1) {
+        WrtLogE("maybe peer not launched or peer daed\n");
+        if (retry > 0) {
+            struct timespec duration = { 0, 100 * 1000 * 1000 };
+            nanosleep(&duration, NULL);     /* 100ms sleep*/
+            retry--;
+        }
+        else break;
+    }
+
+    if (ret < 0) {
+        close(fd);
+        return -1;
+    }
+
+    if (0 != __set_sock_option(fd, 1)) {
+        close(fd);
+        return -1;
+    }
+
+    return fd;
+}
+
+static int __connect_client_sock(int fd,
+                                 const struct sockaddr *saptr,
+                                 socklen_t salen,
+                                 int nsec)
+{
+    int flags;
+    int ret;
+    int error;
+    socklen_t len;
+    fd_set readfds;
+    fd_set writefds;
+    struct timeval timeout;
+
+    flags = fcntl(fd, F_GETFL, 0);
+    if (0 != fcntl(fd, F_SETFL, flags | O_NONBLOCK)) {
+        return -1;
+    }
+
+    error = 0;
+    if ((ret = connect(fd, (struct sockaddr *)saptr, salen)) < 0) {
+        if (errno != EAGAIN && errno != EINPROGRESS) {
+            (void) fcntl(fd, F_SETFL, flags);
+            return (-2);
+        }
+    }
+
+    /* Do whatever we want while the connect is taking place. */
+    if (ret == 0) {
+        goto done;    /* connect completed immediately */
+    }
+    FD_ZERO(&readfds);
+    FD_SET(fd, &readfds);
+    writefds = readfds;
+    timeout.tv_sec = 0;
+    timeout.tv_usec = nsec;
+
+    if ((ret = select(fd + 1, &readfds, &writefds, NULL,
+                      nsec ? &timeout : NULL)) == 0) {
+        close(fd);    /* timeout */
+        errno = ETIMEDOUT;
+        return (-1);
+    }
+
+    if (FD_ISSET(fd, &readfds) || FD_ISSET(fd, &writefds)) {
+        len = sizeof(error);
+        if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
+            return (-1);    /* Solaris pending error */
+        }
+    }
+    else {
+        return (-1);    /* select error: sockfd not set*/
+    }
+
+done:
+    (void) fcntl(fd, F_SETFL, flags);
+    if (error) {
+        close(fd);
+        errno = error;
+        return (-1);
+    }
+    return (0);
+}
+
+/**
+ * @brief      Send data (in raw) to the process with 'pid' via socket
+ */
+int __app_send_raw(int pid, int cmd, unsigned char *kb_data, int datalen)
+{
+    int fd;
+    int len;
+    int res = 0;
+    app_pkt_t *pkt = NULL;
+
+    if (kb_data == NULL || datalen > AUL_SOCK_MAXBUFF - 8) {
+        WrtLogE("keybundle error\n");
+        return -EINVAL;
+    }
+
+    fd = __create_client_sock(pid);
+    if (fd < 0) {
+        return -ECOMM;
+    }
+
+    pkt = (app_pkt_t *) malloc(sizeof(char) * AUL_SOCK_MAXBUFF);
+    if (NULL == pkt) {
+        WrtLogE("Malloc Failed!");
+        return -ENOMEM;
+    }
+    memset(pkt, 0, AUL_SOCK_MAXBUFF);
+
+    pkt->cmd = cmd;
+    pkt->len = datalen;
+    memcpy(pkt->data, kb_data, datalen);
+
+    if ((len = send(fd, pkt, datalen + 8, 0)) != datalen + 8) {
+        WrtLogE("sendto() failed - %d %d (errno %d)", len, datalen + 8, errno);
+        if (errno == EPIPE) {
+            WrtLogE("pid:%d, fd:%d\n", pid, fd);
+        }
+        close(fd);
+        if (pkt) {
+            free(pkt);
+            pkt = NULL;
+        }
+        return -ECOMM;
+    }
+    if (pkt) {
+        free(pkt);
+        pkt = NULL;
+    }
+
+    len = recv(fd, &res, sizeof(int), 0);
+    if (len == -1) {
+        if (errno == EAGAIN) {
+            WrtLogE("recv timeout \n");
+            res = -EAGAIN;
+        } else {
+            WrtLogE("recv error\n");
+            res = -ECOMM;
+        }
+    }
+    close(fd);
+
+    return res;
+}
+
+int __app_send_result_to_launchpad(int fd, int res)
+{
+    if (send(fd, &res, sizeof(int), MSG_NOSIGNAL) < 0) {
+        if (errno == EPIPE) {
+            WrtLogE("send failed due to EPIPE.");
+            close(fd);
+            return -1;
+        }
+        WrtLogE("send fail to client");
+    }
+    close(fd);
+    return 0;
+}
+
+app_pkt_t *__app_recv_raw(int fd, int *clifd, struct ucred *cr)
+{
+    int len;
+    struct sockaddr_un aul_addr;
+    int sun_size;
+    app_pkt_t *pkt = NULL;
+    int cl = sizeof(struct ucred);
+
+    memset(&aul_addr, 0x00, sizeof(struct sockaddr_un));
+    sun_size = sizeof(struct sockaddr_un);
+
+    if ((*clifd = accept(fd, (struct sockaddr *)&aul_addr,
+                         (socklen_t *) &sun_size)) == -1)
+    {
+        if (errno != EINTR) {
+            WrtLogE("accept error");
+        }
+        return NULL;
+    }
+
+    if (getsockopt(*clifd, SOL_SOCKET, SO_PEERCRED, cr,
+                  (socklen_t *) &cl) < 0)
+    {
+        WrtLogE("peer information error");
+        close(*clifd);
+        return NULL;
+    }
+
+    pkt = (app_pkt_t *) malloc(sizeof(char) * AUL_SOCK_MAXBUFF);
+    if(pkt == NULL) {
+        close(*clifd);
+        return NULL;
+    }
+    memset(pkt, 0, AUL_SOCK_MAXBUFF);
+
+    if (0 != __set_sock_option(*clifd, 1)) {
+            free(pkt);
+            close(*clifd);
+            return NULL;
+    }
+
+retry_recv:
+    /* receive single packet from socket */
+    len = recv(*clifd, pkt, AUL_SOCK_MAXBUFF, 0);
+    if (len < 0) {
+        if (errno == EINTR) {
+            goto retry_recv;
+        }
+    }
+
+    if ((len < 8) || (len != (pkt->len + 8))) {
+        WrtLogE("recv error %d %d", len, pkt->len);
+        free(pkt);
+        close(*clifd);
+        return NULL;
+    }
+
+    return pkt;
+}
+
+app_pkt_t *__app_send_cmd_with_result(int pid, int cmd)
+{
+    int fd;
+    int len;
+    app_pkt_t *pkt = NULL;
+
+    fd = __create_client_sock(pid);
+    if (fd < 0) {
+        return NULL;
+    }
+
+    pkt = (app_pkt_t *) malloc(sizeof(char) * AUL_SOCK_MAXBUFF);
+    if (NULL == pkt) {
+        WrtLogE("Malloc Failed!");
+        return NULL;
+    }
+    memset(pkt, 0, AUL_SOCK_MAXBUFF);
+
+    pkt->cmd = cmd;
+    pkt->len = 0;
+
+    if ((len = send(fd, pkt, 8, 0)) != 8) {
+        WrtLogE("sendto() failed - %d", len);
+        if (errno == EPIPE) {
+            WrtLogE("pid:%d, fd:%d\n", pid, fd);
+        }
+        close(fd);
+
+        free(pkt);
+        return NULL;
+    }
+
+retry_recv:
+    /* receive single packet from socket */
+    len = recv(fd, pkt, AUL_SOCK_MAXBUFF, 0);
+    if (len == -1) {
+        if (errno == EAGAIN) {
+            WrtLogE("recv timeout \n");
+            free(pkt);
+            return NULL;
+        } else if (errno == EINTR) {
+            goto retry_recv;
+        } else {
+            WrtLogE("recv error %s\n", strerror(errno));
+            free(pkt);
+            return NULL;
+        }
+    } else {
+        WrtLogD("recv result  = %d", len);
+    }
+    close(fd);
+
+    return pkt;
+}
+
diff --git a/src/wrt-launchpad-daemon/src/launchpad.cpp b/src/wrt-launchpad-daemon/src/launchpad.cpp
new file mode 100644 (file)
index 0000000..cb8f521
--- /dev/null
@@ -0,0 +1,777 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+/*
+ * simple AUL daemon - launchpad
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <dlfcn.h>
+#include <X11/Xlib.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <poll.h>
+#include <sys/prctl.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <malloc.h>
+
+#include "app_sock.h"
+#include <aul.h>
+
+#include "config.h"
+
+#include "menu_db_util.h"
+#include "simple_util.h"
+#include "access_control.h"
+#include "preload.h"
+#include "preexec.h"
+#include "sigchild.h"
+
+#include <app-checker.h>
+#include <sqlite3.h>
+
+#include "process_pool.h"
+#include "launchpad_util.h"
+
+#if ENABLE(PRE_LAUNCH)
+#include "pre_launching.h"
+#endif
+
+#define _static_ static inline
+#define SQLITE_FLUSH_MAX    (1048576)       /* (1024*1024) */
+#define AUL_POLL_CNT        15
+#define AUL_PR_NAME         16
+#define PKG_ID_LENGTH       11
+
+#define EXEC_DUMMY_EXPIRED 5
+#define DIFF(a,b) (((a)>(b))?(a)-(b):(b)-(a))
+#define WRT_CLIENT_PATH "/usr/bin/wrt-client"
+#define LOWEST_PRIO 20
+#define DUMMY_NONE 0
+
+static char *launchpad_cmdline;
+static int initialized = 0;
+static int dummy_process_pid    = DUMMY_NONE;
+static int dummy_process_fd     = -1;
+static int last_dummy_exec_time = 0;
+static int process_pool_disable = 0;
+
+_static_ int __prepare_exec(const char *pkg_name,
+                            const char *app_path, app_info_from_db * menu_info,
+                            bundle * kb);
+_static_ int __fake_launch_app(int cmd, int pid, bundle * kb);
+_static_ char **__create_argc_argv(bundle * kb, int *margc);
+_static_ void __real_launch(const char *app_path, bundle * kb);
+_static_ int __dummy_launch(int dummy_client_fd, app_pkt_t* pkt);
+_static_ int __send_to_sigkill(int pid);
+_static_ int __term_app(int pid);
+_static_ int __real_send(int clifd, int ret);
+_static_ void __send_result_to_caller(int clifd, int ret);
+_static_ void __launchpad_exec_dummy(int main_fd, int pool_fd, int client_fd);
+_static_ void __launchpad_main_loop(int main_fd, int pool_fd);
+_static_ int __launchpad_pre_init(int argc, char **argv);
+_static_ int __launchpad_post_init();
+
+extern ail_error_e ail_db_close(void);
+
+_static_ int __prepare_exec(const char *pkg_name,
+                            const char *app_path, app_info_from_db * menu_info,
+                            bundle * kb)
+{
+    const char* file_name;
+    char process_name[AUL_PR_NAME];
+
+    /* Set new session ID & new process group ID*/
+    /* In linux, child can set new session ID without check permission */
+    /* TODO : should be add to check permission in the kernel*/
+    setsid();
+
+    __preexec_run(menu_info->pkg_type, pkg_name, app_path);
+
+    /* SET PRIVILEGES*/
+    char pkg_id[PKG_ID_LENGTH];
+    memset(pkg_id, '\0', PKG_ID_LENGTH);
+    snprintf(pkg_id, PKG_ID_LENGTH, "%s", pkg_name);
+
+    /* SET PR_SET_KEEPCAPS */
+    if (prctl(PR_SET_KEEPCAPS, 1) < 0) {
+        WrtLogE("prctl(PR_SET_KEEPCAPS) failed.");
+    }
+
+    if (AccessControl::setPriviledge(pkg_id, menu_info->pkg_type, app_path) < 0) {
+        WrtLogD("fail to set privileges - check your package's credential\n");
+        return -1;
+    }
+
+    __set_inherit_bit_for_CAP_MAC_ADMIN();
+
+    /* SET DUMPABLE - for coredump*/
+    prctl(PR_SET_DUMPABLE, 1);
+
+    /* SET PROCESS NAME*/
+    if (app_path == NULL) {
+        WrtLogD("app_path should not be NULL - check menu db");
+        return -1;
+    }
+    file_name = strrchr(app_path, '/');
+    if (file_name == NULL) {
+        WrtLogD("can't locate file name to execute");
+        return -1;
+    }
+    memset(process_name, '\0', AUL_PR_NAME);
+    snprintf(process_name, AUL_PR_NAME, "%s", file_name + 1);
+    prctl(PR_SET_NAME, process_name);
+
+    /* SET ENVIROMENT*/
+    __set_env(menu_info, kb);
+
+    return 0;
+}
+
+_static_ int __fake_launch_app(int cmd, int pid, bundle * kb)
+{
+    int datalen;
+    int ret;
+    bundle_raw *kb_data;
+
+    bundle_encode(kb, &kb_data, &datalen);
+    if ((ret = __app_send_raw(pid, cmd, kb_data, datalen)) < 0) {
+        WrtLogE("error request fake launch - error code = %d", ret);
+    }
+    free(kb_data);
+    return ret;
+}
+
+_static_ void __real_launch(const char *app_path, bundle * kb)
+{
+    int app_argc;
+    char **app_argv;
+    int i;
+
+    app_argv = __create_argc_argv(kb, &app_argc);
+
+#ifndef NATIVE_LAUNCHPAD
+    if (__change_cmdline((char *)app_path) < 0) {
+        WrtLogE("change cmdline fail");
+        return;
+    }
+
+    app_argv[0] = g_argv[0];
+#else
+    app_argv[0] = strdup(app_path);
+#endif
+
+    for (i = 0; i < app_argc; i++) {
+        WrtLogD("input argument %d : %s##", i, app_argv[i]);
+    }
+
+    WrtLogE("lock up test log(no error) : setup argument done");
+
+    /* Temporary log: launch time checking */
+    LOG(LOG_DEBUG, "LAUNCH", "[%s:Platform:launchpad:done]", app_path);
+
+    __preload_exec(app_argc, app_argv);
+}
+
+_static_ int __dummy_launch(int dummy_client_fd, app_pkt_t* pkt)
+{
+    return __send_pkt_raw_data(dummy_client_fd, pkt);
+}
+
+_static_ int __send_to_sigkill(int pid)
+{
+    int pgid;
+
+    pgid = getpgid(pid);
+    if (pgid <= 1) {
+        return -1;
+    }
+
+    if (killpg(pgid, SIGKILL) < 0) {
+        return -1;
+    }
+
+    return 0;
+}
+
+_static_ int __term_app(int pid)
+{
+    int dummy;
+    if (__app_send_raw
+            (pid, APP_TERM_BY_PID, (unsigned char *)&dummy, sizeof(int)) < 0)
+    {
+        WrtLogD("terminate packet send error - use SIGKILL");
+        if (__send_to_sigkill(pid) < 0) {
+            WrtLogE("fail to killing - %d\n", pid);
+            return -1;
+        }
+    }
+    WrtLogD("term done\n");
+    return 0;
+}
+
+static int __get_caller_pid(bundle *kb)
+{
+    const char *pid_str;
+    int pid;
+
+    pid_str = bundle_get_val(kb, AUL_K_ORG_CALLER_PID);
+    if (pid_str) {
+        goto end;
+    }
+
+    pid_str = bundle_get_val(kb, AUL_K_CALLER_PID);
+    if (pid_str == NULL) {
+        return -1;
+    }
+
+end:
+    pid = atoi(pid_str);
+    if (pid <= 1) {
+        return -1;
+    }
+
+    return pid;
+}
+
+_static_ int __foward_cmd(int cmd, bundle *kb, int cr_pid)
+{
+    int pid;
+    char tmp_pid[MAX_PID_STR_BUFSZ];
+    int datalen;
+    bundle_raw *kb_data;
+    int res;
+
+    if ((pid = __get_caller_pid(kb)) < 0) {
+        return AUL_R_ERROR;
+    }
+
+    snprintf(tmp_pid, MAX_PID_STR_BUFSZ, "%d", cr_pid);
+
+    bundle_add(kb, AUL_K_CALLEE_PID, tmp_pid);
+
+    bundle_encode(kb, &kb_data, &datalen);
+    if ((res = __app_send_raw(pid, cmd, kb_data, datalen)) < 0) {
+        res = AUL_R_ERROR;
+    }
+
+    free(kb_data);
+
+    return res;
+}
+
+_static_ int __real_send(int clifd, int ret)
+{
+    if (send(clifd, &ret, sizeof(int), MSG_NOSIGNAL) < 0) {
+        if (errno == EPIPE) {
+            WrtLogE("send failed due to EPIPE.\n");
+            close(clifd);
+            return -1;
+        }
+        WrtLogE("send fail to client");
+    }
+
+    close(clifd);
+    return 0;
+}
+
+_static_ void __send_result_to_caller(int clifd, int ret)
+{
+    char *cmdline;
+    int wait_count;
+    int cmdline_changed = 0;
+    int cmdline_exist = 0;
+    int r;
+
+    if (clifd == -1) {
+        return;
+    }
+
+    if (ret <= 1) {
+        __real_send(clifd, ret);
+        return;
+    }
+    /* check normally was launched?*/
+    wait_count = 1;
+    do {
+        cmdline = __proc_get_cmdline_bypid(ret);
+        if (cmdline == NULL) {
+            WrtLogE("error founded when being launched with %d", ret);
+        } else if (strcmp(cmdline, launchpad_cmdline)) {
+            free(cmdline);
+            cmdline_changed = 1;
+            break;
+        } else {
+            cmdline_exist = 1;
+            free(cmdline);
+        }
+
+        WrtLogD("-- now wait to change cmdline --");
+        struct timespec duration = { 0, 50 * 1000 * 1000 };
+        nanosleep(&duration, NULL);     /* 50ms sleep*/
+        wait_count++;
+    } while (wait_count <= 20);         /* max 50*20ms will be sleep*/
+
+    if ((!cmdline_exist) && (!cmdline_changed)) {
+        __real_send(clifd, -1);         /* abnormally launched*/
+        return;
+    }
+
+    if (!cmdline_changed) {
+        WrtLogE("process launched, but cmdline not changed");
+    }
+
+    if (__real_send(clifd, ret) < 0) {
+        r = kill(ret, SIGKILL);
+        if (r == -1) {
+            WrtLogE("send SIGKILL: %s", strerror(errno));
+        }
+    }
+
+    return;
+}
+
+_static_ void __launchpad_exec_dummy(int main_fd, int pool_fd, int client_fd)
+{
+    int pid;
+
+    last_dummy_exec_time = time(NULL);
+
+    pid = fork();
+
+    if (pid == 0) // child
+    {
+        setpriority(PRIO_PROCESS, 0, LOWEST_PRIO);
+        WrtLogD("Launch dummy process...");
+
+        //temp - this requires some optimization.
+        sleep(1);
+        WrtLogD("sleeping 1 sec...");
+
+        /* Set new session ID & new process group ID*/
+        /* In linux, child can set new session ID without check permission */
+        /* TODO : should be add to check permission in the kernel*/
+        setsid();
+
+        if (main_fd != -1)
+        {
+            close(main_fd);
+        }
+
+        if (pool_fd != -1)
+        {
+            close(pool_fd);
+        }
+
+        if (client_fd != -1)
+        {
+            close(client_fd);
+        }
+
+        __signal_unset_sigchld();
+        __signal_fini();
+
+        /* SET PR_SET_KEEPCAPS */
+        if (prctl(PR_SET_KEEPCAPS, 1) < 0) {
+            WrtLogE("prctl(PR_SET_KEEPCAPS) failed.");
+        }
+
+        /* SET DUMPABLE - for coredump*/
+        prctl(PR_SET_DUMPABLE, 1);
+
+        {
+            void *handle = NULL;
+            int (*dl_main) (int, char **);
+
+            handle = dlopen(WRT_CLIENT_PATH, RTLD_NOW | RTLD_GLOBAL);
+
+            if (handle == NULL)
+            {
+                WrtLogE("dlopen failed.");
+                exit(-1);
+            }
+
+            dl_main = reinterpret_cast<int (*)(int, char **)>(dlsym(handle, "main"));
+
+            sprintf(g_argv[1], "%s", "-d");
+
+            if (dl_main != NULL)
+            {
+                dl_main(g_argc, g_argv);
+            }
+            else
+            {
+                WrtLogE("dlsym not founded. bad preloaded app - check fpie pie");
+            }
+
+            exit(0);
+        }
+    }
+}
+
+_static_ void __launchpad_main_loop(int main_fd, int pool_fd)
+{
+    bundle *kb = NULL;
+    app_pkt_t *pkt = NULL;
+    app_info_from_db *menu_info = NULL;
+
+    const char *pkg_name = NULL;
+    const char *app_path = NULL;
+    int pid = -1;
+    int clifd = -1;
+    struct ucred cr;
+    int is_real_launch = 0;
+
+    char sock_path[UNIX_PATH_MAX] = { 0, };
+
+    pkt = __app_recv_raw(main_fd, &clifd, &cr);
+    if (!pkt) {
+        WrtLogD("packet is NULL");
+        goto end;
+    }
+
+    kb = bundle_decode(pkt->data, pkt->len);
+    if (!kb) {
+        WrtLogD("bundle decode error");
+        goto end;
+    }
+
+    pkg_name = bundle_get_val(kb, AUL_K_PKG_NAME);
+    SECURE_LOGD("pkg name : %s\n", pkg_name);
+
+    menu_info = _get_app_info_from_bundle_by_pkgname(pkg_name, kb);
+    if (menu_info == NULL) {
+        WrtLogD("such pkg no found");
+        goto end;
+    }
+
+    app_path = _get_app_path(menu_info);
+    if (app_path == NULL) {
+        WrtLogE("app_path is NULL");
+        goto end;
+    }
+    if (app_path[0] != '/') {
+        WrtLogD("app_path is not absolute path");
+        goto end;
+    }
+
+    __modify_bundle(kb, cr.pid, menu_info, pkt->cmd);
+    pkg_name = _get_pkgname(menu_info);
+
+    if (dummy_process_pid != DUMMY_NONE)
+    {
+        snprintf(sock_path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, dummy_process_pid);
+        unlink(sock_path);
+
+        __dummy_launch(dummy_process_fd, pkt);
+
+        pid = dummy_process_pid;
+        is_real_launch = 1;
+        close(dummy_process_fd);
+
+        dummy_process_pid = DUMMY_NONE;
+        dummy_process_fd  = -1;
+
+        /* Temporary log: launch time checking */
+        LOG(LOG_DEBUG, "LAUNCH", "[%s:Platform:launchpad:done]", app_path);
+
+        __launchpad_exec_dummy(main_fd, pool_fd, clifd);
+
+        WrtLogD("==> dummy launch pid : %d %s\n", pid, app_path);
+    }
+    else
+    {
+        pid = fork();
+
+        if (pid == 0)
+        {
+            WrtLogE("lock up test log(no error) : fork done");
+
+            close(clifd);
+            close(main_fd);
+            __signal_unset_sigchld();
+            __signal_fini();
+
+            snprintf(sock_path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, getpid());
+            unlink(sock_path);
+
+            WrtLogE("lock up test log(no error) : prepare exec - first done");
+
+            if (__prepare_exec(pkg_name, app_path,
+                               menu_info, kb) < 0)
+            {
+                SECURE_LOGE("preparing work fail to launch - "
+                   "can not launch %s\n", pkg_name);
+                exit(-1);
+            }
+
+            WrtLogE("lock up test log(no error) : prepare exec - second done");
+
+            __real_launch(app_path, kb);
+
+            exit(-1);
+        }
+        WrtLogD("==> real launch pid : %d %s\n", pid, app_path);
+        is_real_launch = 1;
+    }
+
+end:
+    __send_result_to_caller(clifd, pid);
+
+    if (pid > 0) {
+        if (is_real_launch) {
+            /*TODO: retry*/
+            __signal_block_sigchld();
+            __send_app_launch_signal(pid);
+
+#if ENABLE(PRE_LAUNCH)
+            if (is_pre_launching_appid(pkg_name)) {
+                add_to_pre_launching_info_list(pkg_name, pid);
+            }
+#endif
+            __signal_unblock_sigchld();
+        }
+    }
+
+    if (menu_info != NULL) {
+        _free_app_info_from_db(menu_info);
+    }
+
+    if (kb != NULL) {
+        bundle_free(kb);
+    }
+    if (pkt != NULL) {
+        free(pkt);
+    }
+
+    /* Active Flusing for Daemon */
+    if (initialized > AUL_POLL_CNT) {
+        sqlite3_release_memory(SQLITE_FLUSH_MAX);
+        malloc_trim(0);
+        initialized = 1;
+    }
+}
+
+_static_ int __launchpad_pre_init(int argc, char **argv)
+{
+    int fd;
+
+    /* signal init*/
+    __signal_init();
+
+    /* get my(launchpad) command line*/
+    launchpad_cmdline = __proc_get_cmdline_bypid(getpid());
+    if (launchpad_cmdline == NULL) {
+        WrtLogE("launchpad cmdline fail to get");
+        return -1;
+    }
+    WrtLogD("launchpad cmdline = %s", launchpad_cmdline);
+
+    /* create launchpad sock        */
+    fd = __create_server_sock(WRT_LAUNCHPAD_PID);
+    if (fd < 0) {
+        WrtLogE("server sock error");
+        return -1;
+    }
+
+    __preload_init(argc, argv);
+
+    __preload_init_for_wrt();
+
+    __preexec_init(argc, argv);
+
+    return fd;
+}
+
+_static_ int __launchpad_post_init()
+{
+    /* Setting this as a global variable to keep track
+     * of launchpad poll cnt */
+    /* static int initialized = 0;*/
+
+    if (initialized) {
+        initialized++;
+        return 0;
+    }
+
+    if (__signal_set_sigchld() < 0) {
+        return -1;
+    }
+
+    initialized++;
+
+    return 0;
+}
+
+int main(int argc, char **argv)
+{
+    enum {
+        LAUNCH_PAD = 0,
+        POOL_SERVER,
+        DUMMY_PROCESS,
+        POLLFD_MAX
+    };
+
+    int main_fd = -1, pool_fd = -1;
+    struct pollfd pfds[POLLFD_MAX];
+
+    memset(pfds, 0x00, sizeof(pfds));
+
+#if ENABLE(PRE_LAUNCH)
+    pre_launch_webapps();
+#endif
+
+    // process pool feature disable
+    if (getenv("WRT_PROCESS_POOL_DISABLE"))
+    {
+        process_pool_disable = 1;
+    }
+
+    /* init without concerning X & EFL*/
+    main_fd = __launchpad_pre_init(argc, argv);
+
+    if (main_fd < 0)
+    {
+        WrtLogE("launchpad pre init failed");
+        goto exit_main;
+    }
+
+    pfds[LAUNCH_PAD].fd      = main_fd;
+    pfds[LAUNCH_PAD].events  = POLLIN;
+    pfds[LAUNCH_PAD].revents = 0;
+
+    pool_fd = __create_process_pool_server();
+
+    if (pool_fd == -1)
+    {
+        WrtLogE("Error creationg pool server!");
+        goto exit_main;
+    }
+
+    pfds[POOL_SERVER].fd      = pool_fd;
+    pfds[POOL_SERVER].events  = POLLIN;
+    pfds[POOL_SERVER].revents = 0;
+
+
+    // This is temporary code to delay creating dummy process.
+    // It will make that a dummy_process is created on first webapp launching.
+    last_dummy_exec_time = time(NULL);
+
+    while (1)
+    {
+        if (dummy_process_pid == DUMMY_NONE)
+        {
+            pfds[DUMMY_PROCESS].fd      = -1;
+            pfds[DUMMY_PROCESS].events  = 0;
+            pfds[DUMMY_PROCESS].revents = 0;
+
+            if ( !process_pool_disable &&
+                 DIFF(last_dummy_exec_time, time(NULL)) > EXEC_DUMMY_EXPIRED)
+            {
+                __launchpad_exec_dummy(main_fd, pool_fd, -1);
+            }
+        }
+
+        if (poll(pfds, POLLFD_MAX, -1) < 0)
+        {
+            continue;
+        }
+
+        WrtLogD("pfds[LAUNCH_PAD].revents    : 0x%x", pfds[LAUNCH_PAD].revents) ;
+        WrtLogD("pfds[POOL_SERVER].revents   : 0x%x", pfds[POOL_SERVER].revents) ;
+        WrtLogD("pfds[DUMMY_PROCESS].revents : 0x%x", pfds[DUMMY_PROCESS].revents) ;
+
+        /* init with concerning X & EFL (because of booting
+        * sequence problem)*/
+        if (__launchpad_post_init() < 0)
+        {
+            WrtLogE("launcpad post init failed");
+            goto exit_main;
+        }
+
+        if ((pfds[LAUNCH_PAD].revents & POLLIN) != 0)
+        {
+            WrtLogD("pfds[LAUNCH_PAD].revents & POLLIN");
+            __launchpad_main_loop(pfds[LAUNCH_PAD].fd, pfds[POOL_SERVER].fd);
+        }
+
+        if ((pfds[POOL_SERVER].revents & POLLIN) != 0)
+        {
+            int server_fd, client_fd, client_pid;
+
+            server_fd = pfds[POOL_SERVER].fd;
+
+            WrtLogD("pfds[POOL_SERVER].revents & POLLIN");
+
+            if (dummy_process_pid == DUMMY_NONE)
+            {
+                __accept_dummy_process(server_fd, &client_fd, &client_pid);
+
+                dummy_process_pid = client_pid;
+                dummy_process_fd  = client_fd;
+
+                pfds[DUMMY_PROCESS].fd     = dummy_process_fd;
+                pfds[DUMMY_PROCESS].events = POLLIN|POLLHUP;
+                pfds[DUMMY_PROCESS].revents = 0;
+
+                WrtLogD("Dummy process was connected! (pid:%d)", dummy_process_pid);
+            }
+            else
+            {
+                __refuse_dummy_process(server_fd);
+
+                WrtLogE("Refused dummy process connection!");
+            }
+        }
+
+        if ((pfds[DUMMY_PROCESS].revents & (POLLHUP|POLLNVAL)) != 0)
+        {
+            WrtLogD("pfds[DUMMY_PROCESS].revents & (POLLHUP|POLLNVAL) (pid:%d)", dummy_process_pid);
+
+            if (pfds[DUMMY_PROCESS].fd > -1)
+            {
+                close(pfds[DUMMY_PROCESS].fd);
+            }
+
+            dummy_process_pid = DUMMY_NONE;
+            dummy_process_fd = -1;
+
+            pfds[DUMMY_PROCESS].fd      = -1;
+            pfds[DUMMY_PROCESS].events  = 0;
+            pfds[DUMMY_PROCESS].revents = 0;
+        }
+    }
+
+    return 0;
+
+    exit_main:
+    if (main_fd != -1)
+    {
+        close(main_fd);
+    }
+
+    if (pool_fd != -1)
+    {
+        close(pool_fd);
+    }
+
+    return -1;
+}
+
diff --git a/src/wrt-launchpad-daemon/src/launchpad_lite.cpp b/src/wrt-launchpad-daemon/src/launchpad_lite.cpp
new file mode 100644 (file)
index 0000000..f2f7697
--- /dev/null
@@ -0,0 +1,476 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+// system header
+#include <cstdio>
+#include <sys/prctl.h>
+
+// platform header
+#include <aul.h>
+#include <dpl/availability.h>
+#include <dpl/exception.h>
+#include <dpl/log/wrt_log.h>
+#include <Ecore.h>
+
+// internal header
+// Must define top of internal header
+#include "config.h"
+
+#include "access_control.h"
+#include "app_sock.h"
+#include "launchpad_util.h"
+#include "menu_db_util.h"
+#include "sigchild.h"
+#include "simple_util.h"
+#include "preexec.h"
+#include "preload.h"
+#include "web_app_core.h"
+
+#define _static_ static inline
+#define AUL_PR_NAME         16
+#define PKG_ID_LENGTH       11
+#define MAX_WAIT_CNT       1000
+
+static char *launchpad_cmdline;
+static WebAppCore* webappcore;
+
+_static_ int __prepare_exec(const char *pkg_name,
+                            const char *app_path, app_info_from_db * menu_info,
+                            bundle * kb);
+_static_ char **__create_argc_argv(bundle * kb, int *margc);
+_static_ void __real_launch(const char *app_path, bundle * kb);
+_static_ int __real_send(int clifd, int ret);
+_static_ void __send_result_to_caller(int clifd, int ret);
+_static_ void __launchpad_request_handle(app_pkt_t* pkt, int clifd, ucred cr);
+_static_ Eina_Bool __launchpad_main_loop(void* data, Ecore_Fd_Handler* handler);
+_static_ int __launchpad_pre_init(void);
+_static_ int __launchpad_init(int argc, char **argv);
+
+_static_ int __prepare_exec(const char *pkg_name,
+                            const char *app_path, app_info_from_db * menu_info,
+                            bundle * kb)
+{
+    const char* file_name;
+    char process_name[AUL_PR_NAME];
+
+    /* Set new session ID & new process group ID*/
+    /* In linux, child can set new session ID without check permission */
+    /* TODO : should be add to check permission in the kernel*/
+    setsid();
+
+    __preexec_run(menu_info->pkg_type, pkg_name, app_path);
+
+    /* SET PRIVILEGES*/
+    char pkg_id[PKG_ID_LENGTH];
+    memset(pkg_id, '\0', PKG_ID_LENGTH);
+    snprintf(pkg_id, PKG_ID_LENGTH, "%s", pkg_name);
+
+    /* SET PR_SET_KEEPCAPS */
+    if (prctl(PR_SET_KEEPCAPS, 1) < 0) {
+        WrtLogE("prctl(PR_SET_KEEPCAPS) failed.");
+    }
+
+    if (AccessControl::setPriviledge(pkg_id, menu_info->pkg_type, app_path) < 0) {
+        WrtLogD("fail to set privileges - check your package's credential\n");
+        return -1;
+    }
+
+    __set_inherit_bit_for_CAP_MAC_ADMIN();
+
+    /* SET DUMPABLE - for coredump*/
+    prctl(PR_SET_DUMPABLE, 1);
+
+    /* SET PROCESS NAME*/
+    if (app_path == NULL) {
+        WrtLogD("app_path should not be NULL - check menu db");
+        return -1;
+    }
+    file_name = strrchr(app_path, '/') + 1;
+    if (file_name == NULL) {
+        WrtLogD("can't locate file name to execute");
+        return -1;
+    }
+    memset(process_name, '\0', AUL_PR_NAME);
+    snprintf(process_name, AUL_PR_NAME, "%s", file_name);
+    prctl(PR_SET_NAME, process_name);
+
+    /* SET ENVIROMENT*/
+    __set_env(menu_info, kb);
+
+    return 0;
+}
+
+_static_ void __real_launch(const char *app_path, bundle * kb)
+{
+    int app_argc;
+    char **app_argv;
+    int i;
+
+    app_argv = __create_argc_argv(kb, &app_argc);
+
+#ifdef PRELOAD_ACTIVATE
+    if (__change_cmdline((char *)app_path) < 0) {
+        WrtLogE("change cmdline fail");
+        return;
+    }
+
+    app_argv[0] = g_argv[0];
+#else
+    app_argv[0] = strdup(app_path);
+#endif
+
+    for (i = 0; i < app_argc; i++) {
+        WrtLogD("input argument %d : %s##", i, app_argv[i]);
+    }
+
+    WrtLogE("lock up test log(no error) : setup argument done");
+
+    /* Temporary log: launch time checking */
+    LOG(LOG_DEBUG, "LAUNCH", "[%s:Platform:launchpad:done]", app_path);
+
+    __preload_exec(app_argc, app_argv);
+}
+
+static int __get_caller_pid(bundle *kb)
+{
+    const char *pid_str;
+    int pid;
+
+    pid_str = bundle_get_val(kb, AUL_K_ORG_CALLER_PID);
+    if (pid_str) {
+        goto end;
+    }
+
+    pid_str = bundle_get_val(kb, AUL_K_CALLER_PID);
+    if (pid_str == NULL) {
+        return -1;
+    }
+
+end:
+    pid = atoi(pid_str);
+    if (pid <= 1) {
+        return -1;
+    }
+
+    return pid;
+}
+
+_static_ int __foward_cmd(int cmd, bundle *kb, int cr_pid)
+{
+    int pid;
+    char tmp_pid[MAX_PID_STR_BUFSZ];
+    int datalen;
+    bundle_raw *kb_data;
+    int res;
+
+    if ((pid = __get_caller_pid(kb)) < 0) {
+        return AUL_R_ERROR;
+    }
+
+    snprintf(tmp_pid, MAX_PID_STR_BUFSZ, "%d", cr_pid);
+
+    bundle_add(kb, AUL_K_CALLEE_PID, tmp_pid);
+
+    bundle_encode(kb, &kb_data, &datalen);
+    if ((res = __app_send_raw(pid, cmd, kb_data, datalen)) < 0) {
+        res = AUL_R_ERROR;
+    }
+
+    free(kb_data);
+
+    return res;
+}
+
+_static_ int __real_send(int clifd, int ret)
+{
+    if (send(clifd, &ret, sizeof(int), MSG_NOSIGNAL) < 0) {
+        if (errno == EPIPE) {
+            WrtLogE("send failed due to EPIPE.\n");
+            close(clifd);
+            return -1;
+        }
+        WrtLogE("send fail to client");
+    }
+
+    close(clifd);
+    return 0;
+}
+
+_static_ void __send_result_to_caller(int clifd, int ret)
+{
+    char *cmdline;
+    int wait_count;
+    int cmdline_changed = 0;
+    int cmdline_exist = 0;
+    int r;
+
+    if (clifd == -1) {
+        return;
+    }
+
+    if (ret <= 1) {
+        __real_send(clifd, ret);
+        return;
+    }
+    /* check normally was launched?*/
+    wait_count = 1;
+    do {
+        cmdline = __proc_get_cmdline_bypid(ret);
+        if (cmdline == NULL) {
+            WrtLogE("error founded when being launched with %d", ret);
+        } else if (strcmp(cmdline, launchpad_cmdline)) {
+            free(cmdline);
+            cmdline_changed = 1;
+            break;
+        } else {
+            cmdline_exist = 1;
+            free(cmdline);
+        }
+
+        WrtLogD("-- now wait to change cmdline --");
+        struct timespec duration = { 0, 50 * 1000 * 1000 };
+        nanosleep(&duration, NULL);     /* 50ms sleep*/
+        wait_count++;
+    } while (wait_count <= 20);         /* max 50*20ms will be sleep*/
+
+    if ((!cmdline_exist) && (!cmdline_changed)) {
+        __real_send(clifd, -1);         /* abnormally launched*/
+        return;
+    }
+
+    if (!cmdline_changed) {
+        WrtLogE("process launched, but cmdline not changed");
+    }
+
+    if (__real_send(clifd, ret) < 0) {
+        r = kill(ret, SIGKILL);
+        if (r == -1) {
+            WrtLogE("send SIGKILL: %s", strerror(errno));
+        }
+    }
+
+    return;
+}
+
+_static_ void __launchpad_request_handle(app_pkt_t* pkt, int clifd, ucred cr)
+{
+    app_info_from_db *menu_info = NULL;
+    const char *pkg_name = NULL;
+    const char *app_path = NULL;
+    int pid = -1;
+    int is_real_launch = 0;
+    int argc;
+    char** argv;
+    int waitCnt = 0;
+
+    bundle* kb = bundle_decode(pkt->data, pkt->len);
+    if (!kb) {
+        WrtLogD("bundle decode error");
+        goto end;
+    }
+
+    pkg_name = bundle_get_val(kb, AUL_K_PKG_NAME);
+    WrtLogD("pkg name : %s\n", pkg_name);
+
+    menu_info = _get_app_info_from_bundle_by_pkgname(pkg_name, kb);
+    if (menu_info == NULL) {
+        WrtLogD("such pkg no found");
+        goto end;
+    }
+
+    app_path = _get_app_path(menu_info);
+    if (app_path == NULL) {
+        WrtLogE("app_path is NULL");
+        goto end;
+    }
+    if (app_path[0] != '/') {
+        WrtLogD("app_path is not absolute path");
+        goto end;
+    }
+
+    __modify_bundle(kb, cr.pid, menu_info, pkt->cmd);
+    pkg_name = _get_pkgname(menu_info);
+    argv = __create_argc_argv(kb, &argc);
+    if(!webappcore->launchRequest(argc, argv))
+        goto end;
+
+    while (waitCnt < MAX_WAIT_CNT) {
+        pid = __proc_iter_cmdline(NULL, (void*)app_path);
+        if (pid > 0) {
+            break;
+        }
+        waitCnt++;
+    }
+
+    webappcore->setPidToAppID(pkg_name, pid);
+    WrtLogD("==> real launch pid : %d %s\n", pid, app_path);
+
+    is_real_launch = 1;
+
+end:
+    __send_result_to_caller(clifd, pid);
+
+    if (pid > 0) {
+        if (is_real_launch) {
+            /*TODO: retry*/
+            __signal_block_sigchld();
+            __send_app_launch_signal(pid);
+            __signal_unblock_sigchld();
+        }
+    }
+
+    if (menu_info != NULL) {
+        _free_app_info_from_db(menu_info);
+    }
+
+    if (kb != NULL) {
+        bundle_free(kb);
+    }
+    if (pkt != NULL) {
+        free(pkt);
+    }
+
+    return;
+}
+
+_static_ Eina_Bool __launchpad_main_loop(void* data, Ecore_Fd_Handler* handler)
+{
+    DPL_UNUSED_PARAM(data);
+
+    int main_fd = ecore_main_fd_handler_fd_get(handler);
+    int clifd = -1;
+    struct ucred cr;
+
+    app_pkt_t* pkt = __app_recv_raw(main_fd, &clifd, &cr);
+    if (!pkt) {
+        WrtLogD("packet is NULL");
+        return ECORE_CALLBACK_RENEW;
+    }
+
+    if (cr.uid == 5000) {
+        // From WebProcess
+        webappcore->aulSocketHandler(pkt, clifd, cr);
+    } else if (cr.uid == 0) {
+        // From AMD
+        __launchpad_request_handle(pkt, clifd, cr);
+    } else {
+        // From Unknown
+        WrtLogW("Unknown sender");
+    }
+
+    return ECORE_CALLBACK_RENEW;
+}
+
+_static_ int __launchpad_pre_init(void)
+{
+    // Drop permission - socket between AMD and WLD
+    char path[UNIX_PATH_MAX] = {0,};
+    snprintf(path, UNIX_PATH_MAX, "%s/%d", AUL_SOCK_PREFIX, WRT_LAUNCHPAD_PID);
+    if (0 != chown(path, 5000, 5000)) {
+        WrtLogE("Fail to change owner");
+        return -1;
+    }
+
+    if (AccessControl::setWLDCapability() < 0) {
+        WrtLogD("fail set capability");
+        return -1;
+    }
+
+    // Drop permission - WLD Process permission
+    if (AccessControl::setWLDPrivilege() < 0) {
+        WrtLogD("fail to drop root");
+        return -1;
+    }
+
+    return 0;
+}
+
+_static_ int __launchpad_init(int argc, char **argv)
+{
+    int fd;
+
+    /* signal init*/
+    __signal_init();
+
+    /* get my(launchpad) command line*/
+    launchpad_cmdline = __proc_get_cmdline_bypid(getpid());
+    if (launchpad_cmdline == NULL) {
+        WrtLogE("launchpad cmdline fail to get");
+        return -1;
+    }
+    WrtLogD("launchpad cmdline = %s", launchpad_cmdline);
+
+    /* create launchpad sock        */
+    fd = __create_server_sock(WRT_LAUNCHPAD_PID);
+    if (fd < 0) {
+        WrtLogE("server sock error");
+        return -1;
+    }
+
+    __preload_init(argc, argv);
+    __preload_init_for_wrt();
+    __preexec_init(argc, argv);
+
+    ecore_init();
+
+    if (__signal_set_sigchld() < 0) {
+        return -1;
+    }
+
+    if (!webappcore) {
+        webappcore = new WebAppCore();
+        if (!webappcore->initialize()) {
+            WrtLogE("Fail to initialize webappcore");
+            return -1;
+        }
+    }
+
+    return fd;
+}
+
+int main(int argc, char **argv)
+{
+    UNHANDLED_EXCEPTION_HANDLER_BEGIN
+    {
+        if (-1 == __launchpad_pre_init()) {
+            WrtLogE("Fail to pre init");
+            return -1;
+        }
+
+        int main_fd = -1;
+        main_fd = __launchpad_init(argc, argv);
+        if (main_fd < 0) {
+            WrtLogE("launchpad init failed");
+            return -1;
+        }
+
+        Ecore_Fd_Handler* main_fd_handler =
+            ecore_main_fd_handler_add(main_fd, (Ecore_Fd_Handler_Flags)(ECORE_FD_READ|ECORE_FD_ERROR), __launchpad_main_loop, NULL, NULL, NULL);
+        if (main_fd_handler == NULL) {
+            WrtLogE("main_fd_handler is NULL");
+            return -1;
+        }
+
+        ecore_main_loop_begin();
+
+        ecore_main_fd_handler_del(main_fd_handler);
+        close(main_fd);
+
+        return 0;
+    }
+    UNHANDLED_EXCEPTION_HANDLER_END
+}
+
diff --git a/src/wrt-launchpad-daemon/src/pre_launching.cpp b/src/wrt-launchpad-daemon/src/pre_launching.cpp
new file mode 100644 (file)
index 0000000..8bbd645
--- /dev/null
@@ -0,0 +1,333 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    pre_launching.cpp
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 1.0
+ * @brief   wrt pre-launching model api
+ */
+
+#include "pre_launching.h"
+
+#include <dirent.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <time.h>
+
+#include <string>
+#include <map>
+
+#include <aul.h>
+#include <app_control.h>
+#include <sqlite3.h>
+#include <rua.h>
+
+#include "simple_util.h"
+
+namespace {
+const char* const PRE_LAUNCHING_LIST_DIR = "/opt/usr/etc/wrt_launchpad_daemon/pre_launching_list";
+const char* const PKGMGR_PARSER_DB_PATH = "/opt/dbspace/.pkgmgr_parser.db";
+const char* const APP_INFO_DB_PATH = "/opt/dbspace/.app_info.db";
+const int SHORT_TERM_COUNTER      = 2;
+const int RE_LAUNCHING_LIMIT_TIME = 3; // sec
+const int TIME_FOR_PRE_LAUNCHING_AFTER_BOOTING = 10; // sec
+const int TIME_FOR_NEXT_PRE_LAUNCHING = 2; // sec
+
+struct PreLaunchingInfo
+{
+    int    pid;
+    time_t launchedTime;
+    int    shortTermCounter;
+
+    PreLaunchingInfo() :
+        pid(0), launchedTime(0), shortTermCounter(SHORT_TERM_COUNTER)
+    {};
+
+    explicit PreLaunchingInfo(int processID, time_t time = 0) :
+        pid(processID), launchedTime(time), shortTermCounter(SHORT_TERM_COUNTER)
+    {};
+};
+
+std::map<std::string, PreLaunchingInfo> s_InfoList;
+
+int update_task_manage_field(const char* app_id, int task_manage)
+{
+    sqlite3 *db = NULL;
+    char *sqlite3_error_msg = NULL;
+
+    if (sqlite3_open(PKGMGR_PARSER_DB_PATH, &db) != SQLITE_OK) {
+        WrtLogE("sqlite3_open() failed! -> %s\n", sqlite3_errmsg(db));
+        return -1;
+    }
+
+    if (sqlite3_exec(db, "PRAGMA journal_mode = PERSIST", NULL, NULL, &sqlite3_error_msg) != SQLITE_OK) {
+        WrtLogE("sqlite3_exec(\"PRAGMA journal_mode = PERSIST\") failed! -> %s", sqlite3_error_msg);
+        sqlite3_free(sqlite3_error_msg);
+        sqlite3_close(db);
+        return -1;
+    }
+
+    if (sqlite3_exec(db, "BEGIN EXCLUSIVE", NULL, NULL, &sqlite3_error_msg) != SQLITE_OK) {
+        WrtLogE("sqlite3_exec(\"BEGIN EXCLUSIVE\") failed! -> %s", sqlite3_error_msg);
+        sqlite3_free(sqlite3_error_msg);
+        sqlite3_close(db);
+        return -1;
+    }
+
+    char query[1024] = {0, };
+    sprintf(query, "update package_app_info set app_taskmanage='%s' where app_id='%s'",
+            task_manage ? "true" : "false", app_id);
+
+    if (sqlite3_exec(db, query, NULL, NULL, &sqlite3_error_msg) != SQLITE_OK) {
+        WrtLogE("sqlite3_exec(\"%s\") failed! -> %s", query, sqlite3_error_msg);
+        sqlite3_free(sqlite3_error_msg);
+        sqlite3_close(db);
+        return -1;
+    }
+
+    if (sqlite3_exec(db, "COMMIT", NULL, NULL, NULL) != SQLITE_OK) {
+        WrtLogE("sqlite3_exec(\"COMMIT\") failed!");
+        sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+        sqlite3_close(db);
+        return -1;
+    }
+
+    sqlite3_close(db);
+
+    return 0;
+}
+
+int update_x_slp_taskmanage_field(const char* app_id, int x_slp_taskmanage)
+{
+    sqlite3 *db = NULL;
+    char *sqlite3_error_msg = NULL;
+
+    if (sqlite3_open(APP_INFO_DB_PATH, &db) != SQLITE_OK) {
+        WrtLogE("sqlite3_open() failed! -> %s\n", sqlite3_errmsg(db));
+        return -1;
+    }
+
+    if (sqlite3_exec(db, "PRAGMA journal_mode = PERSIST", NULL, NULL, &sqlite3_error_msg) != SQLITE_OK) {
+        WrtLogE("sqlite3_exec(\"PRAGMA journal_mode = PERSIST\") failed! -> %s", sqlite3_error_msg);
+        sqlite3_free(sqlite3_error_msg);
+        sqlite3_close(db);
+        return -1;
+    }
+
+    if (sqlite3_exec(db, "BEGIN EXCLUSIVE", NULL, NULL, &sqlite3_error_msg) != SQLITE_OK) {
+        WrtLogE("sqlite3_exec(\"BEGIN EXCLUSIVE\") failed! -> %s", sqlite3_error_msg);
+        sqlite3_free(sqlite3_error_msg);
+        sqlite3_close(db);
+        return -1;
+    }
+
+    char query[1024] = {0, };
+    sprintf(query, "update app_info set x_slp_taskmanage=%d where package='%s'",
+            x_slp_taskmanage ? 1 : 0, app_id);
+
+    if (sqlite3_exec(db, query, NULL, NULL, &sqlite3_error_msg) != SQLITE_OK) {
+        WrtLogE("sqlite3_exec(\"%s\") failed! -> %s", query, sqlite3_error_msg);
+        sqlite3_free(sqlite3_error_msg);
+        sqlite3_close(db);
+        return -1;
+    }
+
+    if (sqlite3_exec(db, "COMMIT", NULL, NULL, NULL) != SQLITE_OK) {
+        WrtLogE("sqlite3_exec(\"COMMIT\") failed!");
+        sqlite3_exec(db, "ROLLBACK", NULL, NULL, NULL);
+        sqlite3_close(db);
+        return -1;
+    }
+
+    sqlite3_close(db);
+
+    return 0;
+}
+
+int pre_launching_request(const char* app_id)
+{
+    bundle *kb = bundle_create();
+
+    if (kb == NULL){
+        WrtLogE("bundle_create() failed!");
+        return -1;
+    }
+
+    if (bundle_add(kb, AUL_K_PRELAUCHING, "TRUE") != 0) {
+        WrtLogE("bundle_add() failed!");
+        bundle_free(kb);
+        return -1;
+    }
+
+    aul_launch_app(app_id, kb);
+    bundle_free(kb);
+
+    if (rua_init() == 0) {
+        if (rua_is_latest_app(app_id) != 0) {
+            WrtLogD("update_task_manage_field(%s, %d)", app_id, 0);
+            update_task_manage_field(app_id, 0);
+            update_x_slp_taskmanage_field(app_id, 0);
+        }
+
+        rua_fini();
+    }
+
+    return 0;
+}
+
+} // anonymous namespace
+
+void add_to_pre_launching_info_list(const char* app_id, int pid)
+{
+    WrtLogD("enter");
+    std::string appId = app_id;
+
+    if (s_InfoList.find(appId) == s_InfoList.end()) {
+        s_InfoList[appId] = PreLaunchingInfo(pid, time(NULL));
+    }
+    else {
+        time_t curTime = time(NULL);
+        time_t pastTime = curTime - s_InfoList[appId].launchedTime;
+
+        s_InfoList[appId].pid = pid;
+        s_InfoList[appId].launchedTime = curTime;
+
+        if (pastTime <= RE_LAUNCHING_LIMIT_TIME) {
+            --s_InfoList[appId].shortTermCounter;
+            WrtLogD("s_InfoList[%s].shortTermCounter = %d -> %d ", app_id,
+               s_InfoList[appId].shortTermCounter+1,
+               s_InfoList[appId].shortTermCounter);
+        }
+        else {
+            s_InfoList[appId].shortTermCounter = SHORT_TERM_COUNTER;
+        }
+    }
+}
+
+int re_pre_launch_by_pid(int pid, bool isCrashed)
+{
+    using namespace std;
+    WrtLogD("enter");
+
+    if (!isCrashed) {
+        map<string, PreLaunchingInfo>::iterator it = s_InfoList.begin();
+
+        while (it != s_InfoList.end()) {
+            if (pid == it->second.pid) {
+                WrtLogD("matched!!");
+                break;
+            }
+            ++it;
+        }
+
+        if (it != s_InfoList.end()) {
+            WrtLogD("pre_launching_requeset");
+
+            if (it->second.shortTermCounter > 1) {
+                if (is_pre_launching_appid(it->first.c_str())) {
+                    int fork_pid = fork();
+
+                    if (fork_pid == 0) {
+                        pre_launching_request(it->first.c_str());
+                        _exit(0);
+                    }
+                }
+                else {
+                    it->second.pid = 0;
+                }
+            }
+            else {
+                WrtLogD("blocked by shortTermCounter");
+            }
+        }
+    }
+
+    return 0;
+}
+
+int is_pre_launching_appid(const char* app_id)
+{
+    int ret_value = 0;
+    struct stat file_status;
+
+    if (stat(PRE_LAUNCHING_LIST_DIR, &file_status) == 0) {
+        if (S_ISDIR(file_status.st_mode)) {
+            int ret;
+            DIR *dir = NULL;
+            struct dirent entry, *result;
+
+            dir = opendir(PRE_LAUNCHING_LIST_DIR);
+
+            if (dir) {
+                for (ret = readdir_r(dir, &entry, &result);
+                     result != NULL && ret == 0;
+                     ret = readdir_r(dir, &entry, &result)) {
+                    if (strncmp(entry.d_name, ".", 2) == 0 ||
+                        strncmp(entry.d_name, "..", 3) == 0) {
+                        continue;
+                    }
+
+                    if (strcmp(app_id, entry.d_name) == 0) {
+                        ret_value = 1;
+                        break;
+                    }
+                }
+
+                closedir(dir);
+            }
+        }
+    }
+
+    return ret_value;
+}
+
+void pre_launch_webapps()
+{
+    if (fork() == 0) {
+        // new process
+        sleep(TIME_FOR_PRE_LAUNCHING_AFTER_BOOTING);
+
+        struct stat file_status;
+        if (stat(PRE_LAUNCHING_LIST_DIR, &file_status) == 0) {
+            if (S_ISDIR(file_status.st_mode)) {
+                int ret;
+                DIR *dir = NULL;
+                struct dirent entry, *result;
+
+                dir = opendir(PRE_LAUNCHING_LIST_DIR);
+
+                if (dir) {
+                    for (ret = readdir_r(dir, &entry, &result);
+                         result != NULL && ret == 0;
+                         ret = readdir_r(dir, &entry, &result)) {
+                        if (strncmp(entry.d_name, ".", 2) == 0 ||
+                            strncmp(entry.d_name, "..", 3) == 0) {
+                            continue;
+                        }
+
+                        WrtLogD("Try to pre-launching : %s", entry.d_name);
+                        pre_launching_request(entry.d_name);
+                        sleep(TIME_FOR_NEXT_PRE_LAUNCHING);
+                    }
+
+                    closedir(dir);
+                }
+            }
+        }
+
+        _exit(0);
+    }
+}
diff --git a/src/wrt-launchpad-daemon/src/process_pool.cpp b/src/wrt-launchpad-daemon/src/process_pool.cpp
new file mode 100644 (file)
index 0000000..471cb2d
--- /dev/null
@@ -0,0 +1,285 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    process_pool.c
+ * @author  Tae-Jeong Lee (taejeong.lee@samsung.com)
+ * @version 0.1
+ * @brief   process pool socket apis
+ */
+
+#include <unistd.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <linux/un.h>
+#include <errno.h>
+#include <stdio.h>
+#include <systemd/sd-daemon.h>
+
+#include "process_pool.h"
+#include "simple_util.h"
+
+#define TMP_PATH "/tmp"
+#define PROCESS_POOL_SERVER "wrt_process_pool_server"
+#define MAX_PENDING_CONNECTIONS 10
+#define CONNECT_RETRY_TIME 100 * 1000
+#define CONNECT_RETRY_COUNT 3
+
+int __create_process_pool_server()
+{
+    struct sockaddr_un addr;
+    int fd = -1;
+    int listen_fds=0;
+    int i;
+
+    memset(&addr, 0x00, sizeof(struct sockaddr_un));
+    addr.sun_family = AF_UNIX;
+    snprintf(addr.sun_path, UNIX_PATH_MAX, "%s/%s", TMP_PATH, PROCESS_POOL_SERVER);
+
+    listen_fds = sd_listen_fds(0);
+    if (listen_fds < 0)
+    {
+        WrtLogE("invalid systemd environment");
+        return -1;
+    }
+    else if (listen_fds > 0)
+    {
+        for (i = 0; i < listen_fds; i++)
+        {
+            fd = SD_LISTEN_FDS_START  + i;
+            if (sd_is_socket_unix(fd, SOCK_STREAM, 1, addr.sun_path, 0))
+                return fd;
+        }
+        WrtLogE("socket not found: %s", addr.sun_path);
+        return -1;
+    }
+
+    fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
+
+    if (fd < 0)
+    {
+        WrtLogE("socket error");
+        goto err_create_process_pool_server;
+    }
+
+    unlink(addr.sun_path);
+
+    WrtLogD("bind to %s", addr.sun_path);
+    if (bind(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
+    {
+        WrtLogE("bind error");
+        goto err_create_process_pool_server;
+    }
+
+    WrtLogD("chmod to %s", addr.sun_path);
+    if (chmod(addr.sun_path, (S_IRWXU | S_IRWXG | S_IRWXO)) < 0)
+    {
+        WrtLogE("chmod error");
+        goto err_create_process_pool_server;
+    }
+
+    WrtLogD("listen to %s", addr.sun_path);
+    if (listen(fd, MAX_PENDING_CONNECTIONS) == -1)
+    {
+        WrtLogE("listen error");
+        goto err_create_process_pool_server;
+    }
+
+    WrtLogD("__create_process_pool_server done : %d", fd);
+    return fd;
+
+
+err_create_process_pool_server:
+
+    if (fd != -1)
+    {
+        close(fd);
+    }
+
+    return -1;
+}
+
+
+int __connect_process_pool_server()
+{
+    struct sockaddr_un addr;
+    int fd = -1;
+    int retry = CONNECT_RETRY_COUNT;
+    int send_ret = -1;
+    int client_pid = getpid();
+
+    memset(&addr, 0x00, sizeof(struct sockaddr_un));
+
+    fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
+
+    if (fd < 0)
+    {
+        WrtLogE("socket error");
+
+        goto err_connect_process_pool_server;
+    }
+
+    addr.sun_family = AF_UNIX;
+    snprintf(addr.sun_path, UNIX_PATH_MAX, "%s/%s", TMP_PATH, PROCESS_POOL_SERVER);
+
+
+    WrtLogD("connect to %s", addr.sun_path);
+    while (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0)
+    {
+        if (errno != ETIMEDOUT || retry <= 0)
+        {
+            WrtLogE("connect error : %d", errno);
+
+            goto err_connect_process_pool_server;
+        }
+
+        usleep(CONNECT_RETRY_TIME);
+        retry--;
+        WrtLogD("re-connect to %s (%d)", addr.sun_path, retry);
+    }
+
+    send_ret = send(fd, &client_pid, sizeof(client_pid), 0);
+    WrtLogD("send(%d) : %d", client_pid, send_ret);
+
+    if (send_ret == -1)
+    {
+        WrtLogE("send error");
+
+        goto err_connect_process_pool_server;
+    }
+
+    WrtLogD("__connect_process_pool_server done : %d", fd);
+    return fd;
+
+err_connect_process_pool_server:
+
+    if (fd != -1)
+    {
+        close(fd);
+    }
+
+    return -1;
+}
+
+
+int __accept_dummy_process(int server_fd, int* out_client_fd, int* out_client_pid)
+{
+    int client_fd = -1, client_pid = 0, recv_ret = 0;
+
+    if (server_fd == -1 || out_client_fd == NULL || out_client_pid == NULL)
+    {
+        WrtLogE("arguments error!");
+
+        goto err__accept_dummy_process;
+    }
+
+    client_fd = accept(server_fd, NULL, NULL);
+
+    if (client_fd == -1)
+    {
+        WrtLogE("accept error!");
+
+        goto err__accept_dummy_process;
+    }
+
+    recv_ret = recv(client_fd, &client_pid, sizeof(client_pid), MSG_WAITALL);
+
+    if (recv_ret == -1)
+    {
+        WrtLogE("recv error!");
+
+        goto err__accept_dummy_process;
+    }
+
+    *out_client_fd = client_fd;
+    *out_client_pid = client_pid;
+
+    return *out_client_fd;
+
+err__accept_dummy_process:
+
+    if (client_fd != -1)
+    {
+        close(client_fd);
+    }
+
+    return -1;
+}
+
+void __refuse_dummy_process(int server_fd)
+{
+    int client_fd = -1;
+
+    if (server_fd == -1)
+    {
+        WrtLogE("arguments error!");
+
+        goto err__refuse_dummy_process;
+    }
+
+    client_fd = accept(server_fd, NULL, NULL);
+
+    if (client_fd == -1)
+    {
+        WrtLogE("accept error!");
+
+        goto err__refuse_dummy_process;;
+    }
+
+    close(client_fd);
+    WrtLogD("refuse connection!");
+
+err__refuse_dummy_process:
+    return;
+}
+
+
+int __send_pkt_raw_data(int client_fd, app_pkt_t* pkt)
+{
+    int send_ret = 0;
+    int pkt_size = 0;
+
+    if (client_fd == -1 || pkt == NULL)
+    {
+        WrtLogE("arguments error!");
+
+        goto err__send_pkt_raw_data;
+    }
+
+    pkt_size = sizeof(pkt->cmd) + sizeof(pkt->len) + pkt->len;
+
+    send_ret = send(client_fd, pkt, pkt_size, 0);
+    WrtLogD("send(%d) : %d / %d", client_fd, send_ret, pkt_size);
+
+    if (send_ret == -1)
+    {
+        WrtLogE("send error!");
+
+        goto err__send_pkt_raw_data;
+    }
+    else if (send_ret != pkt_size)
+    {
+        WrtLogE("send byte fail!");
+
+        goto err__send_pkt_raw_data;
+    }
+
+    return 0;
+
+err__send_pkt_raw_data:
+
+    return -1;
+}
diff --git a/src/wrt-launchpad-daemon/src/simple_util.cpp b/src/wrt-launchpad-daemon/src/simple_util.cpp
new file mode 100644 (file)
index 0000000..5fc93d4
--- /dev/null
@@ -0,0 +1,222 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <dirent.h>
+#include <dpl/platform.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "simple_util.h"
+
+#define BINSH_NAME      "/bin/sh"
+#define BINSH_SIZE      7
+
+#define PROC_STAT_GID_POS       5
+
+static inline int __read_proc(const char *path, char *buf, int size);
+static inline int __find_pid_by_cmdline(const char *dname,
+                                        const char *cmdline, void *priv);
+static inline int __get_pgid_from_stat(int pid);
+
+static inline int __read_proc(const char *path, char *buf, int size)
+{
+    int fd;
+    int ret;
+
+    if (buf == NULL || path == NULL) {
+        return -1;
+    }
+
+    fd = open(path, O_RDONLY);
+    if (fd < 0) {
+        return -1;
+    }
+
+    ret = read(fd, buf, size - 1);
+    if (ret <= 0) {
+        close(fd);
+        return -1;
+    } else {
+        buf[ret] = 0;
+    }
+
+    close(fd);
+
+    return ret;
+}
+
+static inline int __find_pid_by_cmdline(const char *dname,
+                                        const char *cmdline, void *priv)
+{
+    char *apppath;
+    int pid = 0;
+
+    apppath = (char *)priv;
+    if (strncmp(cmdline, apppath, MAX_LOCAL_BUFSZ - 1) == 0) {
+        pid = atoi(dname);
+#if !ENABLE(ONE_UI_PROCESS_MODEL)
+        if (pid != getpgid(pid)) {
+            pid = 0;
+        }
+#endif
+    }
+
+    return pid;
+}
+
+int __proc_iter_cmdline(
+    int (*iterfunc)(const char *dname, const char *cmdline, void *priv),
+    void *priv)
+{
+    DIR *dp;
+    struct dirent dentry;
+    struct dirent *result;
+    int pid;
+    int ret;
+    char buf[MAX_LOCAL_BUFSZ];
+
+    dp = opendir("/proc");
+    if (dp == NULL) {
+        return -1;
+    }
+
+    if (iterfunc == NULL) {
+        iterfunc = __find_pid_by_cmdline;
+    }
+
+    while (readdir_r(dp, &dentry, &result) == 0 && result != NULL) {
+        if (!isdigit(dentry.d_name[0])) {
+            continue;
+        }
+
+        snprintf(buf, sizeof(buf), "/proc/%s/cmdline", dentry.d_name);
+        ret = __read_proc(buf, buf, sizeof(buf));
+        if (ret <= 0) {
+            continue;
+        }
+
+        /* support app launched by shell script*/
+        if (strncmp(buf, BINSH_NAME, BINSH_SIZE) == 0) {
+            pid =
+                iterfunc(dentry.d_name, &buf[BINSH_SIZE + 1],
+                         priv);
+        } else {
+            pid = iterfunc(dentry.d_name, buf, priv);
+        }
+
+        if (pid > 0) {
+            closedir(dp);
+            return pid;
+        }
+    }
+
+    closedir(dp);
+    return -1;
+}
+
+char *__proc_get_cmdline_bypid(int pid)
+{
+    char buf[MAX_LOCAL_BUFSZ];
+    int ret;
+
+    snprintf(buf, sizeof(buf), "/proc/%d/cmdline", pid);
+    ret = __read_proc(buf, buf, sizeof(buf));
+    if (ret <= 0) {
+        return NULL;
+    }
+
+    /* support app launched by shell script*/
+    if (strncmp(buf, BINSH_NAME, BINSH_SIZE) == 0) {
+        return strdup(&buf[BINSH_SIZE + 1]);
+    } else {
+        return strdup(buf);
+    }
+}
+
+static inline int __get_pgid_from_stat(int pid)
+{
+    char buf[MAX_LOCAL_BUFSZ] = { 0, };
+    char *str = NULL;
+    int ret;
+    int i;
+    int count = 0;
+
+    if (pid <= 1) {
+        return -1;
+    }
+
+    snprintf(buf, sizeof(buf), "/proc/%d/stat", pid);
+    ret = __read_proc(buf, buf, sizeof(buf));
+    if (ret < 0) {
+        return -1;
+    }
+
+    for (i = 0; i < (ret - 1); i++) {
+        if (buf[i] == ' ') {
+            count++;
+            if (count == PROC_STAT_GID_POS - 1) {
+                str = &(buf[i + 1]);
+            } else if (count == PROC_STAT_GID_POS) {
+                buf[i] = 0;
+                break;
+            }
+        }
+    }
+
+    if (count == PROC_STAT_GID_POS && str != NULL) {
+        pid = atoi(str);
+    } else {
+        pid = -1;
+    }
+
+    return pid;
+}
+
+int __proc_iter_pgid(int pgid, int (*iterfunc)(int pid, void *priv),
+                     void *priv)
+{
+    DIR *dp;
+    struct dirent dentry;
+    struct dirent *result;
+    int _pgid;
+    int ret = -1;
+
+    dp = opendir("/proc");
+    if (dp == NULL) {
+        return -1;
+    }
+
+    while (readdir_r(dp, &dentry, &result) == 0 && result != NULL) {
+        if (!isdigit(dentry.d_name[0])) {
+            continue;
+        }
+
+        _pgid = __get_pgid_from_stat(atoi(dentry.d_name));
+        if (pgid == _pgid) {
+            ret = iterfunc(atoi(dentry.d_name), priv);
+            if (ret >= 0) {
+                break;
+            }
+        }
+    }
+
+    closedir(dp);
+    return ret;
+}
+
diff --git a/src/wrt-launchpad-daemon/src/web_app_core.cpp b/src/wrt-launchpad-daemon/src/web_app_core.cpp
new file mode 100644 (file)
index 0000000..4cb2bd9
--- /dev/null
@@ -0,0 +1,435 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    web_app_core.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ */
+
+#include "web_app_core.h"
+
+#include <string>
+
+#include <aul.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/availability.h>
+#include <Ecore.h>
+#include <Elementary.h>
+
+#include <app_sock.h>
+#include <web_app_core_data.h>
+#include <web_app_core_tskmgr_util.h>
+#include <web_app_core_x_util.h>
+#include <web_app_manager.h>
+#include <web_internal_eventloop.h>
+#define WEBAPP_DEFAULT_UID 5000
+
+namespace {
+} // anonymous namespace
+
+WebAppCore::WebAppCore() :
+    m_initialized(false)
+{
+}
+
+WebAppCore::~WebAppCore()
+{
+}
+
+bool WebAppCore::initialize()
+{
+    WrtLogD("initialize");
+
+    if (m_initialized) {
+        WrtLogD("Already initialized");
+        return false;
+    }
+    elm_init(0, NULL);
+#if USE(EFL_LITE)
+    elm_app_base_scale_set(1.8);
+#else
+    elm_app_base_scale_set(2.4);
+#endif
+    m_manager.reset(new WebAppManager());
+    m_webAppCoreDataManager.reset(new WebAppCoreDataManager());
+    if (!addEcoreXWindowHandlers()) {
+        WrtLogE("Error creating X Window Handlers");
+        return false;
+    }
+    WebInternalEventSingleton::Instance().addListner(WebInternalEventSingleton::Instance().WEB_APP_TERMINATE,
+                                                    terminateEventCallback, this);
+    WebInternalEventSingleton::Instance().addListner(WebInternalEventSingleton::Instance().POPUP_REPLY_WAIT_START,
+                                                    popupReplyWaitStartEventCallback, this);
+    WebInternalEventSingleton::Instance().addListner(WebInternalEventSingleton::Instance().POPUP_REPLY_WAIT_FINISH,
+                                                    popupReplyWaitFinishEventCallback, this);
+    m_initialized = true;
+    return true;
+}
+
+bool WebAppCore::launchRequest(int argc, char* argv[])
+{
+    WrtLogD("launchRequest");
+
+    bundle* b = bundle_import_from_argv(argc, argv);
+    if (b == NULL) {
+        WrtLogE("bundle for APP_START is NULL");
+        return false;
+    }
+
+    const char* appid = bundle_get_val(b, AUL_K_PKG_NAME);
+    WrtLogD("appid : %s", appid);
+    m_webAppCoreDataManager->add(appid);
+    if (!appid || strlen(appid) == 0) {
+        WrtLogE("empty app name");
+        bundle_free(b);
+        m_webAppCoreDataManager->remove(appid);
+        return false;
+    }
+
+    if (!m_manager->create(appid, b)) {
+      WrtLogE("Terminate by app");
+      bundle_free(b);
+      m_webAppCoreDataManager->remove(appid);
+      return false;
+    }
+
+    return true;
+}
+
+void WebAppCore::setPidToAppID(const char* appId, unsigned int pid)
+{
+    WrtLogD("setPidToAppID Appid : %s  Pid : %d", appId, pid);
+    m_webAppCoreDataManager->setPid(appId, pid);
+}
+
+void WebAppCore::aulSocketHandler(app_pkt_t* pkt, int clifd, ucred cr)
+{
+    WrtLogD("called");
+
+    if (pkt->cmd != APP_RESULT && pkt->cmd != APP_CANCEL) {
+        int ret = __app_send_result_to_launchpad(clifd, 0);
+        if (ret < 0) {
+            free(pkt);
+            return;
+        }
+    } else {
+        close(clifd);
+    }
+    WrtLogD("Received command : %d", pkt->cmd);
+
+    bundle* b = bundle_decode(pkt->data, pkt->len);
+    std::string appId = bundle_get_val(b, AUL_K_PKG_NAME);
+    WrtLogD("Web app : %s", appId.c_str());
+    pid_t pid = m_webAppCoreDataManager->getPid(appId);
+
+    switch (pkt->cmd) {
+    case APP_START:
+    case APP_START_RES:
+    case APP_START_ASYNC:
+        WrtLogD("[WebAppCore] APP_START");
+        m_manager->service(appId, b);
+        if (m_webAppCoreDataManager->isSuspended(appId)) {
+            m_webAppCoreDataManager->resume(appId);
+        }
+        break;
+
+    case APP_OPEN:
+    case APP_RESUME:
+        WrtLogD("[WebAppCore] APP_RESUME");
+        m_manager->resume(appId);
+    case APP_RESUME_BY_PID:
+        WrtLogD("[WebAppCore] APP_RESUME_BY_PID");
+        if (pid < 0) {
+            WrtLogE("Wrong pid");
+        }
+        if (!WebAppCoreXUtil::raiseWin(pid)) {
+            WrtLogE("Fail to raise win");
+        }
+        break;
+
+    case APP_TERM_BY_PID:
+        WrtLogD("[WebAppCore] APP_TERM");
+        m_manager->terminate(appId);
+        m_webAppCoreDataManager->remove(appId);
+        break;
+
+    case APP_TERM_REQ_BY_PID:
+        WrtLogD("[WebAppCore] APP_TERM_REQ_BY_PID");
+        m_manager->terminate(appId);
+        m_webAppCoreDataManager->remove(appId);
+        break;
+
+    case APP_RESULT:
+    case APP_CANCEL:
+        WrtLogD("[WebAppCore] APP_RESULT & APP_CANCEL");
+        break;
+
+    case APP_KEY_EVENT:
+        WrtLogD("[WebAppCore] APP_KEY_EVENT");
+        //app_key_event(b);
+        break;
+
+    default:
+        WrtLogW("no support packet");
+    }
+    bundle_free(b);
+    free(pkt);
+
+    return;
+}
+
+Eina_Bool WebAppCore::ecoreXWindowShowCallback(void* data, int type, void* event)
+{
+    Assert(data);
+    Assert(event);
+
+    DPL_UNUSED_PARAM(type);
+
+    WebAppCore* This = static_cast<WebAppCore*>(data);
+    Ecore_X_Event_Window_Show* ev = static_cast<Ecore_X_Event_Window_Show*>(event);
+
+    WrtLogD("GET SHOW EVENT [%u]", ev->win);
+
+    Ecore_X_Window parent;
+    int ret = ecore_x_window_prop_window_get(ev->win, This->m_atomParent, &parent, 1);
+    if (ret != 1) {
+        WrtLogD("Ignore Event");
+        return ECORE_CALLBACK_RENEW;
+    }
+
+    char* appId = ecore_x_window_prop_string_get(ev->win, ECORE_X_ATOM_UTF8_STRING);
+    if (!appId || strlen(appId) == 0) {
+        WrtLogW("appId is NULL");
+        return ECORE_CALLBACK_RENEW;
+    }
+
+    pid_t pid = This->m_webAppCoreDataManager->getPid(appId);
+    if (pid < 0) {
+        WrtLogE("Wrong pid");
+    } else {
+        ecore_x_window_prop_property_set(ev->win, ECORE_X_ATOM_NET_WM_PID, ECORE_X_ATOM_CARDINAL, 32, &pid, 1);
+    }
+
+    This->m_webAppCoreDataManager->show(appId);
+
+    return ECORE_CALLBACK_RENEW;
+}
+
+Eina_Bool WebAppCore::ecoreXWindowHideCallback(void* data, int type, void* event)
+{
+    Assert(data);
+    Assert(event);
+
+    DPL_UNUSED_PARAM(type);
+
+    WebAppCore* This = static_cast<WebAppCore*>(data);
+    Ecore_X_Event_Window_Hide* ev = static_cast<Ecore_X_Event_Window_Hide*>(event);
+
+    WrtLogD("GET HIDE EVENT [%u]", ev->win);
+
+    char* appId = ecore_x_window_prop_string_get(ev->win, ECORE_X_ATOM_UTF8_STRING);
+    if (!appId || strlen(appId) == 0) {
+        WrtLogW("appid is null");
+        return ECORE_CALLBACK_RENEW;
+    }
+
+    This->m_manager->suspend(appId);
+    This->m_webAppCoreDataManager->hide(appId);
+    captureAndMakeFileForTaskMgr(ev->win, appId);
+    free(appId);
+    return ECORE_CALLBACK_RENEW;
+}
+
+Eina_Bool WebAppCore::ecoreXWindowVisibilityChangeCallback(void* data, int type, void* event)
+{
+    Assert(data);
+    Assert(event);
+
+    DPL_UNUSED_PARAM(type);
+
+    WebAppCore* This = static_cast<WebAppCore*>(data);
+    Ecore_X_Event_Window_Visibility_Change* ev = static_cast<Ecore_X_Event_Window_Visibility_Change*>(event);
+
+    WrtLogD("GET Change Visiblity EVENT [%u]", ev->win);
+
+    char* appId = ecore_x_window_prop_string_get(ev->win, ECORE_X_ATOM_UTF8_STRING);
+    if (!appId || strlen(appId) == 0) {
+        WrtLogW("appid is null");
+        return ECORE_CALLBACK_RENEW;
+    }
+    if (!This->m_webAppCoreDataManager->isAppIdFound(appId)) {
+        return ECORE_CALLBACK_RENEW;
+    }
+
+    //check status
+    if(ev->fully_obscured == 0) {
+        WrtLogD("Resume Visiblity EVENT [%u]", ev->win);
+        if (This->m_webAppCoreDataManager->isSuspended(appId)) {
+            This->m_manager->resume(appId);
+            This->m_webAppCoreDataManager->resume(appId);
+        }
+    } else if(ev->fully_obscured == 1) {
+        WrtLogD("Suspend Visiblity EVENT [%u]", ev->win);
+        if (This->m_webAppCoreDataManager->isResumed(appId)) {
+            This->m_manager->suspend(appId);
+            This->m_webAppCoreDataManager->suspend(appId);
+            captureAndMakeFileForTaskMgr(ev->win, appId);
+        }
+    } else {
+        WrtLogD("Ignore Visiblity EVENT");
+    }
+
+    free(appId);
+    return ECORE_CALLBACK_RENEW;
+}
+
+Eina_Bool WebAppCore::ecoreXWindowEventClientCallback(void *data, int type, void *event)
+{
+    Assert(data);
+    Assert(event);
+
+    DPL_UNUSED_PARAM(type);
+
+    WebAppCore* This = static_cast<WebAppCore*>(data);
+    Ecore_X_Event_Client_Message* ev = static_cast<Ecore_X_Event_Client_Message*>(event);
+
+    char* appId = ecore_x_window_prop_string_get(ev->win, ECORE_X_ATOM_UTF8_STRING);
+    if (!appId || strlen(appId) == 0) {
+        WrtLogW("appid is null");
+        return ECORE_CALLBACK_PASS_ON;
+    }
+    if (ev->message_type == This->m_atomParent && appId) {
+        WrtLogD("_E_ILLUME_ATOM_APPCORE_RECAPTURE_REQUEST win(%x)", ev->win);
+        captureAndMakeFileForTaskMgr(ev->win, appId);
+    }
+    free(appId);
+    return ECORE_CALLBACK_PASS_ON;
+}
+
+bool WebAppCore::addEcoreXWindowHandlers()
+{
+    WrtLogD("addEcoreXWindowHandlers");
+
+    m_atomParent = ecore_x_atom_get("_E_PARENT_BORDER_WINDOW");
+    if (!m_atomParent) {
+        WrtLogE("Error getting x atom from parent");
+        return false;
+    }
+
+    m_ecoreEventWindowShowHandler =
+        ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, ecoreXWindowShowCallback, this);
+    m_ecoreEventHideWindowShowHandler =
+        ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE, ecoreXWindowHideCallback, this);
+    m_ecoreEventVisibilityChangeHandler =
+        ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, ecoreXWindowVisibilityChangeCallback, this);
+    m_ecoreEventTaskMgrImageCreationHandler =
+        ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, ecoreXWindowEventClientCallback, this);
+    return true;
+}
+
+Eina_Bool WebAppCore::terminateEventCallback(void *data, int type, void *event)
+{
+    char *appId = (char*)event;
+    if (appId) {
+        WrtLogD("Terminate APP with ID : %s", appId);
+        WebAppCore *This = (WebAppCore*)data;
+        This->m_manager->terminate(appId);
+        This->m_webAppCoreDataManager->remove(appId);
+        free(appId);
+    }
+    return ECORE_CALLBACK_CANCEL;
+}
+
+Eina_Bool  WebAppCore::popupReplyWaitEventAulHandler(void* data, Ecore_Fd_Handler* handler)
+{
+    WrtLogD("AUL handler");
+    Assert(data);
+
+    WebAppCore* This = static_cast<WebAppCore*>(data);
+    int fd = ecore_main_fd_handler_fd_get(handler);
+    int clifd = -1;
+    struct ucred cr;
+
+    app_pkt_t* pkt = __app_recv_raw(fd, &clifd, &cr);
+    if (!pkt) {
+        WrtLogD("packet is NULL");
+        return ECORE_CALLBACK_RENEW;
+    }
+
+    bundle* b = bundle_decode(pkt->data, pkt->len);
+    if (!b) {
+        std::string appId = This->m_webAppCoreDataManager->getAppIdFromFd(fd);
+        if(appId.empty()){
+            WrtLogW("appid is null");
+            return ECORE_CALLBACK_RENEW;
+        }
+        bundle_raw *bundleData;
+        b = bundle_create();
+        bundle_add(b, AUL_K_PKG_NAME, appId.c_str());
+        bundle_encode(b, &bundleData, &pkt->len);
+        memcpy(pkt->data, bundleData, pkt->len);
+    }
+    This->aulSocketHandler(pkt, clifd, cr);
+    bundle_free(b);
+    return ECORE_CALLBACK_RENEW;
+}
+
+Eina_Bool WebAppCore::popupReplyWaitStartEventCallback(void *data, int type, void *event)
+{
+    WrtLogD("wait popup reply");
+    Assert(data);
+
+    char *appId = (char*)event;
+    if (!appId || strlen(appId) == 0) {
+        WrtLogW("appid is null");
+        return ECORE_CALLBACK_CANCEL;
+    }
+
+    WebAppCore *This = (WebAppCore*)data;
+    int fd = __create_server_sock(This->m_webAppCoreDataManager->getPid(appId));
+    if (fd < 0) {
+        WrtLogE("create sock failed");
+        return false;
+    }
+
+    Ecore_Fd_Handler* fdHandler = ecore_main_fd_handler_add(fd,
+                                    (Ecore_Fd_Handler_Flags)(ECORE_FD_READ|ECORE_FD_ERROR),
+                                    popupReplyWaitEventAulHandler, This, NULL, NULL);
+    This->m_webAppCoreDataManager->setFd(appId, fdHandler);
+    free(appId);
+
+    return ECORE_CALLBACK_CANCEL;
+}
+
+Eina_Bool WebAppCore::popupReplyWaitFinishEventCallback(void *data, int type, void *event)
+{
+    WrtLogD("finish popup reply");
+
+    char *appId = (char*)event;
+    if (!appId || strlen(appId) == 0) {
+        WrtLogW("appid is null");
+        return ECORE_CALLBACK_CANCEL;
+    }
+
+    WebAppCore *This = (WebAppCore*)data;
+    Ecore_Fd_Handler* fdHandler = This->m_webAppCoreDataManager->getFd(appId);
+    int fd = ecore_main_fd_handler_fd_get(fdHandler);
+    ecore_main_fd_handler_del(fdHandler);
+    close(fd);
+
+    This->m_webAppCoreDataManager->setFd(appId, NULL);
+    This->m_manager->resetAulConnection(appId);
+    return ECORE_CALLBACK_CANCEL;
+}
diff --git a/src/wrt-launchpad-daemon/src/web_app_core_data.cpp b/src/wrt-launchpad-daemon/src/web_app_core_data.cpp
new file mode 100644 (file)
index 0000000..a7f2838
--- /dev/null
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    web_app_core_data.cpp
+ * @author  Leerang Song (leerang.song@samsung.com)
+ */
+
+#include "web_app_core_data.h"
+
+#include <string>
+#include <unistd.h>
+
+#include <dpl/assert.h>
+#include <dpl/availability.h>
+#include <dpl/log/wrt_log.h>
+#include <Ecore.h>
+
+namespace {
+} // anonymous namespace
+
+WebAppCoreDataManager::WebAppCoreDataManager()
+{
+}
+
+WebAppCoreDataManager::~WebAppCoreDataManager()
+{
+}
+
+bool WebAppCoreDataManager::add(const std::string& appId)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        return false;
+    }
+
+    auto it = m_webAppCoreDataMap.find(appId);
+    if (it != m_webAppCoreDataMap.end()) {
+        WrtLogE("already exist");
+        return false;
+    }
+
+    WebAppCoreData* data = new WebAppCoreData();
+    data->status = WebAppCoreDataManager::Status::CREATED;
+    data->pid = -1;
+    m_webAppCoreDataMap.insert(WebAppCoreDataPair(appId, data));
+
+    return true;
+}
+
+bool WebAppCoreDataManager::remove(const std::string& appId)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        return false;
+    }
+
+    auto it = m_webAppCoreDataMap.find(appId);
+    if (it == m_webAppCoreDataMap.end()) {
+        WrtLogE("No data");
+        return false;
+    }
+
+    m_webAppCoreDataMap.erase(it);
+
+    return true;
+}
+
+void WebAppCoreDataManager::show(const std::string& appId)
+{
+    setStatus(appId, WebAppCoreDataManager::Status::RUNNING);
+}
+
+void WebAppCoreDataManager::hide(const std::string& appId)
+{
+    DPL_UNUSED_PARAM(appId);
+    // TODO sth
+}
+
+void WebAppCoreDataManager::resume(const std::string& appId)
+{
+    setStatus(appId, WebAppCoreDataManager::Status::RUNNING);
+}
+
+void WebAppCoreDataManager::suspend(const std::string& appId)
+{
+    setStatus(appId, WebAppCoreDataManager::Status::SUSPENDED);
+}
+
+bool WebAppCoreDataManager::isResumed(const std::string& appId)
+{
+    return compareStatus(appId, WebAppCoreDataManager::Status::RUNNING);
+}
+
+bool WebAppCoreDataManager::isSuspended(const std::string& appId)
+{
+    return compareStatus(appId, WebAppCoreDataManager::Status::SUSPENDED);
+}
+
+bool WebAppCoreDataManager::isAppIdFound(const std::string& appId)
+{
+    if (appId.empty())
+        return false;
+    auto it = m_webAppCoreDataMap.find(appId);
+    if (it == m_webAppCoreDataMap.end()) {
+        WrtLogE("appid not found in map");
+        return false;
+    }
+    return true;
+}
+
+WebAppCoreDataManager::Status WebAppCoreDataManager::getStatus(const std::string& appId)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    auto it = m_webAppCoreDataMap.find(appId);
+    if (it == m_webAppCoreDataMap.end()) {
+        WrtLogE("No data found for given pid");
+        Assert(false);
+    }
+
+    return it->second->status;
+}
+
+void WebAppCoreDataManager::setStatus(const std::string& appId, Status status)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    auto it = m_webAppCoreDataMap.find(appId);
+    if (it == m_webAppCoreDataMap.end()) {
+        WrtLogE("No data");
+        Assert(false);
+    }
+
+    it->second->status = status;
+    return;
+}
+
+bool WebAppCoreDataManager::compareStatus(const std::string& appId, Status status)
+{
+    return getStatus(appId) == status ? true : false;
+}
+
+void WebAppCoreDataManager::setPid(const std::string& appId, pid_t pid)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    auto it = m_webAppCoreDataMap.find(appId);
+    if (it == m_webAppCoreDataMap.end()) {
+        WrtLogE("No data");
+        Assert(false);
+    }
+
+    it->second->pid = pid;
+}
+
+pid_t WebAppCoreDataManager::getPid(const std::string& appId)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    auto it = m_webAppCoreDataMap.find(appId);
+    if (it == m_webAppCoreDataMap.end()) {
+        WrtLogE("No data");
+        Assert(false);
+    }
+
+    return it->second->pid;
+}
+
+void WebAppCoreDataManager::setFd(const std::string& appId, Ecore_Fd_Handler* fd)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    auto it = m_webAppCoreDataMap.find(appId);
+    if (it == m_webAppCoreDataMap.end()) {
+        WrtLogE("No data");
+        Assert(false);
+    }
+
+    it->second->fd = fd;
+}
+
+Ecore_Fd_Handler* WebAppCoreDataManager::getFd(const std::string& appId)
+{
+    if (appId.empty()) {
+        WrtLogE("appid is empty");
+        Assert(false);
+    }
+
+    auto it = m_webAppCoreDataMap.find(appId);
+    if (it == m_webAppCoreDataMap.end()) {
+        WrtLogE("No data");
+        Assert(false);
+    }
+
+    return it->second->fd;
+}
+
+std::string WebAppCoreDataManager::getAppIdFromFd(int fd)
+{
+    if (fd < 0) {
+        WrtLogE("fail to get fd");
+        Assert(false);
+    }
+    std::string str="";
+
+    for (auto it = m_webAppCoreDataMap.begin(); it != m_webAppCoreDataMap.end(); ++it) {
+        if (ecore_main_fd_handler_fd_get(it->second->fd) == fd) {
+            str = it->first;
+            break;
+        }
+    }
+    return str;
+}
diff --git a/src/wrt-launchpad-daemon/src/web_app_core_tskmgr_util.cpp b/src/wrt-launchpad-daemon/src/web_app_core_tskmgr_util.cpp
new file mode 100644 (file)
index 0000000..35c4b85
--- /dev/null
@@ -0,0 +1,491 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    web_app_core_tskmgr_util.cpp
+ * @author  Prathmesh Manurkar (prathmesh.m@samsung.com)
+ */
+
+#include "web_app_core_tskmgr_util.h"
+
+#include <sys/shm.h>
+
+#include <dpl/log/wrt_log.h>
+#include <Ecore_Evas.h>
+#include <Ecore_X.h>
+#include <Elementary.h>
+#include <X11/extensions/Xcomposite.h>
+#include <X11/extensions/XShm.h>
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+#define QUALITY_N_COMPRESS "quality=100 compress=1"
+
+static Evas *createVirtualCanvas(int w, int h)
+{
+    Ecore_Evas *internal_ee;
+    Evas *internal_e;
+
+    // Create virtual canvas
+    internal_ee = ecore_evas_buffer_new(w, h);
+    if (!internal_ee) {
+        WrtLogW("Failed to create a new canvas buffer");
+        return NULL;
+    }
+
+    ecore_evas_alpha_set(internal_ee, EINA_TRUE);
+    ecore_evas_manual_render_set(internal_ee, EINA_TRUE);
+
+    // Get the "Evas" object from a virtual canvas
+    internal_e = ecore_evas_get(internal_ee);
+    if (!internal_e) {
+        ecore_evas_free(internal_ee);
+        WrtLogW("Faield to get Evas object");
+        return NULL;
+    }
+
+    return internal_e;
+}
+
+
+
+static bool flushDataToFile(Evas *e, void *data, const char *filename, int w, int h)
+{
+    Evas_Object *output;
+
+    output = evas_object_image_add(e);
+    if (!output) {
+        WrtLogW("Failed to create an image object");
+        return false;
+    }
+
+    evas_object_image_data_set(output, NULL);
+    evas_object_image_colorspace_set(output, EVAS_COLORSPACE_ARGB8888);
+    evas_object_image_alpha_set(output, EINA_TRUE);
+    evas_object_image_size_set(output, w, h);
+    evas_object_image_smooth_scale_set(output, EINA_TRUE);
+    evas_object_image_data_set(output, data);
+    evas_object_image_data_update_add(output, 0, 0, w, h);
+
+    if (evas_object_image_save(output, filename, NULL, QUALITY_N_COMPRESS) == EINA_FALSE) {
+        evas_object_del(output);
+        WrtLogW("Faild to save a captured image (%s)", filename);
+        return false;
+    }
+
+    evas_object_del(output);
+
+    if (access(filename, F_OK) != 0) {
+        WrtLogW("File %s is not found", filename);
+        return false;
+    }
+
+    return true;
+}
+
+
+
+static bool flushVirtualCanvasToFile(Evas *e, const char *filename, int w, int h)
+{
+    void *data;
+    Ecore_Evas *internal_ee;
+
+    internal_ee = ecore_evas_ecore_evas_get(e);
+    if (!internal_ee) {
+        WrtLogW("Failed to get ecore evas");
+        return false;
+    }
+
+    ecore_evas_manual_render(internal_ee);
+
+    // Get a pointer of a buffer of the virtual canvas
+    data = (void *) ecore_evas_buffer_pixels_get(internal_ee);
+    if (!data) {
+        WrtLogW("Failed to get pixel data");
+        return false;
+    }
+
+    return flushDataToFile(e, data, filename, w, h);
+}
+
+
+
+static bool destroyVirtualCanvas(Evas *e)
+{
+    Ecore_Evas *ee;
+
+    ee = ecore_evas_ecore_evas_get(e);
+    if (!ee) {
+        WrtLogW("Failed to ecore evas object");
+        return false;
+    }
+
+    ecore_evas_free(ee);
+    return true;
+}
+
+static Window getParentWindow(Window id)
+{
+    Window root;
+    Window parent;
+    Window *children;
+    unsigned int num;
+
+    if (!XQueryTree((Display*)ecore_x_display_get(), id, &root, &parent, &children, &num)) {
+        return 0;
+    }
+
+    if (children) {
+        XFree(children);
+    }
+
+    return parent;
+}
+
+static Window findCaptureWindow(Window id, Visual **visual, int *depth, int *width, int *height)
+{
+    XWindowAttributes attr;
+    Window parent = id;
+    Window orig_id = id;
+
+    if (id == 0) {
+        return (Window)-1;
+    }
+
+    do {
+        id = parent;
+
+        if (!XGetWindowAttributes((Display*)ecore_x_display_get(), id, &attr)) {
+            return (Window)-1;
+        }
+
+        parent = getParentWindow(id);
+
+        if (attr.map_state == IsViewable
+            && attr.override_redirect == true
+            && attr.c_class == InputOutput && parent == attr.root) {
+            *depth = attr.depth;
+            *width = attr.width;
+            *height = attr.height;
+            *visual = attr.visual;
+            return id;
+        }
+    } while (parent != attr.root && parent != 0);
+
+    XGetWindowAttributes((Display*)ecore_x_display_get(), orig_id, &attr);
+    *depth = attr.depth;
+    *width = attr.width;
+    *height = attr.height;
+    *visual = attr.visual;
+
+    return (Window) 0;
+
+}
+
+static char *captureWindow(Window id, Visual *visual, int width, int height, int depth, int *size)
+{
+    XShmSegmentInfo si;
+    XImage *xim;
+    int img_size;
+    char *captured_img = NULL;
+
+    /* (depth >> 3) + 1 == 4 byte */
+    si.shmid =
+        shmget(IPC_PRIVATE, width * height * ((depth >> 3) + 1),
+           IPC_CREAT | 0666);
+
+    if (si.shmid < 0) {
+        WrtLogW("shmget");
+        return NULL;
+    }
+
+    si.readOnly = False;
+    si.shmaddr = (char*)shmat(si.shmid, NULL, 0);
+
+    if (si.shmaddr == (char *)-1) {
+        shmdt(si.shmaddr);
+        shmctl(si.shmid, IPC_RMID, 0);
+        return NULL;
+    }
+
+    xim = XShmCreateImage((Display*)ecore_x_display_get(), visual, depth, ZPixmap, NULL, &si,
+                width, height);
+
+    if (xim == 0) {
+        shmdt(si.shmaddr);
+        shmctl(si.shmid, IPC_RMID, 0);
+
+        return NULL;
+    }
+
+    img_size = xim->bytes_per_line * xim->height;
+    xim->data = si.shmaddr;
+
+    XSync((Display*)ecore_x_display_get(), False);
+    XShmAttach((Display*)ecore_x_display_get(), &si);
+    XShmGetImage((Display*)ecore_x_display_get(), id, xim, 0, 0, 0xFFFFFFFF);
+    XSync((Display*)ecore_x_display_get(), False);
+
+    captured_img = (char*)calloc(1, img_size);
+    if (captured_img) {
+        memcpy(captured_img, xim->data, img_size);
+    } else {
+        WrtLogD("calloc");
+    }
+
+    XShmDetach((Display*)ecore_x_display_get(), &si);
+    XDestroyImage(xim);
+
+
+    shmdt(si.shmaddr);
+    shmctl(si.shmid, IPC_RMID, 0);
+
+    *size = img_size;
+
+    return captured_img;
+}
+
+#define _WND_REQUEST_ANGLE_IDX 0
+int getAngle(Ecore_X_Window win)
+{
+    WrtLogD("getAngle called");
+
+    int after = -1;
+
+    do {
+        int ret, count;
+        int angle[2] = {-1, -1};
+        unsigned char* prop_data = NULL;
+
+        ret = ecore_x_window_prop_property_get(win,
+                ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+                ECORE_X_ATOM_CARDINAL,
+                32,
+                &prop_data,
+                &count);
+        if (ret <= 0) {
+            if (prop_data) free(prop_data);
+            break;
+        }
+
+        if (prop_data) {
+            memcpy(&angle, prop_data, sizeof (int) *count);
+            free(prop_data);
+        }
+
+        after = angle[_WND_REQUEST_ANGLE_IDX];
+    } while (0);
+
+    if (-1 == after) after = 0;
+
+    return after;
+}
+
+static void rotateImg(Evas_Object *image_object, int angle, int cx, int cy)
+{
+    Evas_Map *em;
+
+    if (NULL == image_object)
+        return;
+
+    em = evas_map_new(4);
+    if(NULL == em)
+        return;
+
+    evas_map_util_points_populate_from_object(em, image_object);
+    evas_map_util_rotate(em, (double) angle, cx, cy);
+
+    evas_object_map_set(image_object, em);
+    evas_object_map_enable_set(image_object, EINA_TRUE);
+
+    evas_map_free(em);
+}
+
+#define EXTENSION_LEN 128
+#define CAPTURE_FILE_PATH "/opt/usr/share/app_capture"
+static bool makeCaptureFile(const char *package, int width, int height, char *img, int angle)
+{
+    int len;
+    char *filename;
+    Evas *e;
+    Evas_Object *image_object;
+    int canvas_width, canvas_height;
+    int cx = 0, cy = 0;
+    int mx = 0;
+
+    if (NULL == package)
+        return false;
+
+    len = strlen(package) + EXTENSION_LEN;
+    filename = (char*)malloc(len);
+    if(NULL == filename)
+        return false;
+
+    snprintf(filename, len, CAPTURE_FILE_PATH"/%s.jpg", package);
+
+    if (90 == angle || 270 == angle) {
+        canvas_width = height;
+        canvas_height = width;
+    } else {
+        canvas_width = width;
+        canvas_height = height;
+    }
+
+    e = createVirtualCanvas(canvas_width, canvas_height);
+    if (NULL == e)
+        goto error;
+
+    image_object = evas_object_image_add(e);
+    if (NULL == image_object)
+        goto error;
+
+    evas_object_image_size_set(image_object, width, height);
+    evas_object_image_data_set(image_object, img);
+    evas_object_image_data_update_add(image_object, 0, 0, width, height);
+    evas_object_resize(image_object, width, height);
+    evas_object_image_filled_set(image_object, EINA_TRUE);
+    switch (angle) {
+        case 90:
+            cx = canvas_width - width / 2;
+            cy = canvas_height / 2;
+            mx = canvas_width - width;
+            break;
+        case 180:
+            cx = width / 2;
+            cy = height / 2;
+            break;
+        case 270:
+            cx = width / 2;
+            cy = canvas_height / 2;
+            break;
+        default:
+            break;
+    }
+    evas_object_move(image_object, mx, 0);
+    rotateImg(image_object, angle, cx, cy);
+    evas_object_show(image_object);
+
+    if (access(CAPTURE_FILE_PATH, F_OK) != 0) {
+        mkdir(CAPTURE_FILE_PATH, 0777);
+    }
+    if(false == flushVirtualCanvasToFile(e, filename, canvas_width, canvas_height))
+        goto error;
+
+    evas_object_del(image_object);
+    destroyVirtualCanvas(e);
+    free(filename);
+
+    return true;
+
+error:
+    do {
+        free(filename);
+
+        if (!e) break;
+        destroyVirtualCanvas(e);
+
+        if (!image_object) break;
+        evas_object_del(image_object);
+    } while (0);
+
+    return false;
+}
+
+static int resizeTo8888(const char* pDataIn, char* pDataOut, int inWidth, int inHeight, int outWidth, int outHeight)
+{
+    int scaleX = 0;
+    int scaleY = 0;
+    int i = 0;
+    int j = 0;
+    int iRow = 0;
+    int iIndex = 0;
+    char* pOutput = pDataOut;
+    char* pOut = pDataOut;
+    const char* pIn = NULL;
+    int *pColLUT = (int*)malloc(sizeof(int) * outWidth);
+
+    /* Calculate X Scale factor */
+    scaleX = inWidth * 256 / outWidth;
+    /* Calculate Y Scale factor, aspect ratio is not maintained */
+    scaleY = inHeight * 256 / outHeight;
+    for (j = 0; j < outWidth; j++) {
+        /* Get input index based on column scale factor */
+        /* To get more optimization, this is calculated once and
+        * is placed in a LUT and used for indexing
+        */
+        pColLUT [j] = ((j * scaleX) >> 8) * 4;
+    }
+    pOut = pOutput;
+    for (i = 0; i < outHeight; i++) {
+        /* Get input routWidth index based on routWidth scale factor */
+        iRow = (i * scaleY >> 8) * inWidth * 4;
+        /* Loop could be unrolled for more optimization */
+        for (j = 0; j < (outWidth); j++) {
+            /* Get input index based on column scale factor */
+            iIndex = iRow + pColLUT [j];
+            pIn = pDataIn + iIndex;
+            *pOut++ = *pIn++;
+            *pOut++ = *pIn++;
+            *pOut++ = *pIn++;
+            *pOut++ = *pIn++;
+        }
+    }
+
+    free(pColLUT);
+    return 0;
+}
+
+void captureAndMakeFileForTaskMgr(Ecore_X_Window win, const char *package)
+{
+    Visual *visual;
+    Window redirected_id;
+
+    int width, height, depth;
+    int width_out, height_out;
+    int size = 0;
+    int angle;
+
+    char *img;
+
+    redirected_id = findCaptureWindow(win, &visual, &depth, &width, &height);
+    if (redirected_id == (Window) -1 || redirected_id == (Window) 0) {
+        return;
+    }
+
+    WrtLogD("Capture : win[%x] -> redirected win[%x] for %s", win, redirected_id, package);
+
+    img = captureWindow(redirected_id, visual, width, height, depth, &size);
+    if (NULL == img) {
+        return;
+    }
+
+    width_out = width/2;
+    height_out = height/2;
+
+    if ( width_out < 1 || height_out < 1 ) {
+        free(img);
+        return;
+    }
+
+    resizeTo8888(img, img, width, height, width_out, height_out);
+
+    angle = getAngle(win);
+    if (false == makeCaptureFile(package, width_out, height_out, img, angle)) {
+        WrtLogW("cannot a capture file for the package of [%s]", package);
+    }
+
+    free(img);
+}
diff --git a/src/wrt-launchpad-daemon/src/web_app_core_x_util.cpp b/src/wrt-launchpad-daemon/src/web_app_core_x_util.cpp
new file mode 100644 (file)
index 0000000..25e3706
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+  * @file    web_app_core_x_util.cpp
+  * @author  Jihoon Chung (jihoon.chung@samsung.com)
+  */
+
+#include "web_app_core_x_util.h"
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+
+#include <dpl/assert.h>
+#include <dpl/log/wrt_log.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
+namespace {
+pid_t getWinByPid(Display* d, Window win)
+{
+    XWindowAttributes attr;
+    if (!XGetWindowAttributes(d, win, &attr)) {
+        return -1;
+    }
+
+    if (attr.override_redirect || attr.c_class == InputOnly) {
+        return -1;
+    }
+
+    Atom atomType;
+    int format;
+    unsigned long nItems;
+    unsigned long afterBytes;
+    unsigned char* ret = NULL;
+    Atom atomPid = XInternAtom(d, "_NET_WM_PID", True);
+    int r = XGetWindowProperty(d, win, atomPid, 0, 1, False, XA_CARDINAL, &atomType, &format, &nItems, &afterBytes, &ret);
+    if (r != Success || ret == NULL) {
+        return -1;
+    }
+
+    pid_t pid;
+    if (atomType == XA_CARDINAL && format == 32) {
+        pid = *reinterpret_cast<pid_t*>(ret);
+    } else {
+        pid = -1;
+    }
+
+    XFree(ret);
+
+    return pid;
+}
+
+int findWin(Display* d, Window* win, pid_t pid)
+{
+    pid_t p = getWinByPid(d, *win);
+    if (p == pid) {
+        return 1;
+    }
+
+    Window root, parent, *child;
+    unsigned int n;
+    int r = XQueryTree(d, *win, &root, &parent, &child, &n);
+    if (r) {
+        int found = 0;
+        for (unsigned int i = 0; i < n; i++) {
+            found = findWin(d, &child[i], pid);
+            if (found) {
+                *win = child[i];
+                break;
+            }
+        }
+        XFree(child);
+
+        if (found) {
+            return 1;
+        }
+    }
+
+    return 0;
+}
+
+void internalRaiseWin(Display* d, Window win)
+{
+    XEvent xev;
+    xev.xclient.type = ClientMessage;
+    xev.xclient.display = d;
+    xev.xclient.window = win;
+    xev.xclient.message_type = XInternAtom(d, "_NET_ACTIVE_WINDOW", False);
+    xev.xclient.format = 32;
+    xev.xclient.data.l[0] = 1;
+    xev.xclient.data.l[1] = CurrentTime;
+    xev.xclient.data.l[2] = 0;
+    xev.xclient.data.l[3] = 0;
+    xev.xclient.data.l[4] = 0;
+    Window root = XDefaultRootWindow(d);
+    XSendEvent(d, root, False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
+}
+} // anonymous namespace
+
+bool WebAppCoreXUtil::raiseWin(pid_t pid)
+{
+    WrtLogD("raise win pid[%d]", pid);
+
+    if (pid < 1) {
+        WrtLogE("Wrong pid");
+        return false;
+    }
+
+    int ret = kill(pid, 0);
+    if (ret == -1) {
+        WrtLogE("No process");
+        return false;
+    }
+
+    Display* d = XOpenDisplay(NULL);
+    Window win = XDefaultRootWindow(d);
+
+    int found = findWin(d, &win, pid);
+    if (!found) {
+        WrtLogE("Fail to find win");
+        XCloseDisplay(d);
+        return false;
+    }
+
+    internalRaiseWin(d, win);
+
+    XCloseDisplay(d);
+
+    return true;
+}
+
diff --git a/src/wrt-launchpad-daemon/src/web_internal_eventloop.cpp b/src/wrt-launchpad-daemon/src/web_internal_eventloop.cpp
new file mode 100644 (file)
index 0000000..cf9fb4e
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+ /**
+ * @file    web_internal_eventloop.cpp
+ * @author  Prathmesh (prathmesh.m@samsung.com)
+ */
+
+#include "web_internal_eventloop.h"
+#include <dpl/singleton_safe_impl.h>
+
+IMPLEMENT_SAFE_SINGLETON(WebInternalEvent)
+
+WebInternalEvent::WebInternalEvent()
+{
+}
+
+#ifdef SUPPORT_MULTIPLE_REQUEST
+WebInternalEvent::~WebInternalEvent()
+{
+    for (auto it = m_webInternalEventMap.begin(); it != m_webInternalEventMap.end(); ++it) {
+        delete it->second;
+    }
+    m_webInternalEventMap.clear();
+}
+
+void WebInternalEvent::addListner(webInternalEventType type, Ecore_Event_Handler_Cb cbFunc, void *data)
+{
+    auto it = m_webInternalEventMap.find(type);
+    if (it != m_webInternalEventMap.end())
+        return;
+
+    WebInternalUserCBData* cbData = new WebInternalUserCBData();
+    cbData->m_event = ecore_event_type_new();
+    cbData->m_callerCallback = cbFunc;
+    cbData->m_data = data;
+    m_customEventHandler = ecore_event_handler_add(cbData->m_event, eventTriggeredCallback, this);
+    m_webInternalEventMap.insert(WebInternalEventPair(type, cbData));
+}
+
+void WebInternalEvent::deleteListner(webInternalEventType type)
+{
+    auto it = m_webInternalEventMap.find(type);
+    if (it != m_webInternalEventMap.end()) {
+        delete it->second;
+        m_webInternalEventMap.erase(it);
+    }
+}
+
+void WebInternalEvent::sendEvent(webInternalEventType type, void *eventInfo)
+{
+    auto it = m_webInternalEventMap.find(type);
+    if (it != m_webInternalEventMap.end()) {
+        WebInternalUserCBData* cbData = it->second;
+        ecore_event_add(cbData->m_event, eventInfo, freeEventInfo, NULL);
+    }
+}
+
+void WebInternalEvent::freeEventInfo(void *user_data, void *func_data)
+{
+    // Do nothing. Added here else the default free is called.
+    // Need to override the default free and insteed free after
+    // its done for us
+}
+
+Eina_Bool WebInternalEvent::eventTriggeredCallback(void *data, int type, void *eventInfo)
+{
+    WebInternalEvent* This = (WebInternalEvent*)data;
+
+    for (auto it = This->m_webInternalEventMap.begin(); it != This->m_webInternalEventMap.end(); ++it) {
+        WebInternalUserCBData* cbData = it->second;
+        if (cbData->m_event == type) {
+            cbData->m_callerCallback(cbData->m_data, it->first, eventInfo);
+            break;
+        }
+    }
+    return ECORE_CALLBACK_PASS_ON;
+}
+
+#else // SUPPORT_MULTIPLE_REQUEST
+
+WebInternalEvent::~WebInternalEvent()
+{
+}
+
+void WebInternalEvent::addListner(webInternalEventType type, Ecore_Event_Handler_Cb cbFunc, void *data)
+{
+    if (WEB_APP_TERMINATE == type) {
+        m_backEvent = ecore_event_type_new();
+        m_customEventHandler = ecore_event_handler_add(m_backEvent, eventTriggeredCallback, this);
+        m_callerData = data;
+        m_callerCallback = cbFunc;
+    }
+}
+
+void WebInternalEvent::deleteListner(webInternalEventType type)
+{
+
+}
+
+void WebInternalEvent::sendEvent(webInternalEventType type, void *eventInfo)
+{
+    if (WEB_APP_TERMINATE == type) {
+         ecore_event_add(m_backEvent, eventInfo, NULL, NULL);
+    }
+}
+
+Eina_Bool WebInternalEvent::eventTriggeredCallback(void *data, int type, void *eventInfo)
+{
+    WebInternalEvent* This = (WebInternalEvent*)data;
+    if (This->m_backEvent == type) {
+        Ecore_Event_Handler_Cb cb = This->m_callerCallback;
+        cb(This->m_callerData, WEB_APP_TERMINATE, eventInfo);
+    }
+    return ECORE_CALLBACK_PASS_ON;
+}
+#endif // SUPPORT_MULTIPLE_REQUEST
diff --git a/src/wrt-launchpad-daemon/wrt_launchpad_daemon.map b/src/wrt-launchpad-daemon/wrt_launchpad_daemon.map
new file mode 100644 (file)
index 0000000..a15ae6e
--- /dev/null
@@ -0,0 +1,18 @@
+{
+    global:
+        main;
+        _Jv_RegisterClasses;
+        __bss_end__;
+        __bss_start;
+        __bss_start__;
+        __cxa_finalize;
+        __end__;
+        __gmon_start__;
+        _bss_end__;
+        _edata;
+        _end;
+        _fini;
+        _init;
+    local: *;
+};
+
diff --git a/systemd/wrt_launchpad_daemon@.service b/systemd/wrt_launchpad_daemon@.service
new file mode 100644 (file)
index 0000000..5863a1a
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Start the wrt_launchpad_daemon
+After=tizen-system.target
+
+[Service]
+EnvironmentFile=/run/tizen-mobile-env
+ExecStart=/usr/bin/wrt_launchpad_daemon "                                                                                                                                                                                                         "
+KillSignal=SIGKILL
+Restart=always
+RestartSec=0
+
+[Install]
+WantedBy=tizen-runtime.target
diff --git a/systemd/wrt_launchpad_daemon_1.socket b/systemd/wrt_launchpad_daemon_1.socket
new file mode 100644 (file)
index 0000000..9989eef
--- /dev/null
@@ -0,0 +1,10 @@
+[Socket]
+ListenStream=/tmp/alaunch/-3
+DirectoryMode=0777
+SocketMode=0777
+SmackLabelIPIn=*
+SmackLabelIPOut=@
+Service=wrt_launchpad_daemon@app.service
+
+[Install]
+WantedBy=sockets.target
diff --git a/systemd/wrt_launchpad_daemon_1.socket.in b/systemd/wrt_launchpad_daemon_1.socket.in
new file mode 100644 (file)
index 0000000..9989eef
--- /dev/null
@@ -0,0 +1,10 @@
+[Socket]
+ListenStream=/tmp/alaunch/-3
+DirectoryMode=0777
+SocketMode=0777
+SmackLabelIPIn=*
+SmackLabelIPOut=@
+Service=wrt_launchpad_daemon@app.service
+
+[Install]
+WantedBy=sockets.target
diff --git a/systemd/wrt_launchpad_daemon_1.socket.lite.in b/systemd/wrt_launchpad_daemon_1.socket.lite.in
new file mode 100644 (file)
index 0000000..57e89bb
--- /dev/null
@@ -0,0 +1,10 @@
+[Socket]
+ListenStream=/tmp/alaunch/-3
+DirectoryMode=0777
+SocketMode=0777
+SmackLabelIPIn=*
+SmackLabelIPOut=wrt_launchpad_daemon
+Service=wrt_launchpad_daemon@app.service
+
+[Install]
+WantedBy=sockets.target
diff --git a/systemd/wrt_launchpad_daemon_2.socket b/systemd/wrt_launchpad_daemon_2.socket
new file mode 100644 (file)
index 0000000..dff27df
--- /dev/null
@@ -0,0 +1,7 @@
+[Socket]
+ListenStream=/tmp/wrt_process_pool_server
+SocketMode=0777
+Service=wrt_launchpad_daemon@app.service
+
+[Install]
+WantedBy=sockets.target
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..da45ba9
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+# @file        CMakeLists.txt
+# @author      Karol Pawlowski (k.pawlowski@samsung.com)
+#
+
+ADD_SUBDIRECTORY(widgets)
diff --git a/tests/widgets/CMakeLists.txt b/tests/widgets/CMakeLists.txt
new file mode 100644 (file)
index 0000000..db1f03e
--- /dev/null
@@ -0,0 +1,87 @@
+# Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+# @file        CMakeLists.txt
+# @author      Karol Pawlowski (k.pawlowski@samsung.com)
+#
+INCLUDE(CMakeUtils.txt)
+
+PKG_SEARCH_MODULE(dpl-test-efl REQUIRED dpl-test-efl)
+PKG_SEARCH_MODULE(dbus-1 REQUIRED dbus-1)
+PKG_SEARCH_MODULE(libidn REQUIRED libidn)
+PKG_SEARCH_MODULE(wrt-plugins-widgetdb REQUIRED wrt-plugins-widgetdb)
+PKG_SEARCH_MODULE(ecore-imf REQUIRED ecore-imf)
+PKG_SEARCH_MODULE(ecore-ipc REQUIRED ecore-ipc)
+PKG_SEARCH_MODULE(ecore-evas REQUIRED ecore-evas)
+PKG_SEARCH_MODULE(ecore-file REQUIRED ecore-file)
+PKG_SEARCH_MODULE(ecore-input REQUIRED ecore-input)
+
+GROUP_DEPS(COMMON_LIB_PKGS DEPS
+   dbus-1
+   libpcrecpp
+   dpl-efl
+   dpl-test-efl
+   dpl-utils-efl
+   dpl-wrt-dao-ro
+   dpl-event-efl
+   wrt-plugins-widgetdb
+   glib
+   gthread
+   ewebkit2
+   edje
+   ecore
+   ecore-x
+   ecore-imf
+   ecore-ipc
+   ecore-evas
+   ecore-file
+   ecore-input
+   evas
+   eina
+   elementary
+   vconf
+   aul
+   libidn
+   libiri
+)
+
+SET(WRT_TEST_LIBRARY "wrt-tests-libs")
+
+INCLUDE_DIRECTORIES(
+  ${ewebkit2_INCLUDE_DIRS}
+  ${dpl-efl_INCLUDE_DIRS}
+  ${dpl-test-efl_INCLUDE_DIRS}
+  ${CMAKE_CURRENT_SOURCE_DIR}/common
+  ${PROJECT_SOURCE_DIR}/src/view
+  ${WRT_API_NEW_INCLUDES}
+)
+
+
+ADD_SUBDIRECTORY(files)
+ADD_SUBDIRECTORY(common)
+
+SET(TESTS_SOURCES
+    ${CMAKE_CURRENT_SOURCE_DIR}/TestInit.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/TestCases.cpp
+)
+
+SET(TESTS_TARGET "wrt-tests-general")
+
+WRT_TEST_BUILD(${TESTS_TARGET} ${TESTS_SOURCES})
+WRT_TEST_INSTALL(${TESTS_TARGET})
+TARGET_LINK_LIBRARIES(${TESTS_TARGET}
+    ${COMMON_LIB_PKGS_LIBRARIES}
+    ${WRT_TEST_LIBRARY}
+    ${TARGET_CORE_MODULE_LIB}
+)
diff --git a/tests/widgets/CMakeUtils.txt b/tests/widgets/CMakeUtils.txt
new file mode 100644 (file)
index 0000000..6af08ff
--- /dev/null
@@ -0,0 +1,184 @@
+# @file        CMakeUtils.txt
+# @author      Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
+# @author      Pawel Sikorski (p.sikorski@samsung.com)
+# @author      Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
+# @version     1.0
+# @brief
+#
+
+#
+# Discovers target's INCLUDE_DIRECTORIES and LINK_DIRECTORIES.
+# This is done by retrieving the directory target was built in and
+# fetching appropriate properties of that directory.
+FUNCTION(WRT_INTROSPECT_TARGET PREFIX TARGET_NAME)
+  GET_TARGET_PROPERTY(LOCATION ${TARGET_NAME} LOCATION)
+  IF(${LOCATION} STREQUAL "LOCATION-NOTFOUND")
+    MESSAGE(FATAL_ERROR "Target '${TARGET_NAME}' introspection failed")
+  ELSE(${LOCATION} STREQUAL "LOCATION-NOTFOUND")
+    STRING(FIND ${LOCATION} "/" LAST_SLASH_POSITION REVERSE)
+    STRING(SUBSTRING ${LOCATION} 0 ${LAST_SLASH_POSITION} LOCATION)
+
+    GET_DIRECTORY_PROPERTY(INCLUDE_DIRS DIRECTORY ${LOCATION} INCLUDE_DIRECTORIES)
+    SET("${PREFIX}_INCLUDE_DIRS" ${INCLUDE_DIRS} PARENT_SCOPE)
+
+    GET_DIRECTORY_PROPERTY(LIBRARY_DIRS DIRECTORY ${LOCATION} LINK_DIRECTORIES)
+    SET("${PREFIX}_LIBRARY_DIRS" ${LIBRARY_DIRS} PARENT_SCOPE)
+  ENDIF(${LOCATION} STREQUAL "LOCATION-NOTFOUND")
+ENDFUNCTION(WRT_INTROSPECT_TARGET)
+
+FUNCTION(WRT_TEST_LIBRARY)
+  SET_PROPERTY(GLOBAL APPEND PROPERTY COMMON_TESTS_LIBRARY ${ARGV})
+ENDFUNCTION(WRT_TEST_LIBRARY)
+
+#
+# Replacement functions for standard (w/o "WRT_" prefix) CMake functions.
+# They store supplied arguments in global properties to assign them to tests.
+# Anything added with this functions is used by all targets that are built with
+# WRT_TEST_BUILD function.
+
+#
+# Appends directories to global property TESTS_INCLUDE_DIRS which is
+# then read by WRT_TEST_BUILD and its content is forwarded to
+# command INCLUDE_DIRECTORIES() (for all targets).
+FUNCTION(WRT_INCLUDE_DIRECTORIES)
+  SET_PROPERTY(GLOBAL APPEND PROPERTY TESTS_INCLUDE_DIRS ${ARGV})
+ENDFUNCTION(WRT_INCLUDE_DIRECTORIES)
+
+#
+# Appends directories to global property TESTS_LIBRARY_DIRS which is
+# then read by WRT_TEST_BUILD and its content is forwarded to
+# command LINK_DIRECTORIES() (for all targets).
+FUNCTION(WRT_LINK_DIRECTORIES)
+  SET_PROPERTY(GLOBAL APPEND PROPERTY TESTS_LIBRARY_DIRS ${ARGV})
+ENDFUNCTION(WRT_LINK_DIRECTORIES)
+
+#
+# Appends directories to global property TESTS_LIBRARIES which is
+# then read by WRT_TEST_BUILD and its content is forwarded to
+# command TARGET_LINK_LIBRARIES() (for all targets).
+FUNCTION(WRT_TARGET_LINK_LIBRARIES)
+  SET_PROPERTY(GLOBAL APPEND PROPERTY TESTS_LIBRARIES ${ARGV})
+ENDFUNCTION(WRT_TARGET_LINK_LIBRARIES)
+
+#
+# Convenience method that fills TESTS_INCLUDE_DIRS, TESTS_LIBRARY_DIRS
+# and TESTS_LIBRARIES with values discovered from introspecting supplied
+# targets.
+# Function takes arbitrary number of targets.
+FUNCTION(WRT_ADD_INTERNAL_DEPENDENCIES)
+  FOREACH(DEPENDENCY ${ARGV})
+    WRT_INTROSPECT_TARGET(prefix ${DEPENDENCY})
+    WRT_INCLUDE_DIRECTORIES(${prefix_INCLUDE_DIRS})
+    WRT_LINK_DIRECTORIES(${prefix_LIBRARY_DIRS})
+    WRT_TARGET_LINK_LIBRARIES(${DEPENDENCY})
+  ENDFOREACH(DEPENDENCY)
+ENDFUNCTION(WRT_ADD_INTERNAL_DEPENDENCIES)
+
+
+#
+# Replacement functions for standard (w/o "WRT_" prefix) CMake functions.
+# They store supplied arguments in global properties to assign them to specific
+# tests. Properties names are based on the test target name.
+# Anything added with this functions is used only by the specified target that
+# is built with WRT_TEST_BUILD function.
+
+#
+# Appends directories to global property ${TARGET_NAME}_INCLUDE_DIRS
+# which is then read by WRT_TEST_BUILD and its content is forwarded to
+# command INCLUDE_DIRECTORIES() (for specified target).
+FUNCTION(WRT_TEST_INCLUDE_DIRECTORIES TARGET_NAME)
+  SET_PROPERTY(GLOBAL APPEND PROPERTY ${TARGET_NAME}_INCLUDE_DIRS ${ARGN})
+ENDFUNCTION(WRT_TEST_INCLUDE_DIRECTORIES)
+
+#
+# Appends directories to global property ${TARGET_NAME}_LIBRARY_DIRS
+# which is then read by WRT_TEST_BUILD and its content is forwarded to
+# command LINK_DIRECTORIES() (for specified target).
+FUNCTION(WRT_TEST_LINK_DIRECTORIES TARGET_NAME)
+  SET_PROPERTY(GLOBAL APPEND PROPERTY ${TARGET_NAME}_LIBRARY_DIRS ${ARGN})
+ENDFUNCTION(WRT_TEST_LINK_DIRECTORIES)
+
+#
+# Appends directories to global property ${TARGET_NAME}_LIBRARIES
+# which is then read by WRT_TEST_BUILD and its content is forwarded to
+# command TARGET_LINK_LIBRARIES() (for specified target).
+FUNCTION(WRT_TEST_TARGET_LINK_LIBRARIES TARGET_NAME)
+  SET_PROPERTY(GLOBAL APPEND PROPERTY ${TARGET_NAME}_LIBRARIES ${ARGN})
+ENDFUNCTION(WRT_TEST_TARGET_LINK_LIBRARIES)
+
+#
+# Convenience method that fills ${TARGET_NAME}_INCLUDE_DIRS,
+# ${TARGET_NAME}_LIBRARY_DIRS and ${TARGET_NAME}_LIBRARIES with
+# values discovered from introspecting supplied targets.
+# Function takes arbitrary number of targets.
+FUNCTION(WRT_TEST_ADD_INTERNAL_DEPENDENCIES TARGET_NAME)
+  FOREACH(DEPENDENCY ${ARGN})
+    WRT_INTROSPECT_TARGET(prefix ${DEPENDENCY})
+    WRT_TEST_INCLUDE_DIRECTORIES(${TARGET_NAME} ${prefix_INCLUDE_DIRS})
+    WRT_TEST_LINK_DIRECTORIES(${TARGET_NAME} ${prefix_LIBRARY_DIRS})
+    WRT_TEST_TARGET_LINK_LIBRARIES(${TARGET_NAME} ${DEPENDENCY})
+  ENDFOREACH(DEPENDENCY)
+ENDFUNCTION(WRT_TEST_ADD_INTERNAL_DEPENDENCIES)
+
+# Functions used to build test targets (proper sources, includes, libs are
+# added automatically)
+FUNCTION(WRT_TEST_BUILD TARGET_NAME)
+    SET(SOURCES "${ARGN}")
+    ADD_EXECUTABLE("${TARGET_NAME}" ${SOURCES})
+
+    # get include dirs global property
+    GET_PROPERTY(INCLUDE_DIRS GLOBAL PROPERTY TESTS_INCLUDE_DIRS)
+    GET_PROPERTY(TEST_INCLUDE_DIRS GLOBAL PROPERTY ${TARGET_NAME}_INCLUDE_DIRS)
+    INCLUDE_DIRECTORIES(
+        ${INCLUDE_DIRS}
+        ${TEST_INCLUDE_DIRS}
+    )
+
+    # get library dirs global property
+    GET_PROPERTY(LIBRARY_DIRS GLOBAL PROPERTY TESTS_LIBRARY_DIRS)
+    GET_PROPERTY(TEST_LIBRARY_DIRS GLOBAL PROPERTY ${TARGET_NAME}_LIBRARY_DIRS)
+    LINK_DIRECTORIES(
+        ${LIBRARY_DIRS}
+        ${TEST_LIBRARY_DIRS}
+    )
+
+    # get link libraries global property
+    GET_PROPERTY(LINK_LIBRARIES GLOBAL PROPERTY TESTS_LIBRARIES)
+    GET_PROPERTY(TEST_LIBRARIES GLOBAL PROPERTY ${TARGET_NAME}_LIBRARIES)
+    TARGET_LINK_LIBRARIES("${TARGET_NAME}"
+        ${LINK_LIBRARIES}
+        ${TEST_LIBRARIES}
+    )
+    SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+        COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+ENDFUNCTION(WRT_TEST_BUILD)
+
+FUNCTION(WRT_TEST_INSTALL)
+    SET_TARGET_PROPERTIES(${ARGV} PROPERTIES
+        BUILD_WITH_INSTALL_RPATH ON
+        INSTALL_RPATH_USE_LINK_PATH ON
+    )
+    INSTALL(TARGETS ${ARGV}
+        DESTINATION bin
+        PERMISSIONS OWNER_READ
+                    OWNER_WRITE
+                    OWNER_EXECUTE
+                    GROUP_READ
+                    GROUP_EXECUTE
+                    WORLD_READ
+                    WORLD_EXECUTE
+    )
+ENDFUNCTION(WRT_TEST_INSTALL)
+
+# Takes arbitrary number of arguments and concatenates them using ':' character.
+# Rationale:
+#   CMake list when converted to a string is joined with ';' character. However,
+#   GCC takes strings with multiple elements separated with ':' (e.g. list of
+#   paths). Used typically when generating DB schemas with ORM mechanism.
+FUNCTION(WRT_CONVERT_TO_GCC_LIST OUTPUT_VARIABLE)
+    FOREACH(ITEM ${ARGN})
+        LIST(APPEND ITEMS ${ITEM})
+    ENDFOREACH(ITEM)
+    STRING(REPLACE ";" ":" OUTPUT "${ITEMS}")
+    SET("${OUTPUT_VARIABLE}" "${OUTPUT}" PARENT_SCOPE)
+ENDFUNCTION(WRT_CONVERT_TO_GCC_LIST)
diff --git a/tests/widgets/TestCases.cpp b/tests/widgets/TestCases.cpp
new file mode 100644 (file)
index 0000000..48f005b
--- /dev/null
@@ -0,0 +1,1052 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    TestCases.cpp
+ * @author  Karol Pawłowski (k.pawlowski@samsung.com)
+ * @author  Tomasz Iwanek (t.iwanek@samsung.com)
+ * @version 1.0
+ */
+
+#include <dpl/test/test_runner.h>
+#include <dpl/singleton_impl.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/lexical_cast.h>
+#include <dpl/abstract_waitable_input_adapter.h>
+#include <dpl/test/value_separated_reader.h>
+#include <dpl/test/process_pipe.h>
+#include <RunnableObjectStateTester.h>
+#include <i_runnable_widget_object.h>
+#include <dpl/wrt-dao-ro/WrtDatabase.h>
+
+#include <memory>
+#include <vector>
+#include <string>
+
+namespace {
+
+struct Result {
+    bool m_exc;
+    bool m_exd;
+    bool m_exs;
+    std::string message;
+    Result(bool exc = false, bool exd = false, bool exs = false)
+        : m_exc(exc), m_exd(exd), m_exs(exs) {}
+};
+
+}
+
+RUNNER_TEST_GROUP_INIT(RunnableWidgetObjectState)
+
+//for call methods to get starting state or do clean up after test
+#define CALL_TESTER( ARGUMENT )                                        \
+        tester.perform##ARGUMENT();                                    \
+
+//for performing test and catch excpeted and unexpected exceptions
+#define RUNNABLE_TESTER( ARGUMENT )                                    \
+    Result res;                                                        \
+    Try                                                                \
+    {                                                                  \
+        WrtLogD("perform start");                                     \
+        CALL_TESTER( ARGUMENT )                                        \
+        WrtLogD("perform stop");                                      \
+    }                                                                  \
+    Catch(WRT::IRunnableWidgetObject::MethodInvocationForbidden)       \
+    {                                                                  \
+        res.m_exc = true;                                              \
+        res.message = _rethrown_exception.DumpToString();              \
+        res.message += "(MethodInvocationForbidden)";                  \
+    }                                                                  \
+    Catch(DPL::Exception)                                              \
+    {                                                                  \
+        res.m_exd = true;                                              \
+        res.message = _rethrown_exception.DumpToString();              \
+        res.message += "(DPL::Exception)";                             \
+    }                                                                  \
+    Catch(std::exception)                                              \
+    {                                                                  \
+        res.m_exs = true;                                              \
+        res.message = _rethrown_exception.what();                      \
+        res.message += "(std::exception)";                             \
+    }                                                                  \
+
+
+//check of function success
+#define SHOULD_BE_ALLOWED( ARGUMENT )                                  \
+    {                                                                  \
+    RUNNABLE_TESTER( ARGUMENT )                                        \
+    if(res.m_exc || res.m_exs || res.m_exd)                            \
+    {                                                                  \
+        ok = false;                                                    \
+        reason = "Exception throwed when not expected in ";            \
+        reason += __FUNCTION__;                                        \
+        reason += " calling ";                                         \
+        reason += #ARGUMENT;                                           \
+        reason += "message ";                                          \
+        reason += res.message;                                         \
+    }                                                                  \
+    }                                                                  \
+
+
+//check of function failure
+#define SHOULD_BE_FORBIDDEN( ARGUMENT )                                \
+    {                                                                  \
+    RUNNABLE_TESTER( ARGUMENT )                                        \
+    if(!res.m_exc)                                                     \
+    {                                                                  \
+        ok = false;                                                    \
+        reason = "MethodInvocationForbidden should be throwed";        \
+        reason += " when calling ";                                    \
+        reason += #ARGUMENT;                                           \
+    }                                                                  \
+    }                                                                  \
+
+
+//marcos for hiding lamdba expression and and presenting it as if it is test body
+#define RUNNABLE_TESTER_START                                                              \
+    bool ok = true;                                                                        \
+    std::string reason;                                                                    \
+    auto func = [&ok,&reason](RunnableObjectStateTester & tester)                          \
+    {                                                                                      \
+        Try                                                                                \
+        {                                                                                  \
+
+
+#define RUNNABLE_TESTER_STOP                                                               \
+        }                                                                                  \
+        Catch(DPL::Exception)                                                              \
+        {                                                                                  \
+            ok = false;                                                                    \
+            reason = _rethrown_exception.DumpToString();                                   \
+            reason += "(DPL::Exception)";                                                  \
+        }                                                                                  \
+        Catch(std::exception)                                                              \
+        {                                                                                  \
+            reason = "Unknown exception";                                                  \
+            ok = false;                                                                    \
+        }                                                                                  \
+    };                                                                                     \
+    RunnableObjectStateTester & instance = RunnableObjectStateTesterSingleton::Instance(); \
+    instance.runTest(func);                                                                \
+    RUNNER_ASSERT_MSG(ok, reason);                                                         \
+
+//Initial
+/*
+Name: state_Initial_PrepareView
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method PrepareView in state Initial
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Initial_PrepareView)
+{
+    RUNNABLE_TESTER_START
+    SHOULD_BE_ALLOWED( PrepareView );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Initial_Show
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Show in state Initial
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Initial_Show)
+{
+    RUNNABLE_TESTER_START
+    SHOULD_BE_FORBIDDEN( Show );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Initial_Hide
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Hide in state Initial
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Initial_Hide)
+{
+    RUNNABLE_TESTER_START
+    SHOULD_BE_FORBIDDEN( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Initial_Suspend
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Suspend in state Initial
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Initial_Suspend)
+{
+    RUNNABLE_TESTER_START
+    SHOULD_BE_FORBIDDEN( Suspend );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Initial_Resume
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Resume in state Initial
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Initial_Resume)
+{
+    RUNNABLE_TESTER_START
+    SHOULD_BE_FORBIDDEN( Resume );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Initial_Reset
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Reset in state Initial
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Initial_Reset)
+{
+    RUNNABLE_TESTER_START
+    SHOULD_BE_FORBIDDEN( Reset );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Initial_GetCurrentWebview
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method GetCurrentWebview in state Initial
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Initial_GetCurrentWebview)
+{
+    RUNNABLE_TESTER_START
+    SHOULD_BE_FORBIDDEN( GetCurrentWebview );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Initial_SetUserDelegates
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method SetUserDelegates in state Initial
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Initial_SetUserDelegates)
+{
+    RUNNABLE_TESTER_START
+    SHOULD_BE_FORBIDDEN( SetUserDelegates );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Initial_Backward
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Backward in state Initial
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Initial_Backward)
+{
+    RUNNABLE_TESTER_START
+    SHOULD_BE_FORBIDDEN( Backward );
+    RUNNABLE_TESTER_STOP
+}
+
+
+//Prepared
+/*
+Name: state_Prepared_PrepareView
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method PrepareView in state Prepared
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Prepared_PrepareView)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    SHOULD_BE_FORBIDDEN( PrepareView );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Prepared_Show
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Show in state Prepared
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Prepared_Show)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    SHOULD_BE_ALLOWED( Show );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Prepared_Hide
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Hide in state Prepared
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Prepared_Hide)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    SHOULD_BE_ALLOWED( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Prepared_Suspend
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Suspend in state Prepared
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Prepared_Suspend)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    SHOULD_BE_FORBIDDEN( Suspend );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Prepared_Resume
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Resume in state Prepared
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Prepared_Resume)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    SHOULD_BE_FORBIDDEN( Resume );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Prepared_Reset
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Reset in state Prepared
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Prepared_Reset)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    SHOULD_BE_FORBIDDEN( Reset );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Prepared_GetCurrentWebview
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method GetCurrentWebview in state Prepared
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Prepared_GetCurrentWebview)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    SHOULD_BE_ALLOWED( GetCurrentWebview );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Prepared_SetUserDelegates
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method SetUserDelegates in state Prepared
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Prepared_SetUserDelegates)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    SHOULD_BE_ALLOWED( SetUserDelegates );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Prepared_Backward
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Backward in state Prepared
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Prepared_Backward)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    SHOULD_BE_FORBIDDEN( Backward );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+//Showed
+/*
+Name: state_Showed_PrepareView
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method PrepareView in state Showed
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Showed_PrepareView)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    SHOULD_BE_FORBIDDEN( PrepareView );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Showed_Show
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Show in state Showed
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Showed_Show)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    SHOULD_BE_FORBIDDEN( Show );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Showed_Hide
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Hide in state Showed
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Showed_Hide)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    SHOULD_BE_ALLOWED( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Showed_Suspend
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Suspend in state Showed
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Showed_Suspend)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    SHOULD_BE_ALLOWED( Suspend );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Showed_Resume
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Resume in state Showed
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Showed_Resume)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    SHOULD_BE_FORBIDDEN( Resume );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Showed_Reset
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Reset in state Showed
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Showed_Reset)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    SHOULD_BE_ALLOWED( Reset );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Showed_GetCurrentWebview
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method GetCurrentWebview in state Showed
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Showed_GetCurrentWebview)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    SHOULD_BE_ALLOWED( GetCurrentWebview );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Showed_SetUserDelegates
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method SetUserDelegates in state Showed
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Showed_SetUserDelegates)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    SHOULD_BE_FORBIDDEN( SetUserDelegates );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Showed_Backward
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Backward in state Showed
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Showed_Backward)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    SHOULD_BE_ALLOWED( Backward );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+//Suspended
+/*
+Name: state_Suspended_PrepareView
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method PrepareView in state Suspended
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Suspended_PrepareView)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    SHOULD_BE_FORBIDDEN( PrepareView );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Suspended_Show
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Show in state Suspended
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Suspended_Show)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    SHOULD_BE_FORBIDDEN( Show );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Suspended_Hide
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Hide in state Suspended
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Suspended_Hide)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    SHOULD_BE_ALLOWED( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Suspended_Suspend
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Suspend in state Suspended
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Suspended_Suspend)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    SHOULD_BE_FORBIDDEN( Suspend );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Suspended_Resume
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Resume in state Suspended
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Suspended_Resume)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    SHOULD_BE_ALLOWED( Resume );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Suspended_Reset
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Reset in state Suspended
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Suspended_Reset)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    SHOULD_BE_ALLOWED( Reset );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Suspended_GetCurrentWebview
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method GetCurrentWebview in state Suspended
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Suspended_GetCurrentWebview)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    SHOULD_BE_ALLOWED( GetCurrentWebview );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Suspended_SetUserDelegates
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method SetUserDelegates in state Suspended
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Suspended_SetUserDelegates)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    SHOULD_BE_FORBIDDEN( SetUserDelegates );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Suspended_Backward
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Backward in state Suspended
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Suspended_Backward)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    SHOULD_BE_FORBIDDEN( Backward );
+    CALL_TESTER( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+//Hidden
+/*
+Name: state_Hidden_PrepareView
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method PrepareView in state Hidden
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Hidden_PrepareView)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    CALL_TESTER( Hide );
+    SHOULD_BE_FORBIDDEN( PrepareView );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Hidden_Show
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Show in state Hidden
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Hidden_Show)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    CALL_TESTER( Hide );
+    SHOULD_BE_FORBIDDEN( Show );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Hidden_Hide
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Hide in state Hidden
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Hidden_Hide)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    CALL_TESTER( Hide );
+    SHOULD_BE_FORBIDDEN( Hide );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Hidden_Suspend
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Suspend in state Hidden
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Hidden_Suspend)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    CALL_TESTER( Hide );
+    SHOULD_BE_FORBIDDEN( Suspend );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Hidden_Resume
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Resume in state Hidden
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Hidden_Resume)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    CALL_TESTER( Hide );
+    SHOULD_BE_FORBIDDEN( Resume );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Hidden_Reset
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Reset in state Hidden
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Hidden_Reset)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    CALL_TESTER( Hide );
+    SHOULD_BE_FORBIDDEN( Reset );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Hidden_GetCurrentWebview
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method GetCurrentWebview in state Hidden
+Expected: Transistion should pass
+*/
+RUNNER_TEST(state_Hidden_GetCurrentWebview)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    CALL_TESTER( Hide );
+    SHOULD_BE_ALLOWED( GetCurrentWebview );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Hidden_SetUserDelegates
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method SetUserDelegates in state Hidden
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Hidden_SetUserDelegates)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    CALL_TESTER( Hide );
+    SHOULD_BE_FORBIDDEN( SetUserDelegates );
+    RUNNABLE_TESTER_STOP
+}
+
+/*
+Name: state_Hidden_Backward
+Description: Checks if RunnableWidgetObject
+ correctly reacts to calling method Backward in state Hidden
+Expected: Transistion should fail
+*/
+RUNNER_TEST(state_Hidden_Backward)
+{
+    RUNNABLE_TESTER_START
+    CALL_TESTER( PrepareView );
+    CALL_TESTER( Show );
+    CALL_TESTER( Suspend );
+    CALL_TESTER( Hide );
+    SHOULD_BE_FORBIDDEN( Backward );
+    RUNNABLE_TESTER_STOP
+}
+
+
+RUNNER_TEST_GROUP_INIT(CommandLineParameters)
+
+
+struct PassAllParserPolicy
+{
+    static bool SkipLine(const std::vector<std::string> & ) { return false; }
+    static bool Validate(std::shared_ptr<std::vector<std::vector<std::string> > > &) { return true; }
+};
+
+struct ListTokenizerPolicy
+{
+    static std::string GetSeperators() { return " "; }
+    static bool SkipEmpty() { return true; }
+    static void PrepareValue(std::string & value) { DPL::Trim(value, " "); }
+    static bool TryAgainAtEnd(int) { return false; }
+};
+
+typedef DPL::VSReader<PassAllParserPolicy, ListTokenizerPolicy> LListReader;
+
+RUNNER_TEST(CommandLineParameters_ListWidgets)
+{
+    int status = system("wrt_reset_all.sh");
+    RUNNER_ASSERT_MSG(WIFEXITED(status) == TRUE, "wrt_reset_all.sh not exited properly");
+    RUNNER_ASSERT_MSG(WEXITSTATUS(status) == 0, "wrt_reset_all.sh failed");
+
+    //reset database connection
+    WrtDB::WrtDatabase::detachFromThread();
+    WrtDB::WrtDatabase::attachToThreadRW();
+
+    std::string tizenId;
+    RUNNER_ASSERT(InstallerWrapper::install("/opt/share/widget/tests/general/minimal.wgt", tizenId) == InstallerWrapper::Success);
+
+    try
+    {
+        DPL::ProcessPipe pipe(DPL::ProcessPipe::PipeErrorPolicy::OFF);
+        pipe.Open("DPL_USE_OLD_STYLE_LOGS=0 wrt-launcher -l");
+        LListReader launcher(std::make_shared<DPL::AbstractWaitableInputAdapter>(&pipe));
+        DPL::VSResultPtr result = launcher.ReadInput();
+        pipe.Close();
+
+        RUNNER_ASSERT_MSG((*result)[2][0] == "1", " Wrong position number");
+        RUNNER_ASSERT_MSG((*result)[2][1] == "Minimal", "Wrong name");
+        RUNNER_ASSERT_MSG((*result)[2][2] == "1.0", "Wrong version");
+        RUNNER_ASSERT_MSG((*result)[2][3] == "http://test.samsung.com/widget/minimalTest", "Wrong GUID");
+        RUNNER_ASSERT_MSG((*result)[2][4] == "aHFQwMDkmC", "Wrong pkgID");
+        RUNNER_ASSERT_MSG((*result)[2][5] == "aHFQwMDkmC.minimal", "Wrong appID");
+    }
+    catch(...)
+    {
+        RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+        throw;
+    }
+    RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+}
+
+
+struct ResultTokenizerPolicy
+{
+    static std::string GetSeperators() { return ":"; }
+    static bool SkipEmpty() { return true; }
+    static void PrepareValue(std::string & value) { DPL::Trim(value, " "); }
+    static bool TryAgainAtEnd(int) { return false; }
+};
+
+typedef DPL::VSReader<PassAllParserPolicy, ResultTokenizerPolicy> LResultReader;
+
+RUNNER_TEST(CommandLineParameters_SimpleLaunch)
+{
+    bool launched = false;
+    bool running = false;
+    bool stopped = false;
+    std::string tizenId;
+    RUNNER_ASSERT(InstallerWrapper::install("/opt/share/widget/tests/general/minimal.wgt", tizenId) == InstallerWrapper::Success);
+
+    //start
+    {
+        DPL::ProcessPipe pipe(DPL::ProcessPipe::PipeErrorPolicy::OFF);
+        pipe.Open(std::string("DPL_USE_OLD_STYLE_LOGS=0 wrt-launcher -s ") + tizenId);
+        LResultReader launcher(std::make_shared<DPL::AbstractWaitableInputAdapter>(&pipe));
+        DPL::VSResultPtr result = launcher.ReadInput();
+        pipe.Close();
+
+        FOREACH(row, *result)
+        {
+            if(row->at(0) == "result")
+            {
+                if(row->at(1) == "launched")
+                {
+                    launched = true;
+                    break;
+                }
+                else
+                {
+                    RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+                    RUNNER_ASSERT_MSG(false, "Launch failed");
+                }
+            }
+        }
+    }
+    if(!launched)
+    {
+        RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+        RUNNER_ASSERT_MSG(false, "Result not returned");
+    }
+
+    //is-running
+    {
+        DPL::ProcessPipe pipe(DPL::ProcessPipe::PipeErrorPolicy::OFF);
+        pipe.Open(std::string("DPL_USE_OLD_STYLE_LOGS=0 wrt-launcher -r ") + tizenId);
+        LResultReader launcher(std::make_shared<DPL::AbstractWaitableInputAdapter>(&pipe));
+        DPL::VSResultPtr result = launcher.ReadInput();
+        pipe.Close();
+
+        FOREACH(row, *result)
+        {
+            if(row->at(0) == "result")
+            {
+                if(row->at(1) == "running")
+                {
+                    running = true;
+                    break;
+                }
+                else
+                {
+                    RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+                    RUNNER_ASSERT_MSG(false, "App launched but not running");
+                }
+            }
+        }
+    }
+    if(!running)
+    {
+        RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+        RUNNER_ASSERT_MSG(false, "Result not returned");
+    }
+
+    //stop
+    {
+        DPL::ProcessPipe pipe(DPL::ProcessPipe::PipeErrorPolicy::OFF);
+        pipe.Open(std::string("DPL_USE_OLD_STYLE_LOGS=0 wrt-launcher -k ") + tizenId);
+        LResultReader launcher(std::make_shared<DPL::AbstractWaitableInputAdapter>(&pipe));
+        DPL::VSResultPtr result = launcher.ReadInput();
+        pipe.Close();
+
+        FOREACH(row, *result)
+        {
+            if(row->at(0) == "result")
+            {
+                if(row->at(1) == "killed")
+                {
+                    stopped = true;
+                    break;
+                }
+                else
+                {
+                    RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+                    RUNNER_ASSERT_MSG(false, "Stop failed");
+                }
+            }
+        }
+    }
+    RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+    if(stopped)
+    {
+        return;
+    }
+    RUNNER_ASSERT_MSG(false, "Result not returned");
+}
+
+RUNNER_TEST(CommandLineParameters_WebDebuggerPort)
+{
+    std::string tizenId;
+    RUNNER_ASSERT(InstallerWrapper::install("/opt/share/widget/tests/general/minimal.wgt", tizenId) == InstallerWrapper::Success);
+
+    DPL::ProcessPipe pipe(DPL::ProcessPipe::PipeErrorPolicy::OFF);
+    pipe.Open(std::string("DPL_USE_OLD_STYLE_LOGS=0 wrt-launcher -d -t 5 -s ") + tizenId);
+    LResultReader launcher(std::make_shared<DPL::AbstractWaitableInputAdapter>(&pipe));
+    DPL::VSResultPtr result = launcher.ReadInput();
+    pipe.Close();
+
+    FOREACH(row, *result)
+    {
+        if(row->at(0) == "port")
+        {
+            int value = DPL::lexical_cast<int>(row->at(1));
+            if(value >= 1024 && value <= 65535)
+            {
+                RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+                return;
+            }
+            else
+            {
+                RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+                RUNNER_ASSERT_MSG(false, "Wrong port number");
+            }
+        }
+    }
+    RUNNER_ASSERT(InstallerWrapper::uninstall(tizenId));
+    RUNNER_ASSERT_MSG(false, "Port number not returned");
+}
+
diff --git a/tests/widgets/TestInit.cpp b/tests/widgets/TestInit.cpp
new file mode 100644 (file)
index 0000000..d7bff2d
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    TestInit.cpp
+ * @author  Tomasz Iwanek (t.iwanek@samsung.com)
+ * @version 1.0
+ * @brief   main for misc tests
+ */
+
+#include <dpl/test/test_runner.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/wrt-dao-ro/WrtDatabase.h>
+
+int main (int argc, char *argv[])
+{
+    WrtLogD("Starting tests");
+
+    WrtDB::WrtDatabase::attachToThreadRW();
+    int status =
+        DPL::Test::TestRunnerSingleton::Instance().ExecTestRunner(argc, argv);
+    WrtDB::WrtDatabase::detachFromThread();
+
+    return status;
+}
diff --git a/tests/widgets/common/CMakeLists.txt b/tests/widgets/common/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a41b284
--- /dev/null
@@ -0,0 +1,45 @@
+# Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+# @file        CMakeLists.txt
+# @author      Tomasz Iwanek (t.iwanek@samsung.com)
+# @version     1.0
+# @brief
+#
+
+SET(COMMON_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include")
+
+WRT_TEST_LIBRARY(${WRT_TEST_LIBRARY})
+
+WRT_INCLUDE_DIRECTORIES(
+    ${COMMON_LIB_PKGS_INCLUDE_DIRS}
+    ${COMMON_INCLUDES}
+    ${WRT_API_NEW_INCLUDES}
+    )
+
+WRT_LINK_DIRECTORIES(${COMMON_LIB_PKGS_LIBRARY_DIRS})
+WRT_TARGET_LINK_LIBRARIES(${COMMON_LIB_PKGS_LIBRARIES})
+
+SET(WRT_DETAIL_SOURCES
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/InstallerWrapper.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/RunnableObjectStateTester.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/mock/MockViewModule.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/src/mock/MockContextManager.cpp
+)
+
+INCLUDE_DIRECTORIES(${COMMON_INCLUDES})
+INCLUDE_DIRECTORIES(${COMMON_LIB_PKGS_INCLUDE_DIRS})
+ADD_LIBRARY(${WRT_TEST_LIBRARY} STATIC ${WRT_DETAIL_SOURCES})
+SET_TARGET_PROPERTIES(${WRT_TEST_LIBRARY} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
diff --git a/tests/widgets/common/include/InstallerWrapper.h b/tests/widgets/common/include/InstallerWrapper.h
new file mode 100644 (file)
index 0000000..7bce1cd
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#ifndef WRT_TESTS_W3C_TESTS_INSTALLER_WRAPPER_H
+#define WRT_TESTS_W3C_TESTS_INSTALLER_WRAPPER_H
+
+#include <string>
+
+namespace InstallerWrapper
+{
+
+typedef int InstallResult;
+const InstallResult WrongWidgetPackage = -2;
+const InstallResult OtherError = -1;
+const InstallResult Success = 0;
+
+InstallResult install(
+        const std::string& path,
+        std::string& tizenId,
+        const std::string& user = "");
+bool uninstall(const std::string& tizenId);
+bool uninstallByGuid(const std::string& guid);
+/**
+ * @brief killWrtClients kills processes that matches 'wrt-client'
+ * @return True if any client was killed
+ */
+bool sigintWrtClients();
+
+}
+
+#endif//WRT_TESTS_W3C_TESTS_INSTALLER_WRAPPER_H
diff --git a/tests/widgets/common/include/RunnableObjectStateTester.h b/tests/widgets/common/include/RunnableObjectStateTester.h
new file mode 100644 (file)
index 0000000..c0a8bc7
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        RunnableObjectStateTester.h
+ * @author      Tomasz Iwanek (t.iwanek@samsung.com)
+ * @brief       Tester for RunnableWidgetObject's states
+ */
+
+#ifndef WRT_EXTRA_AUTO_TESTS_COMMON_INCLUDE_RUNNABLE_OBJECT_STATE_TESTER_H
+#define WRT_EXTRA_AUTO_TESTS_COMMON_INCLUDE_RUNNABLE_OBJECT_STATE_TESTER_H
+
+#include <memory>
+#include <functional>
+#include <vector>
+#include <Evas.h>
+#include <dpl/exception.h>
+#include <dpl/application.h>
+#include <dpl/generic_event.h>
+#include <dpl/event/controller.h>
+#include <dpl/type_list.h>
+#include <dpl/task.h>
+#include <dpl/singleton.h>
+#include <dpl/string.h>
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include <runnable_widget_object.h>
+#include <core_module.h>
+
+#include <InstallerWrapper.h>
+
+DECLARE_GENERIC_EVENT_0(NextStepEvent)
+
+class RunnableObjectStateTester : public DPL::ApplicationExt,
+        private DPL::Event::Controller<DPL::TypeListDecl<NextStepEvent>::Type>,
+        public DPL::TaskDecl<RunnableObjectStateTester>
+{
+public:
+    typedef std::function<void(RunnableObjectStateTester&)> Test;
+
+    DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
+    DECLARE_EXCEPTION_TYPE(Base, CoreModuleFailure)
+    DECLARE_EXCEPTION_TYPE(Base, CallbackFailure)
+
+    RunnableObjectStateTester();
+    ~RunnableObjectStateTester();
+
+    void performPrepareView();
+
+    void performShow();
+    void performHide();
+    void performSuspend();
+    void performResume();
+    void performReset();
+
+    void performGetCurrentWebview();
+    void performSetUserDelegates();
+    void performBackward();
+
+    void performTest();
+
+    void runTest(Test func);
+
+    void OnEventReceived(const NextStepEvent& /*event*/);
+
+    void loadFinishCallback(Evas_Object* obj, void* eventInfo);
+
+private:
+    std::string m_handle;
+    WRT::RunnableWidgetObjectPtr m_widget;
+    Test m_func;
+    const std::string m_widgetPath;
+};
+
+typedef DPL::Singleton<RunnableObjectStateTester> RunnableObjectStateTesterSingleton;
+
+#endif // WRT_EXTRA_AUTO_TESTS_COMMON_INCLUDE_RUNNABLE_OBJECT_STATE_TESTER_H
diff --git a/tests/widgets/common/include/mock/MockContextManager.h b/tests/widgets/common/include/mock/MockContextManager.h
new file mode 100644 (file)
index 0000000..c1734df
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        MockContextManager.h
+ * @author      Tomasz Iwanek (t.iwanek@samsung.com)
+ * @brief       Mock for view module
+ */
+#ifndef MOCKCONTEXTMANAGER_H
+#define MOCKCONTEXTMANAGER_H
+
+#include <i_context_manager.h>
+
+class MockContextManager : public ViewModule::IContextManager
+{
+public:
+   MockContextManager(const std::string& tizenAppId,
+                      Ewk_Context* ewkContext,
+                      ViewModule::IViewModulePtr viewModule);
+   virtual ~MockContextManager();
+   Ewk_Context* getEwkContext() const;
+   void handleLowMemory();
+};
+
+#endif // MOCKCONTEXTMANAGER_H
diff --git a/tests/widgets/common/include/mock/MockViewModule.h b/tests/widgets/common/include/mock/MockViewModule.h
new file mode 100644 (file)
index 0000000..7930fdf
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        MockViewModule.h
+ * @author      Tomasz Iwanek (t.iwanek@samsung.com)
+ * @brief       Mock for view module
+ */
+
+#ifndef MOCKVIEWMODULE_H
+#define MOCKVIEWMODULE_H
+
+#include<i_view_module.h>
+
+class MockViewModule : public ViewModule::IViewModule
+{
+public:
+    MockViewModule();
+    bool createWebView(Ewk_Context* context,
+                             Evas_Object* window);
+    void prepareView(WidgetModel *, const std::string &);
+    void showWidget();
+    void hideWidget();
+    void suspendWidget();
+    void resumeWidget();
+    void setWidgetUrl(const std::string &);
+    void resetWidgetFromSuspend();
+    void resetWidgetFromResume();
+    void backward();
+    void reloadStartPage();
+    Evas_Object* getCurrentWebview();
+    void fireJavascriptEvent(int event, void* data);
+    void setUserCallbacks(const WRT::UserDelegatesPtr& cbs);
+    void checkSyncMessageFromBundle(
+          const char* name,
+          const char* body,
+          char** returnData);
+    void checkAsyncMessageFromBundle(
+            const char* name,
+            const char* body);
+    void downloadData(const char* url);
+    void activateVibration(bool on, uint64_t time);
+};
+
+#endif // MOCKVIEWMODULE_H
diff --git a/tests/widgets/common/src/InstallerWrapper.cpp b/tests/widgets/common/src/InstallerWrapper.cpp
new file mode 100644 (file)
index 0000000..1bdad1d
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+#include "InstallerWrapper.h"
+
+#include <dpl/log/wrt_log.h>
+
+#include <cstdio>
+
+namespace
+{
+
+const std::string params = "DPL_USE_OLD_STYLE_LOGS=0 "
+    "DPL_USE_OLD_STYLE_PEDANTIC_LOGS=0 WRT_TEST_MODE=1 ";
+const std::string installCmd = params + "wrt-installer -i ";
+const std::string uninstallCmd = params + "wrt-installer -un ";
+const std::string uninstallByGuidCmd = params + "wrt-installer -ug \"";
+const std::string redirection =  " 2>&1";
+const std::string INSTALLER_MESSAGE_ID_LINE =
+    "## wrt-installer : %s installation was successful.\n";
+const std::string INSTALLER_MESSSGE_START = "## wrt-installer : ";
+
+std::string getAndCutInstallerLogLine(std::string &src)
+{
+    size_t startIndex = src.find(INSTALLER_MESSSGE_START);
+    if (startIndex == std::string::npos)
+    {
+        WrtLogW("Installer message can not be found");
+        return std::string();
+    }
+    size_t newLineIndex = src.find("\n", startIndex);
+    std::string line = src.substr(startIndex, newLineIndex - startIndex + 1);
+    src.erase(0, newLineIndex + 1);
+    return line;
+}
+
+}
+
+namespace InstallerWrapper
+{
+
+InstallResult install(
+        const std::string& path,
+        std::string& tizenId,
+        const std::string& user)
+{
+    std::string msg;
+
+    auto cmd = installCmd + path + redirection;
+    if(user.length()) //if other user should be used
+    {
+        cmd = "su " + user + " -c '" + cmd + "'";
+    }
+    WrtLogD("executing: %s", cmd.c_str());
+    auto filehandle = popen(cmd.c_str(), "r");
+    if (!filehandle) {
+        return OtherError;
+    }
+
+    char buffer[1024] = "";
+    while (fread_unlocked(buffer, sizeof(char), sizeof(buffer)/sizeof(char),
+                                 filehandle) > 0)
+    {
+        msg += buffer;
+    }
+    WrtLogD("%s", msg.c_str());
+    auto err = pclose(filehandle);
+    if (!WIFEXITED(err)) {
+        return OtherError;
+    }
+    if (0 != WEXITSTATUS(err)) {
+        if (1 == WEXITSTATUS(err)) {
+            return WrongWidgetPackage;
+        }
+        return OtherError;
+    }
+
+    char* id = NULL;
+    std::string line;
+
+    while ((line = getAndCutInstallerLogLine(msg)) != "")
+    {
+        if (line.find("successful") != std::string::npos)
+        {
+            id = new char[line.length()];
+            int nr = sscanf(line.c_str(), INSTALLER_MESSAGE_ID_LINE.c_str(), id);
+
+            if (1 != nr)
+            {
+                WrtLogW("Can not read widget ID from message: %s", line.c_str());
+                delete[] id;
+                return OtherError;
+            }
+            tizenId = id;
+            delete[] id;
+            if (tizenId != "plugin")
+            {
+                return Success;
+            }
+        }
+    }
+
+    return OtherError;
+}
+
+bool uninstall(const std::string& tizenId)
+{
+    std::string cmd = uninstallCmd + tizenId + " > /dev/null 2>/dev/null";
+    WrtLogD("executing: %s", cmd.c_str());
+    return (system(cmd.c_str()) == EXIT_SUCCESS);
+}
+
+bool uninstallByGuid(const std::string& guid)
+{
+    std::string cmd = uninstallByGuidCmd + guid + "\" > /dev/null 2>/dev/null";
+    WrtLogD("executing: %s", cmd.c_str());
+    return (system(cmd.c_str()) == EXIT_SUCCESS);
+}
+
+bool sigintWrtClients()
+{
+    return (system("pkill -2 wrt-client") == 0);
+}
+
+}
+
diff --git a/tests/widgets/common/src/RunnableObjectStateTester.cpp b/tests/widgets/common/src/RunnableObjectStateTester.cpp
new file mode 100644 (file)
index 0000000..cac9233
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        RunnableObjectStateTester.cpp
+ * @author      Tomasz Iwanek (t.iwanek@samsung.com)
+ * @brief       Tester for RunnableWidgetObject's states
+ */
+
+#include "RunnableObjectStateTester.h"
+
+#include <functional>
+#include <vector>
+#include <string>
+#include <dpl/framework_efl.h>
+#include <dpl/localization/w3c_file_localization.h>
+#include <dpl/availability.h>
+#include <dpl/noncopyable.h>
+#include <dpl/log/wrt_log.h>
+#include <dpl/singleton_impl.h>
+#include <dpl/foreach.h>
+#include <user_delegates.h>
+
+#include <mock/MockViewModule.h>
+#include <mock/MockContextManager.h>
+
+IMPLEMENT_SINGLETON(RunnableObjectStateTester)
+
+namespace {
+const std::string widgetPathMnimal = "/opt/share/widget/tests/general/any.wgt";
+const int widgetInitializationTimeBounding = 3;
+}
+
+RunnableObjectStateTester::RunnableObjectStateTester()
+    : DPL::ApplicationExt(1, NULL, "test-app"),
+      DPL::TaskDecl<RunnableObjectStateTester>(this),
+      m_widgetPath(widgetPathMnimal)
+{
+    WrtLogD("enter");
+
+    int argc = 0;
+    const char * argv[] = { "wrt-tests-wrt" };
+    if (!getenv("ELM_ENGINE")) {
+        if (setenv("ELM_ENGINE", "gl", 1)) {
+                WrtLogD("Enable backend");
+        }
+    }
+    setenv("COREGL_FASTPATH", "1", 1);
+
+    Touch();
+
+    //initialize
+    elm_init(argc, const_cast<char**>(argv));
+#if USE(EFL_LITE)
+    elm_app_base_scale_set(1.8);
+#else
+    elm_app_base_scale_set(2.4);
+#endif
+    if(!WRT::CoreModuleSingleton::Instance().Init())
+    {
+        ThrowMsg(CoreModuleFailure, "Init() fails");
+    }
+
+    InstallerWrapper::install(m_widgetPath, m_handle);
+    WrtLogD("Widget Installed: %s", m_handle.c_str());
+
+    AddStep(&RunnableObjectStateTester::performTest);
+}
+
+RunnableObjectStateTester::~RunnableObjectStateTester()
+{
+    WrtLogD("enter");
+    WRT::CoreModuleSingleton::Instance().Terminate();
+    InstallerWrapper::uninstall(m_handle);
+    elm_shutdown();
+}
+
+void RunnableObjectStateTester::performPrepareView()
+{
+    //this address is invalid but we use mock (may be problematic when implementation'll change)
+    Evas_Object * fakeWindowAddress = reinterpret_cast<Evas_Object*>(0x01);
+    m_widget->PrepareView(DPL::ToUTF8String(DPL::String()),
+            fakeWindowAddress);
+}
+
+void RunnableObjectStateTester::performShow()
+{
+    m_widget->Show();
+}
+
+void RunnableObjectStateTester::performHide()
+{
+    m_widget->Hide();
+}
+
+void RunnableObjectStateTester::performSuspend()
+{
+    m_widget->Suspend();
+}
+
+void RunnableObjectStateTester::performResume()
+{
+    m_widget->Resume();
+}
+
+void RunnableObjectStateTester::performReset()
+{
+    m_widget->Reset();
+}
+
+void RunnableObjectStateTester::performGetCurrentWebview()
+{
+    m_widget->GetCurrentWebview();
+}
+
+void RunnableObjectStateTester::performSetUserDelegates()
+{
+    WRT::UserDelegatesPtr dlgs(new WRT::UserDelegates);
+    dlgs->loadFinishedCallback =
+        std::bind(&RunnableObjectStateTester::loadFinishCallback,
+                  this,
+                  std::placeholders::_1,
+                  std::placeholders::_2);
+    m_widget->SetUserDelegates(dlgs);
+}
+
+void RunnableObjectStateTester::performBackward()
+{
+    m_widget->Backward();
+}
+
+void RunnableObjectStateTester::OnEventReceived(const NextStepEvent& /*event*/)
+{
+    NextStep();
+}
+
+void RunnableObjectStateTester::loadFinishCallback(Evas_Object* obj, void* eventInfo)
+{
+    DPL_UNUSED_PARAM(obj);
+    DPL_UNUSED_PARAM(eventInfo);
+
+    WrtLogD("enter");
+}
+
+void RunnableObjectStateTester::runTest(RunnableObjectStateTester::Test func)
+{
+    m_widget = WRT::CoreModuleSingleton::Instance().getRunnableWidgetObject(m_handle);
+    //as we know we uses specific implementation
+    WRT::RunnableWidgetObject * m_widget_impl = dynamic_cast<WRT::RunnableWidgetObject*>(m_widget.get());
+    Assert(m_widget_impl);
+    m_widget_impl->setViewModule(ViewModule::IViewModulePtr(new MockViewModule()));
+    m_widget_impl->setContextManagerFactoryMethod(ViewModule::makeContextManagerFactoryMethod());
+    if(!m_widget)
+    {
+        ThrowMsg(CoreModuleFailure, "getRunnableWidgetObject() fails");
+    }
+
+    m_func = func;
+    SwitchToStep(&RunnableObjectStateTester::performTest);
+    DPL::Event::ControllerEventHandler<NextStepEvent>::PostTimedEvent(NextStepEvent(), 1.0); //TODO: time hazard
+
+    elm_run(); //elm_run should be called instead of ecore_main_loop
+}
+
+void RunnableObjectStateTester::performTest()
+{
+    WrtLogD("enter");
+
+    Try {
+        m_func(*this);
+    } Catch(DPL::Exception) {
+        WrtLogD("Test broken not at condition to be checked. Check other tests");
+        WrtLogD("%s", _rethrown_exception.DumpToString().c_str());
+    }
+
+    Quit();
+    m_widget.reset();
+
+    WrtLogD("leave");
+}
diff --git a/tests/widgets/common/src/mock/MockContextManager.cpp b/tests/widgets/common/src/mock/MockContextManager.cpp
new file mode 100644 (file)
index 0000000..1e94d57
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        MockContextManager.cpp
+ * @author      Tomasz Iwanek (t.iwanek@samsung.com)
+ * @brief       Mock for view module
+ */
+#include "mock/MockContextManager.h"
+
+MockContextManager::MockContextManager(
+       const std::string& tizenAppId,
+       Ewk_Context* ewkContext,
+       ViewModule::IViewModulePtr viewModule) :
+       ViewModule::IContextManager(tizenAppId, ewkContext, viewModule)
+{
+}
+
+MockContextManager::~MockContextManager()
+{
+}
+
+Ewk_Context* MockContextManager::getEwkContext() const
+{
+    return NULL;
+}
+
+void MockContextManager::handleLowMemory()
+{
+}
+
+namespace ViewModule {
+
+ContextManagerPtr contextManagerFactoryMethod(
+        const std::string& id,
+        Ewk_Context* c,
+        IViewModulePtr view)
+{
+    ContextManagerPtr ptr (new MockContextManager(id, c, view));
+    return ptr;
+}
+
+ContextManagerFactoryMethod makeContextManagerFactoryMethod()
+{
+    return contextManagerFactoryMethod;
+}
+
+} // namespace ViewModule
\ No newline at end of file
diff --git a/tests/widgets/common/src/mock/MockViewModule.cpp b/tests/widgets/common/src/mock/MockViewModule.cpp
new file mode 100644 (file)
index 0000000..1bc72a0
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file        MockViewModule.cpp
+ * @author      Tomasz Iwanek (t.iwanek@samsung.com)
+ * @brief       Mock for view module
+ */
+
+#include "mock/MockViewModule.h"
+
+MockViewModule::MockViewModule()
+{
+}
+
+bool MockViewModule::createWebView(Ewk_Context* /*context*/,
+                         Evas_Object* /*window*/)
+{
+    return true;
+}
+
+void MockViewModule::prepareView(WidgetModel *, const std::string &)
+{
+}
+
+void MockViewModule::showWidget()
+{
+}
+
+void MockViewModule::hideWidget()
+{
+}
+
+void MockViewModule::suspendWidget()
+{
+}
+
+void MockViewModule::resumeWidget()
+{
+}
+
+void MockViewModule::setWidgetUrl(const std::string &)
+{
+}
+
+void MockViewModule::resetWidgetFromSuspend()
+{
+}
+
+void MockViewModule::resetWidgetFromResume()
+{
+}
+
+void MockViewModule::backward()
+{
+}
+
+void MockViewModule::reloadStartPage()
+{
+}
+
+Evas_Object* MockViewModule::getCurrentWebview()
+{
+    return NULL;
+}
+
+void MockViewModule::fireJavascriptEvent(int /*event*/, void* /*data*/)
+{
+}
+
+void MockViewModule::setUserCallbacks(const WRT::UserDelegatesPtr& /*cbs*/)
+{
+}
+
+void MockViewModule::checkSyncMessageFromBundle(
+      const char* /*name*/,
+      const char* /*body*/,
+      char** /*returnData*/)
+{
+}
+
+void MockViewModule::checkAsyncMessageFromBundle(
+        const char* /*name*/,
+        const char* /*body*/)
+{
+}
+
+void MockViewModule::downloadData(const char* /*url*/)
+{
+}
+
+void MockViewModule::activateVibration(bool /*on*/, uint64_t /*time*/)
+{
+}
diff --git a/tests/widgets/files/CMakeLists.txt b/tests/widgets/files/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5f87442
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+# @file        CMakeLists.txt
+# @author      Tomasz Iwanek (t.iwanek@samsung.com)
+#
+
+SET(WRT_TESTS_GENERAL_WIDGETS_PATH "/opt/share/widget/tests/general/")
+
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/any.wgt DESTINATION ${WRT_TESTS_GENERAL_WIDGETS_PATH})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/minimal.wgt DESTINATION ${WRT_TESTS_GENERAL_WIDGETS_PATH})
diff --git a/tests/widgets/files/any.wgt b/tests/widgets/files/any.wgt
new file mode 100644 (file)
index 0000000..8157660
Binary files /dev/null and b/tests/widgets/files/any.wgt differ
diff --git a/tests/widgets/files/minimal.wgt b/tests/widgets/files/minimal.wgt
new file mode 100644 (file)
index 0000000..86466af
Binary files /dev/null and b/tests/widgets/files/minimal.wgt differ
diff --git a/uncrustify.cfg b/uncrustify.cfg
new file mode 100644 (file)
index 0000000..2bf1d96
--- /dev/null
@@ -0,0 +1,170 @@
+indent_align_string=true\r
+indent_braces=false\r
+indent_braces_no_func=false\r
+indent_brace_parent=false\r
+indent_namespace=false\r
+indent_extern=false\r
+indent_class=true\r
+indent_class_colon=false\r
+indent_else_if=false\r
+indent_func_call_param=false\r
+indent_func_def_param=false\r
+indent_func_proto_param=false\r
+indent_func_class_param=false\r
+indent_func_ctor_var_param=false\r
+indent_template_param=false\r
+indent_func_param_double=false\r
+indent_relative_single_line_comments=false\r
+indent_col1_comment=true\r
+indent_access_spec_body=false\r
+indent_paren_nl=false\r
+indent_comma_paren=false\r
+indent_bool_paren=false\r
+indent_square_nl=false\r
+indent_preserve_sql=false\r
+indent_align_assign=false\r
+sp_balance_nested_parens=false\r
+align_keep_tabs=false\r
+align_with_tabs=false\r
+align_on_tabstop=false\r
+align_number_left=false\r
+align_func_params=false\r
+align_same_func_call_params=false\r
+align_var_def_colon=false\r
+align_var_def_attribute=false\r
+align_var_def_inline=false\r
+align_right_cmt_mix=false\r
+align_on_operator=false\r
+align_mix_var_proto=false\r
+align_single_line_func=false\r
+align_single_line_brace=false\r
+align_nl_cont=false\r
+align_left_shift=true\r
+nl_collapse_empty_body=true\r
+nl_assign_leave_one_liners=false\r
+nl_class_leave_one_liners=false\r
+nl_enum_leave_one_liners=false\r
+nl_getset_leave_one_liners=false\r
+nl_func_leave_one_liners=false\r
+nl_if_leave_one_liners=false\r
+nl_multi_line_cond=true\r
+nl_multi_line_define=false\r
+nl_before_case=false\r
+nl_after_case=false\r
+nl_after_return=false\r
+nl_after_semicolon=true\r
+nl_after_brace_open=false\r
+nl_after_brace_open_cmt=false\r
+nl_after_vbrace_open=false\r
+nl_after_brace_close=false\r
+nl_define_macro=false\r
+nl_squeeze_ifdef=false\r
+nl_ds_struct_enum_cmt=false\r
+nl_ds_struct_enum_close_brace=false\r
+nl_create_if_one_liner=false\r
+nl_create_for_one_liner=false\r
+nl_create_while_one_liner=false\r
+ls_for_split_full=true\r
+ls_func_split_full=true\r
+nl_after_multiline_comment=false\r
+eat_blanks_after_open_brace=true\r
+eat_blanks_before_close_brace=true\r
+mod_pawn_semicolon=false\r
+mod_full_paren_if_bool=false\r
+mod_remove_extra_semicolon=true\r
+mod_sort_import=false\r
+mod_sort_using=false\r
+mod_sort_include=false\r
+mod_move_case_break=false\r
+mod_remove_empty_return=false\r
+cmt_indent_multi=true\r
+cmt_c_group=false\r
+cmt_c_nl_start=false\r
+cmt_c_nl_end=false\r
+cmt_cpp_group=false\r
+cmt_cpp_nl_start=false\r
+cmt_cpp_nl_end=false\r
+cmt_cpp_to_c=false\r
+cmt_star_cont=true\r
+cmt_multi_check_last=true\r
+cmt_insert_before_preproc=false\r
+pp_indent_at_level=false\r
+pp_region_indent_code=false\r
+pp_if_indent_code=false\r
+pp_define_at_level=false\r
+indent_columns=4\r
+indent_member=4\r
+indent_access_spec=-2\r
+code_width=80\r
+nl_max=2\r
+nl_before_access_spec=2\r
+cmt_width=80\r
+indent_with_tabs=0\r
+sp_arith=force\r
+sp_assign=force\r
+sp_enum_assign=force\r
+sp_pp_concat=remove\r
+sp_pp_stringify=remove\r
+sp_bool=force\r
+sp_compare=force\r
+sp_paren_brace=force\r
+sp_angle_paren=remove\r
+sp_before_sparen=force\r
+sp_inside_sparen=remove\r
+sp_after_sparen=force\r
+sp_sparen_brace=force\r
+sp_before_semi=remove\r
+sp_after_semi_for_empty=remove\r
+sp_before_square=remove\r
+sp_before_squares=remove\r
+sp_inside_square=remove\r
+sp_after_comma=force\r
+sp_before_comma=remove\r
+sp_after_class_colon=force\r
+sp_before_class_colon=force\r
+sp_before_case_colon=remove\r
+sp_inside_braces=add\r
+sp_inside_fparens=remove\r
+sp_inside_fparen=remove\r
+sp_func_call_paren=remove\r
+sp_func_class_paren=remove\r
+sp_else_brace=force\r
+sp_brace_else=force\r
+sp_catch_brace=force\r
+sp_brace_catch=force\r
+sp_try_brace=force\r
+sp_before_dc=remove\r
+sp_after_dc=remove\r
+sp_not=remove\r
+sp_inv=remove\r
+sp_addr=remove\r
+sp_member=remove\r
+sp_deref=remove\r
+sp_sign=remove\r
+sp_incdec=remove\r
+sp_cond_colon=force\r
+sp_cond_question=force\r
+sp_case_label=force\r
+nl_assign_brace=remove\r
+nl_if_brace=remove\r
+nl_brace_else=remove\r
+nl_elseif_brace=remove\r
+nl_else_brace=remove\r
+nl_else_if=remove\r
+nl_try_brace=remove\r
+nl_for_brace=remove\r
+nl_catch_brace=remove\r
+nl_brace_catch=remove\r
+nl_while_brace=remove\r
+nl_do_brace=remove\r
+nl_brace_while=remove\r
+nl_switch_brace=remove\r
+nl_namespace_brace=remove\r
+nl_class_brace=force\r
+nl_fdef_brace=force\r
+pos_class_comma=trail\r
+pos_class_colon=trail\r
+mod_full_brace_do=add\r
+mod_full_brace_for=add\r
+mod_full_brace_if=add\r
+mod_full_brace_while=add\r
diff --git a/uncrustify.sh b/uncrustify.sh
new file mode 100755 (executable)
index 0000000..f1edae0
--- /dev/null
@@ -0,0 +1 @@
+uncrustify -c uncrustify.cfg --no-backup `find . -regex "\(.*\.cpp\|.*\.h\|.*\.c\|.*\.cc\)" | grep -v "orm.h\|orm_generator.h"`
diff --git a/wrt-engine-test.map b/wrt-engine-test.map
new file mode 100644 (file)
index 0000000..02ed1dd
--- /dev/null
@@ -0,0 +1,7 @@
+{
+    global: *;
+            extern "C++" {
+                *;
+            };
+};
+
diff --git a/wrt-engine.map b/wrt-engine.map
new file mode 100644 (file)
index 0000000..59c84e5
--- /dev/null
@@ -0,0 +1,23 @@
+{
+    global: wrt_*;
+            plugin_api_*;
+            extern "C++" {
+                Popup::PopupRenderer::*PopupRenderer*;
+                Popup::PopupRenderer::Initialize*;
+                Popup::PopupRenderer::Deinitialize*;
+
+                Popup::PopupManager::*PopupManager*;
+                Popup::PopupManager::Initialize*;
+                Popup::PopupManager::Deinitialize*;
+                Popup::PopupManager::CreatePopup*;
+                Popup::PopupRenderer::PopupRenderer*;
+                Popup::PopupRenderer::*PopupRenderer*;
+                Popup::PopupRenderer::Initialize*;
+                Popup::PopupRenderer::Deinitialize*;
+            };
+            UG_MODULE_INIT;
+            UG_MODULE_EXIT;
+            main;
+    local: *;
+};
+
diff --git a/wrt.manifest b/wrt.manifest
new file mode 100644 (file)
index 0000000..579e3af
--- /dev/null
@@ -0,0 +1,18 @@
+<manifest>
+  <define>
+    <domain name="wrt"/>
+      <provide>
+        <label name="wrt::wrt-launcher"/>
+        <label name="wrt::wrt_launchepad_daemon"/>
+      </provide>
+  </define>
+  <assign>
+    <filesystem path="/usr/bin/wrt-launcher" label="wrt::wrt-launcher" exec_label="wrt::wrt-launcher"/>
+    <filesystem path="/usr/bin/wrt_launchpad_daemon" label="wrt_launchpad_daemon" exec_label="wrt_launchpad_daemon"/>
+    <filesystem path="/usr/bin/wrt_reset_all.sh" label="_" exec_label="none"/>
+    <filesystem path="/usr/bin/wrt_reset_db.sh" label="_" exec_label="none"/>
+  </assign>
+  <request>
+    <domain name="_"/>
+  </request>
+</manifest>
diff --git a/wrt_env.sh b/wrt_env.sh
new file mode 100644 (file)
index 0000000..7dbf0bc
--- /dev/null
@@ -0,0 +1,7 @@
+#export WRT_PROCESS_POOL_DISABLE=ON
+#export WRT_WILL_SEND_REQUEST_LOG_ENABLE=ON
+#export WRT_LOAD_PLUGINS_LOG_ENABLE=ON
+#export WRT_FRAME_RENDERED_LOG_ENABLE=ON
+#export WRT_CONSOLE_LOG_ENABLE=ON
+#export WRT_WIDGET_DATA_TYPES_LOG_ENABLE=ON
+
diff --git a/wrt_launchpad_daemon.rule.in b/wrt_launchpad_daemon.rule.in
new file mode 100644 (file)
index 0000000..db9d2e5
--- /dev/null
@@ -0,0 +1,7 @@
+wrt_launchpad_daemon system::share rwx
+wrt_launchpad_daemon system::homedir rwx
+wrt_launchpad_daemon device::app_logging w
+wrt_launchpad_daemon xorg rw
+wrt_launchpad_daemon webkit2-efl rwxa
+wrt_launchpad_daemon sys-assert::core rwxat
+wrt_launchpad_daemon location_fw::client rwx
diff --git a/wrt_launchpad_daemon.rule.lite.in b/wrt_launchpad_daemon.rule.lite.in
new file mode 100644 (file)
index 0000000..60ff8da
--- /dev/null
@@ -0,0 +1,158 @@
+wrt_launchpad_daemon * t
+wrt_launchpad_daemon ^ xrw
+wrt_launchpad_daemon _ l
+wrt_launchpad_daemon 57r43275q7 xrw
+wrt_launchpad_daemon activesync-ui::eas-appsvc rwxa
+wrt_launchpad_daemon ail::db rwxa
+wrt_launchpad_daemon alarm-server rwxa
+wrt_launchpad_daemon aospd00043 rx
+wrt_launchpad_daemon app-svc::db rwxa
+wrt_launchpad_daemon atd-server xrw
+wrt_launchpad_daemon aul rwxa
+wrt_launchpad_daemon aul::launch x
+wrt_launchpad_daemon brcm_daemon xrw
+wrt_launchpad_daemon browser-provider rwxa
+wrt_launchpad_daemon browser-scrap-service xrw
+wrt_launchpad_daemon bt_firmware rx
+wrt_launchpad_daemon bt_share rwxa
+wrt_launchpad_daemon bt-service xrw
+bt-service wrt_launchpad_daemon rwxa
+wrt_launchpad_daemon calendar-service xrw
+wrt_launchpad_daemon cbhm rwxa
+wrt_launchpad_daemon com.samsung.browser::vconf_public rw
+wrt_launchpad_daemon com.samsung.dailybriefing-weather-lite xrw
+wrt_launchpad_daemon com.samsung.data-provider-slave xrw
+wrt_launchpad_daemon com.samsung.facebook xrw
+wrt_launchpad_daemon com.samsung.homescreen xrw
+wrt_launchpad_daemon com.samsung.indicator rwx
+com.samsung.indicator wrt_launchpad_daemon rwx
+wrt_launchpad_daemon com.samsung.lockscreen xrw
+wrt_launchpad_daemon com.samsung.mobileprint rwxa
+wrt_launchpad_daemon com.samsung.quickpanel rwx
+com.samsung.quickpanel wrt_launchpad_daemon rwx
+wrt_launchpad_daemon com.samsung.setting::default-resources rx
+wrt_launchpad_daemon com.samsung.task-mgr xrw
+wrt_launchpad_daemon com.samsung.volume xrw
+wrt_launchpad_daemon connman rwxa
+wrt_launchpad_daemon contacts-service xrw
+wrt_launchpad_daemon coord xrw
+wrt_launchpad_daemon crash-worker rwxa
+wrt_launchpad_daemon csc-manager rwxa
+wrt_launchpad_daemon data-provider-master rwxa
+wrt_launchpad_daemon data-provider-master::notification rwx
+wrt_launchpad_daemon data-provider-master::notification.client rwx
+wrt_launchpad_daemon data-router xrw
+wrt_launchpad_daemon dbus rwxa
+dbus wrt_launchpad_daemon rwxa
+wrt_launchpad_daemon device::app_logging rw
+wrt_launchpad_daemon device::bklight rwxa
+wrt_launchpad_daemon device::camera rw
+wrt_launchpad_daemon device::hwcodec rw
+wrt_launchpad_daemon device::joystick r
+wrt_launchpad_daemon device::radio rw
+wrt_launchpad_daemon device::sys_logging w
+wrt_launchpad_daemon device::video rw
+wrt_launchpad_daemon deviced rwxa
+wrt_launchpad_daemon deviced::display rw
+wrt_launchpad_daemon deviced::haptic rw
+wrt_launchpad_daemon download-provider rwxa
+wrt_launchpad_daemon drmfw rw
+wrt_launchpad_daemon e17 rwxa
+e17 wrt_launchpad_daemon rw
+wrt_launchpad_daemon eas-engine::docsearch rx
+wrt_launchpad_daemon email-service rwx
+email-service wrt_launchpad_daemon rw
+wrt_launchpad_daemon immvibed rwxa
+wrt_launchpad_daemon isf rwxa
+wrt_launchpad_daemon key-manager xrw
+wrt_launchpad_daemon launchpad xrw
+wrt_launchpad_daemon livebox.web-provider rwx
+livebox.web-provider wrt_launchpad_daemon rwx
+wrt_launchpad_daemon location_fw rwx
+wrt_launchpad_daemon location_fw::client rw
+wrt_launchpad_daemon location_fw::dbus rw
+wrt_launchpad_daemon location_fw::vconf rl
+wrt_launchpad_daemon media-data::db rw
+wrt_launchpad_daemon media-server rwxa
+media-server wrt_launchpad_daemon rwxa
+wrt_launchpad_daemon messageportd xrw
+wrt_launchpad_daemon mm_qcamera_daemon rwx
+wrt_launchpad_daemon mobex-agent rwxa
+wrt_launchpad_daemon mobicore-daemon rwxa
+wrt_launchpad_daemon msg-service xrw
+wrt_launchpad_daemon mtp-responder rwxa
+wrt_launchpad_daemon nas9xepmna rwxa
+nas9xepmna wrt_launchpad_daemon rwxa
+wrt_launchpad_daemon net-config rwxa
+wrt_launchpad_daemon nfc-manager w
+nfc-manager wrt_launchpad_daemon w
+wrt_launchpad_daemon notification rwxa
+wrt_launchpad_daemon notification::db rw
+wrt_launchpad_daemon Odnp xrw
+wrt_launchpad_daemon oma-dm-agent xrw
+wrt_launchpad_daemon pkgmgr::db rlw
+wrt_launchpad_daemon pkgmgr-client rwx
+wrt_launchpad_daemon privacy-manager::db rl
+wrt_launchpad_daemon pulseaudio rwxat
+wrt_launchpad_daemon pulseaudio::record r
+wrt_launchpad_daemon push-service rwxa
+wrt_launchpad_daemon resman rwxa
+wrt_launchpad_daemon samsung-account-front rwxa
+wrt_launchpad_daemon samsung-log-manager xrw
+wrt_launchpad_daemon sdbd xrw
+wrt_launchpad_daemon sdbd::home rx
+wrt_launchpad_daemon secure-storage rwxa
+wrt_launchpad_daemon security-server xrw
+wrt_launchpad_daemon sensord xrw
+wrt_launchpad_daemon sensor-framework rwxa
+wrt_launchpad_daemon sjjevolsjk xrw
+wrt_launchpad_daemon sound_server rwxa
+wrt_launchpad_daemon spreadtrum-utils xrw
+wrt_launchpad_daemon starter rwxa
+wrt_launchpad_daemon stt-server rwxa
+wrt_launchpad_daemon svi-data rwx
+wrt_launchpad_daemon sys-assert::core rwxat
+wrt_launchpad_daemon syslogd xrw
+wrt_launchpad_daemon system::clipboard wrxat
+wrt_launchpad_daemon system::debugging_network rw
+system::debugging_network wrt_launchpad_daemon w
+wrt_launchpad_daemon system::ext_storage rwxat
+wrt_launchpad_daemon system::ext_storage_appdata r-x
+wrt_launchpad_daemon system::homedir rwxat
+wrt_launchpad_daemon system::media rwxat
+wrt_launchpad_daemon system::media::root rwxat
+wrt_launchpad_daemon system::share rwxat
+wrt_launchpad_daemon system::use_internet xwtr
+system::use_internet wrt_launchpad_daemon xwtr
+wrt_launchpad_daemon system::vconf rwxat
+wrt_launchpad_daemon system::vconf_inhouse arwx
+wrt_launchpad_daemon system::vconf_misc arwx
+wrt_launchpad_daemon system::vconf_multimedia arwx
+wrt_launchpad_daemon system::vconf_network arwx
+wrt_launchpad_daemon system::vconf_privacy arwx
+wrt_launchpad_daemon system::vconf_setting arwx
+wrt_launchpad_daemon system::vconf_system arwx
+wrt_launchpad_daemon telephony_framework xrw
+wrt_launchpad_daemon telephony_framework::api_modem r
+wrt_launchpad_daemon trm xrw
+wrt_launchpad_daemon tts-server rwx
+wrt_launchpad_daemon ug-setting-call-efl::vconf rwx
+wrt_launchpad_daemon usbotg-syspopup rwxa
+wrt_launchpad_daemon usb-server rwxa
+wrt_launchpad_daemon usb-syspopup rwxa
+wrt_launchpad_daemon webkit2-efl rwxa
+webkit2-efl wrt_launchpad_daemon rwxa
+wrt_launchpad_daemon webkit2-efl::vconf rl
+wrt_launchpad_daemon webkit2-extension rwxa
+webkit2-extension wrt_launchpad_daemon rwxa
+wrt_launchpad_daemon wifi-direct xrw
+wrt_launchpad_daemon wpasupplicant xrw
+wrt_launchpad_daemon wrt::db_origin rxwl
+wrt_launchpad_daemon wrt_launchpad_daemon rwxa
+wrt_launchpad_daemon wrt-commons::db_wrt rwxa
+wrt_launchpad_daemon wrt-popup-wrt-runtime rwxa
+wrt_launchpad_daemon wrt-security-daemon rwxa
+wrt_launchpad_daemon wrt-security-daemon::db rlwx
+wrt_launchpad_daemon xorg rwxa
+com.samsung.setting wrt_launchpad_daemon rwx
+notification wrt_launchpad_daemon rwxa
diff --git a/wrt_reset_all.sh b/wrt_reset_all.sh
new file mode 100755 (executable)
index 0000000..cda1c3e
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+# resets all databases and security daemon
+wrt_reset_db.sh "$@"
+pkill -9 wrt-security
+pkill -9 security-serv
+security-server </dev/null 1>/dev/null 2>/dev/null &
+wrt-security-daemon </dev/null 1>/dev/null 2>/dev/null &
+
diff --git a/wrt_reset_db.sh b/wrt_reset_db.sh
new file mode 100755 (executable)
index 0000000..e54b69d
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash
+# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+# resets all databases
+# wrt_commons_reset_db.sh is trying to uninstall all widgets first
+# so should be called first
+wrt_commons_reset_db.sh "$@"
+wrt_security_create_clean_db.sh