[Release] wrt_0.8.268
authorsung-su.kim <sung-su.kim@samsung.com>
Wed, 4 Sep 2013 10:53:13 +0000 (19:53 +0900)
committerHoseon LEE <hoseon46.lee@samsung.com>
Sun, 29 Sep 2013 05:38:18 +0000 (14:38 +0900)
Change-Id: I9b1a1df599061c4d6fc3664de5092a1e642b3bc8

74 files changed:
CMakeLists.txt
data/WAC2.0TestRootCA.cert [deleted file]
data/communicationBox.edc [deleted file]
data/userAgentProfile.xml [deleted file]
packaging/wrt.spec
po/ar.po
po/az.po
po/bg.po
po/ca.po
po/cs.po
po/da.po
po/de_DE.po
po/el_GR.po
po/en.po
po/en_PH.po
po/en_US.po
po/es_ES.po
po/es_MX.po
po/et.po
po/eu.po
po/fi.po
po/fr_CA.po
po/fr_FR.po
po/ga.po
po/gl.po
po/hi.po
po/hr.po
po/hu.po
po/hy.po
po/is.po
po/it_IT.po
po/ja_JP.po
po/ka.po
po/kk.po
po/ko_KR.po
po/lt.po
po/lv.po
po/mk.po
po/nb.po
po/nl_NL.po
po/pl.po
po/pt_BR.po
po/pt_PT.po
po/ro.po
po/ru_RU.po
po/sk.po
po/sl.po
po/sr.po
po/sv.po
po/tr_TR.po
po/uk.po
po/uz.po
po/zh_CN.po
po/zh_HK.po
po/zh_SG.po
po/zh_TW.po
src/domain/widget_string.h
src/view/common/scheme_action_map.cpp
src/view/common/scheme_action_map.h
src/view/common/view_logic_certificate_support.cpp [changed mode: 0644->0755]
src/view/webkit/CMakeLists.txt
src/view/webkit/view_logic.cpp
src/view/webkit/view_logic.h
src/view/webkit/view_logic_scheme_support.cpp
src/view/webkit/view_logic_scheme_support.h
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
src/view/webkit/view_logic_web_notification_support.h
src/wrt-client/window_data.cpp
src/wrt-client/window_data.h
src/wrt-client/wrt-client.cpp

index 620012e..d1c7736 100644 (file)
@@ -155,77 +155,75 @@ ENDIF(PROFILING)
 ADD_DEFINITIONS("-DWRT_EDJ_PATH=\"/usr/share/edje/wrt/Wrt.edj\"")
 
 #############################
-# install
-INSTALL(FILES
-    ${PROJECT_SOURCE_DIR}/wrt_reset_db.sh
-    ${PROJECT_SOURCE_DIR}/wrt_reset_all.sh
-    DESTINATION /usr/bin/
-    )
-INSTALL(FILES   ${CMAKE_SOURCE_DIR}/data/userAgentProfile.xml
-    DESTINATION share/wrt-engine/
-    )
-INSTALL(FILES   ${CMAKE_SOURCE_DIR}/data/WAC2.0TestRootCA.cert
-    DESTINATION share/wrt-engine/
-    )
+# edc build
 ADD_CUSTOM_COMMAND(
     OUTPUT ${PROJECT_SOURCE_DIR}/data/Wrt.edj
     COMMAND edje_cc
     ARGS  ${PROJECT_SOURCE_DIR}/data/Wrt.edc
           ${PROJECT_SOURCE_DIR}/data/Wrt.edj
     DEPENDS ${PROJECT_SOURCE_DIR}/data/Wrt.edc
-    )
-ADD_CUSTOM_TARGET( WRT_EDJES ALL DEPENDS
-    ${PROJECT_SOURCE_DIR}/data/Wrt.edj
-    )
+)
+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(generic_popup ALL DEPENDS
-    ${PROJECT_SOURCE_DIR}/data/generic_popup.edj
-    )
-INSTALL(FILES   ${PROJECT_SOURCE_DIR}/data/generic_popup.edj
-    DESTINATION share/edje/ace/
-    )
-INSTALL(FILES   ${PROJECT_SOURCE_DIR}/data/Wrt.edj
-    DESTINATION share/edje/wrt/
-    )
+)
+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(generic_popup_horizontal ALL DEPENDS
+)
+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
-    )
-INSTALL(FILES   ${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/
-    )
+)
 INSTALL(FILES   ${CMAKE_SOURCE_DIR}/wrt_launchpad_daemon.rule
     DESTINATION /etc/smack/accesses2.d/
-    )
+)
 # temp for smack branch
 INSTALL(FILES   ${CMAKE_SOURCE_DIR}/accesses.d/wrt_launchpad_daemon.rule
     DESTINATION /opt/etc/smack/accesses.d/
-    )
-# install systemd files
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon@.service
-    DESTINATION /usr/lib/systemd/system/
-    )
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon_1.socket
-    DESTINATION /usr/lib/systemd/system/
-    )
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon_2.socket
+)
+INSTALL(FILES
+    ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon@.service
+    ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon_1.socket
+    ${CMAKE_CURRENT_SOURCE_DIR}/systemd/wrt_launchpad_daemon_2.socket
     DESTINATION /usr/lib/systemd/system/
-    )
+)
 
 ADD_SUBDIRECTORY(src)
 ADD_SUBDIRECTORY(po)
diff --git a/data/WAC2.0TestRootCA.cert b/data/WAC2.0TestRootCA.cert
deleted file mode 100644 (file)
index 140ab72..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-TODO: this certificate is NOT a WAC-issued certificate.
-Replace with WAC-issued certificate when we get access to it.
------BEGIN CERTIFICATE-----
-MIIDnzCCAwigAwIBAgIJAIV94cXZ3nofMA0GCSqGSIb3DQEBBQUAMIGSMQswCQYD
-VQQGEwJQTDEUMBIGA1UECBMLTWF6b3dpZWNraWUxEDAOBgNVBAoTB1NhbXN1bmcx
-DTALBgNVBAsTBFNQUkMxJzAlBgNVBAMTHk9wZXJhdG9yIFRlc3QgUm9vdCBDZXJ0
-aWZpY2F0ZTEjMCEGCSqGSIb3DQEJARYUb3BlcmF0b3JAc2Ftc3VuZy5jb20wHhcN
-MTEwMTA0MTcyNzA4WhcNMTQwMTAzMTcyNzA4WjCBkjELMAkGA1UEBhMCUEwxFDAS
-BgNVBAgTC01hem93aWVja2llMRAwDgYDVQQKEwdTYW1zdW5nMQ0wCwYDVQQLEwRT
-UFJDMScwJQYDVQQDEx5PcGVyYXRvciBUZXN0IFJvb3QgQ2VydGlmaWNhdGUxIzAh
-BgkqhkiG9w0BCQEWFG9wZXJhdG9yQHNhbXN1bmcuY29tMIGfMA0GCSqGSIb3DQEB
-AQUAA4GNADCBiQKBgQDDOReo+dBpN5pWRDlnEBSpS6ILx/yh6Oj3HAb0nIP3Nwed
-nCwbRkNf8XuRqM3AdgDVnMko95EotpfshbEQD1gu9m+Ytqt7yggQf1UyvzLbp8KG
-gwPuQQok3hfjnY9b+kZweJi0wRR3RKtZfEzTSvdU8jANOHOVnyEOqYY+/IJOCwID
-AQABo4H6MIH3MB0GA1UdDgQWBBQlpZCfTTqkGQqARl7z+yDOVjAz2jCBxwYDVR0j
-BIG/MIG8gBQlpZCfTTqkGQqARl7z+yDOVjAz2qGBmKSBlTCBkjELMAkGA1UEBhMC
-UEwxFDASBgNVBAgTC01hem93aWVja2llMRAwDgYDVQQKEwdTYW1zdW5nMQ0wCwYD
-VQQLEwRTUFJDMScwJQYDVQQDEx5PcGVyYXRvciBUZXN0IFJvb3QgQ2VydGlmaWNh
-dGUxIzAhBgkqhkiG9w0BCQEWFG9wZXJhdG9yQHNhbXN1bmcuY29tggkAhX3hxdne
-eh8wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQC513JJCdhvYZRRQJ3D
-0yNTl7gS7svdV+YfonY4XUJRvakwGfdnW6hnSp6h8KkiFJR3Mid5N5wKD1KAFGIA
-lEWFO/2ttMMgRbq3kRqeOFEPm9XOdMe9SiGaLbVxC0LSlXJm/usRrWJEbDJOtAA3
-17jVS/Z0NnjWrmazym5C/8vC5g==
------END CERTIFICATE-----
diff --git a/data/communicationBox.edc b/data/communicationBox.edc
deleted file mode 100755 (executable)
index 61f3b52..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-#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";
-#define BUTTON_WIDTH 220.0
-#define BUTTON_HEIGHT 50.0
-#define BUTTON_GAP 50.0
-#define PART_MAX 5000
-               parts{
-                               part { 
-                               name: "box";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.1; }
-                                       rel2 { relative: 0.95 0.3; }
-                    align: 0.0 0.0;
-                                       }
-                       }
-                part { 
-                               name: "label_up";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.0; }
-                                       rel2 { relative: 0.95 0.1; }
-                    align: 0.0 0.0;
-                                       }
-                       }       
-                       part { 
-                               name: "label_down";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                    state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.1; }
-                                       rel2 { relative: 0.95 0.2; }
-                    align: 0.0 0.0;
-                                       }
-                       }       
-                       part { 
-                               name: "scroller";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: 435 BUTTON_GAP;
-                                       max: 435 BUTTON_GAP;
-                    state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.1; }
-                                       rel2 { relative: 0.95 0.2; }
-                    align: 0.0 0;
-                                       }
-                       }       
-            part { 
-                               name: "btn_1_blanket";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.4; }
-                                       rel2 { relative: 0.5 0.5; }
-                    align: 0.5 0.0;
-                                       }
-                       }       
-           part { 
-                               name: "btn_2_blanket";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.5 0.4; }
-                                       rel2 { relative: 0.95 0.5; }
-                    align: 0.5 0.0;
-                                       }
-                       }               
-    part { 
-                               name: "btn_3_blanket";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.55; }
-                                       rel2 { relative: 0.5 0.65; }
-                    align: 0.5 0.0;
-                                       }
-                       }        
-    part { 
-                               name: "btn_1_oneshot";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.4; }
-                                       rel2 { relative: 0.95 0.5; }
-                    align: 0.5 0.0;
-                                       }
-                       }       
-           part { 
-                               name: "btn_2_oneshot";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.55; }
-                                       rel2 { relative: 0.95 0.65; }
-                    align: 0.5 0.0;
-                                       }
-                       }               
-    part { 
-                               name: "btn_3_oneshot";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.7; }
-                                       rel2 { relative: 0.95 0.8; }
-                    align: 0.5 0.0;
-                                       }
-                       }       
-    
-    part { 
-                               name: "btn_4_blanket";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.5 0.55; }
-                                       rel2 { relative: 0.95 0.65; }
-                    align: 0.5 0.0;
-                                       }
-                       }               
-        part { 
-                               name: "btn_5_blanket";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.7; }
-                                       rel2 { relative: 0.5 0.8; }
-                    align: 0.5 0.0;
-                                       }
-                       }        
-        part { 
-                               name: "btn_5_session";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.05 0.7; }
-                                       rel2 { relative: 0.95 0.8; }
-                    align: 0.5 0.0;
-                                       }
-                       }                       
-            part { 
-                               name: "btn_6_blanket";
-                               type: SWALLOW;
-                               scale: 1;
-                               
-                               description {
-                                       min: BUTTON_WIDTH BUTTON_GAP;
-                                       max: BUTTON_WIDTH BUTTON_GAP;
-                                       state: "default" 0.0;
-                                       rel1 { relative: 0.5 0.7; }
-                                       rel2 { relative: 0.95 0.8; }
-                    align: 0.5 0.0;
-                                       }
-                       }       
-#undef BUTTON_WIDTH 
-#undef BUTTON_HEIGHT
-#undef BUTTON_GAP
-#undef PART_MAX
-               } 
-       }   
-
-}
diff --git a/data/userAgentProfile.xml b/data/userAgentProfile.xml
deleted file mode 100644 (file)
index e8c8b7c..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" ?>
-<!--
-***************************************************************************************
-*  SAMSUNG UAProf ( User Agent Profile ) draft
-*
-*  Created: 10/01/2011
-*  Author: Bartosz Janiak
-*  Organization: SPRC (Samsung Poland R&D Center), Linux Team
-*
-*  Copyright 2011 SAMSUNG Electronics Co. Ltd.
-*
-***************************************************************************************
--->
-
-<!-- TODO: update UAProf-WAC namespace to point to a publicly available schema -->
-<rdf:RDF
-    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-    xmlns:prf="http://www.openmobilealliance.org/tech/profiles/UAPROF/xmlschema-20030226#"
-    xmlns:wrt="https://members.wholesaleappcommunity.com/svn/rmprojects/waikikispec/trunk/WaikikiFR/html/core/ccppschema-wac-v2_0.xml#" >
-
-    <rdf:Description rdf:ID="A847DeviceProfile">
-
-    <!-- Hardware Platform Description -->
-    <prf:component>
-    <rdf:Description rdf:ID="HardwarePlatform">
-
-        <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#HardwarePlatform" />
-
-        <!-- Vendor/model -->
-        <prf:Vendor>SAMSUNG</prf:Vendor>
-        <prf:Model>TIZEN</prf:Model>
-        <prf:CPU>ARM9</prf:CPU>
-
-        <!-- Display -->
-        <prf:ScreenSize>480x800</prf:ScreenSize>
-        <prf:ColorCapable>Yes</prf:ColorCapable>
-
-        <!-- TODO -->
-
-    </rdf:Description>
-    </prf:component>
-
-
-    <!-- Software Platform Description -->
-    <prf:component>
-    <rdf:Description rdf:ID="SoftwarePlatform">
-    <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#SoftwarePlatform" />
-
-        <!-- TODO -->
-
-    </rdf:Description>
-    </prf:component>
-
-
-    <!-- Network Characteristics Description -->
-    <prf:component>
-    <rdf:Description rdf:ID="NetworkCharacteristics">
-    <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#NetworkCharacteristics" />
-
-        <!-- TODO -->
-
-    </rdf:Description>
-    </prf:component>
-
-    <!-- Browser UA Description -->
-    <prf:component>
-    <rdf:Description rdf:ID="BrowserUA">
-    <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#BrowserUA" />
-
-        <!-- TODO -->
-        <!--  Browser Identification -->
-        <prf:BrowserName>Webkit</prf:BrowserName>
-
-    </rdf:Description>
-    </prf:component>
-
-    <!-- WAP Characteristics Description -->
-    <prf:component>
-    <rdf:Description rdf:ID="WapCharacteristics">
-    <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#WapCharacteristics" />
-
-        <!-- TODO -->
-
-    </rdf:Description>
-    </prf:component>
-
-    <!-- Push Characteristics Description -->
-    <prf:component>
-    <rdf:Description rdf:ID="PushCharacteristics">
-    <rdf:type rdf:resource="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#PushCharacteristics" />
-
-        <!-- TODO -->
-
-    </rdf:Description>
-    </prf:component>
-
-    <!-- Web Runtime description -->
-    <prf:component>
-    <rdf:Description rdf:ID="WRT-UA">
-
-        <rdf:type rdf:resource="https://members.wholesaleappcommunity.com/svn/rmprojects/waikikispec/trunk/WaikikiFR/html/core/ccppschema-wac-v2_0.xml#WRT-UA" />
-        <wrt:WRT-WAC-Version>1.0, 2.0</wrt:WRT-WAC-Version>
-        <wrt:WRT-Name>WebRuntime</wrt:WRT-Name>
-        <wrt:WRT-Version>1.0</wrt:WRT-Version> <!-- TODO -->
-        <wrt:WRT-HtmlVersion>4.01, 5.0</wrt:WRT-HtmlVersion> <!-- TODO -->
-        <wrt:WRT-EcmascriptVersion>?</wrt:WRT-EcmascriptVersion> <!-- TODO -->
-        <wrt:WRT-SvgVersion>?</wrt:WRT-SvgVersion> <!-- TODO -->
-        <wrt:WRT-WAC-APIs>
-            <rdf:Bag>
-                <rdf:li rdf:resource="http://wacapps.net/api/deviceapis"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/accelerometer"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/orientation"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/camera"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/devicestatus"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/filesystem"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/messaging"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/pim"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/pim.contact"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/pim.calendar"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/pim.task"/>
-                <rdf:li rdf:resource="http://wacapps.net/api/deviceinteraction"/>
-                <!-- TODO update with finished plugins during commercialization -->
-             </rdf:Bag>
-        </wrt:WRT-WAC-APIs>
-        <wrt:WRT-Viewmodes>
-            <rdf:Bag>
-                <rdf:li rdf:resource="fullscreen"/>
-             </rdf:Bag>
-        </wrt:WRT-Viewmodes>
-        <wrt:WRT-BackgroundExecution>Yes</wrt:WRT-BackgroundExecution>
-        <wrt:WRT-ConcurrentExecution>Yes</wrt:WRT-ConcurrentExecution>
-        <wrt:WRT-IdleScreenDisplay>No</wrt:WRT-IdleScreenDisplay> <!-- TODO -->
-        <wrt:WRT-WidgetUpdate>Yes</wrt:WRT-WidgetUpdate> <!-- TODO -->
-        <wrt:WRT-HTML5Video>?</wrt:WRT-HTML5Video> <!-- TODO -->
-        <!-- TODO Audio/Video related:
-             WRT-VideoMIMEType, WRT-VideoAverageBitrate, WRT-VideoMaximumBitrate,
-             WRT-VideoHorizontalResolution, WRT-VideoVerticalResolution,
-             WRT-VideoTemporalResolution, WRT-VideoBufferSize, WRT-HTML5Audio,
-             WRT-AudioMIMEType, WRT-AudioAverageBitrate, WRT-AudioMaximumBitrate,
-             WRT-AudioBufferSize -->
-
-    </rdf:Description>
-    </prf:component>
-
-</rdf:Description>
-</rdf:RDF>
-
index 60d37eb..ff9025d 100644 (file)
@@ -1,7 +1,7 @@
 #git:framework/web/wrt
 Name:       wrt
 Summary:    web runtime
-Version:    0.8.264
+Version:    0.8.268
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 0969998..b9730aa 100755 (executable)
--- a/po/ar.po
+++ b/po/ar.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "إلغاء"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "السماح"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "جاري بدء التنزيل..."
 
index 879eb20..43d3c6d 100755 (executable)
--- a/po/az.po
+++ b/po/az.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Ləğv et"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "İcazə ver"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Yükləmə başladılır..."
 
index fd1e98e..1a80cd3 100755 (executable)
--- a/po/bg.po
+++ b/po/bg.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Отмени"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Разрешаване"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Начало на изтеглянето..."
 
index cb53731..e4853cf 100755 (executable)
--- a/po/ca.po
+++ b/po/ca.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancel·lar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permetre"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "S'està iniciant la descàrrega..."
 
index ee61f08..5acbf9d 100755 (executable)
--- a/po/cs.po
+++ b/po/cs.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Zrušit"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Povolit"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Spouští se stahování..."
 
index eb0f5e5..00dc78a 100755 (executable)
--- a/po/da.po
+++ b/po/da.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annullér"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Tillad"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Starter download..."
 
index 46347e2..654acd5 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Abbrechen"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Zulassen"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Download wird gestartet..."
 
index e9583c2..f962a0a 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Άκυρο"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Να επιτρέπεται"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Ξεκινά η λήψη..."
 
index ba60253..797e4fb 100755 (executable)
--- a/po/en.po
+++ b/po/en.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancel"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Allow"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Starting download..."
 
index ba60253..797e4fb 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancel"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Allow"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Starting download..."
 
index ba60253..797e4fb 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancel"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Allow"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Starting download..."
 
index bdefd9c..2223151 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Iniciando descarga..."
 
index eff1958..4d4d162 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Iniciando descarga..."
 
index 6977f48..c57850a 100755 (executable)
--- a/po/et.po
+++ b/po/et.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Tühista"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Luba"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Allalaadimise alustamine..."
 
index a31ba1f..2829c5b 100755 (executable)
--- a/po/eu.po
+++ b/po/eu.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Ezeztatu"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Onartu"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Deskarga hasten..."
 
index 7172eb3..279b471 100755 (executable)
--- a/po/fi.po
+++ b/po/fi.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Peruuta"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Salli"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Lataus käynnistetään..."
 
index fc92f1c..eee4eef 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annuler"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Autoriser"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Début du téléchargement..."
 
index f95b8ee..63035ec 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annuler"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Autoriser"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Début du téléchargement..."
 
index 6f692d2..26c61bb 100755 (executable)
--- a/po/ga.po
+++ b/po/ga.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cuir ar ceal"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Ceadaigh"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Ag tosú ar íoslódáil..."
 
index 910e3b6..b0c0d1c 100755 (executable)
--- a/po/gl.po
+++ b/po/gl.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Iniciando descarga..."
 
index 8070b20..d34649f 100755 (executable)
--- a/po/hi.po
+++ b/po/hi.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "रद्द"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "अनुमति दें"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "डाउनलोड शुरू कर रहे है..."
 
index f1a6d7f..b7a77ca 100755 (executable)
--- a/po/hr.po
+++ b/po/hr.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Prekid"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Dopusti"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Pokretanje skidanja..."
 
index e35ffed..2aa7191 100755 (executable)
--- a/po/hu.po
+++ b/po/hu.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Mégse"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Engedélyezés"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Letöltés indítása..."
 
index e5a43ea..4bf8355 100755 (executable)
--- a/po/hy.po
+++ b/po/hy.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Չեղարկել"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Թույլատրել"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Ներբեռնման մեկնարկում..."
 
index 1e1152d..cf9504b 100755 (executable)
--- a/po/is.po
+++ b/po/is.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Hætta við"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Leyfa"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Ræsi niðurhal..."
 
index b0390dd..857484e 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annulla"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Consenti"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Inizio download..."
 
index 674a085..0500302 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "キャンセル"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "許可する"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "ダウンロード開始..."
 
index baf980d..0533083 100755 (executable)
--- a/po/ka.po
+++ b/po/ka.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "გაუქმება"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "დართე ნება"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "იწყება ჩამოტვირთვა..."
 
index e4cc531..09f29c7 100755 (executable)
--- a/po/kk.po
+++ b/po/kk.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Тоқтату"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Рұқсат"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Жүктеу басталуда..."
 
index 0319104..76f7270 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "취소"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "허용"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "다운로드를 시작하는 중..."
 
index 391bc6c..9cd694e 100755 (executable)
--- a/po/lt.po
+++ b/po/lt.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Atšaukti"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Leisti"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Pradeda siųsti..."
 
index 39b2c8b..b3238af 100755 (executable)
--- a/po/lv.po
+++ b/po/lv.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Atcelt"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Atļaut"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Sāk lejupielādi..."
 
index fa9bbae..a183eb8 100755 (executable)
--- a/po/mk.po
+++ b/po/mk.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Откажи"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Дозволи"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Почнува преземање..."
 
index 34aa055..e427fae 100755 (executable)
--- a/po/nb.po
+++ b/po/nb.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Avbryt"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Tillat"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Starter nedlasting..."
 
index e1eefc8..adc5795 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Annuleren"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Toestaan"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Downloaden starten..."
 
index 9d22720..4bb3244 100755 (executable)
--- a/po/pl.po
+++ b/po/pl.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Anuluj"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Zezwalaj"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Rozpoczynanie pobierania..."
 
index aaba927..19638cc 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Iniciando download..."
 
index b186b71..d0cdb34 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Cancelar"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Permitir"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "A iniciar transferência..."
 
index a12b1b7..f202695 100755 (executable)
--- a/po/ro.po
+++ b/po/ro.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Anulare"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Se permite"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Se începe descărcarea..."
 
index 0f32248..0c2bd6c 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Отмена"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Разрешить"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Начало загрузки..."
 
index 706099b..b7082db 100755 (executable)
--- a/po/sk.po
+++ b/po/sk.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Zrušiť"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Povoliť"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Spúšťa sa sťahovanie..."
 
index 07a123f..e20aa34 100755 (executable)
--- a/po/sl.po
+++ b/po/sl.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Prekliči"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Dovoli"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Začenjam prenos ..."
 
index 3a10cfb..8427bcf 100755 (executable)
--- a/po/sr.po
+++ b/po/sr.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Poništi"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Dozvoli"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Počinje preuzimanje..."
 
index 45c7007..00279f1 100755 (executable)
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Avbryt"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Tillåt"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Startar hämtning..."
 
index 4d361f1..b3c9082 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "İptal"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "İzin ver"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "İndirme başlıyor..."
 
index 6b7f814..090b79b 100755 (executable)
--- a/po/uk.po
+++ b/po/uk.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Скасувати"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Дозволити"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Початок завантаження..."
 
index 2ebdec7..8f38a3f 100755 (executable)
--- a/po/uz.po
+++ b/po/uz.po
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "Bekor q."
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "Ruxsat"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "Yuklab olish boshlanmoqda..."
 
index 6cdfe18..9750e7d 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "取消"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "允许"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "正在开始下载..."
 
index 72fb14f..093a7bb 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "取消"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "允許"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "正在開始下載..."
 
index 6cdfe18..9750e7d 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "取消"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "允许"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "正在开始下载..."
 
index 77d9a7b..1b5739e 100755 (executable)
@@ -1,3 +1,9 @@
+msgid "IDS_BR_SK_CANCEL"
+msgstr "取消"
+
+msgid "IDS_BR_OPT_ALLOW"
+msgstr "允許"
+
 msgid "IDS_BR_POP_STARTING_DOWNLOAD_ING"
 msgstr "正在開始下載..."
 
index c94db97..82bc8d4 100755 (executable)
@@ -64,6 +64,8 @@ inline std::string replacePS(std::initializer_list<std::string> strs) {
 
 #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_CANCEL dgettext("wrt", "IDS_BR_SK_CANCEL")
+#define WRT_OPT_ALLOW dgettext("wrt", "IDS_BR_OPT_ALLOW")
 
 #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")
index bf3b643..eee82e6 100644 (file)
@@ -295,9 +295,7 @@ void handleUnknownScheme(const char* scheme, const char* uri)
 } // namespace
 
 namespace SchemeActionMap {
-bool HandleUri(const char* uri,
-               NavigationContext context,
-               WrtDB::AppType appType)
+bool HandleUri(const char* uri, NavigationContext context)
 {
     if (!uri) {
         LogError("wrong arguments passed");
@@ -323,17 +321,8 @@ bool HandleUri(const char* uri,
 
     LogDebug("Scheme type: " << type);
     LogDebug("Navigation context: " << context);
-    LogDebug("Application type: " << appType);
 
-    UriAction action;
-    switch (appType) {
-    case WrtDB::APP_TYPE_TIZENWEBAPP:
-        action = g_tizenActionMap[type][context];
-        break;
-    default:
-        LogError("Unsupported application type: " << type);
-        return false;
-    }
+    UriAction action = g_tizenActionMap[type][context];
 
     LogDebug("Uri action: " << action);
 
index 029d3e8..04973df 100644 (file)
 #define SCHEME_ACTION_MAP_H_
 
 #include "scheme_action_map_type.h"
-#include <dpl/wrt-dao-ro/common_dao_types.h>
 
 namespace ViewModule {
 namespace SchemeActionMap {
 bool HandleUri(const char* uri,
-               NavigationContext context,
-               WrtDB::AppType appType);
+               NavigationContext context);
 };
 } /* namespace ViewModule */
 #endif /* SCHEME_ACTION_MAP_H_ */
old mode 100644 (file)
new mode 100755 (executable)
index 63ee8c8..50f2fc4
@@ -92,39 +92,45 @@ Evas_Object* CertificateSupportUtil::createPopup(
     void* data)
 {
     LogDebug("createPopup");
-    Evas_Object* popup = elm_popup_add(window);
 
-    Evas_Object* label = elm_label_add(popup);
-    elm_object_style_set(label, "popup/default");
-    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, 0.0);
-    evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
-    evas_object_show(label);
+    Evas_Object* popup = elm_popup_add(window);
+    elm_object_style_set(popup, "popup/default");
+    evas_object_size_hint_weight_set(popup,
+                                     EVAS_HINT_EXPAND,
+                                     EVAS_HINT_EXPAND);
 
     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_weight_set(layout,
+                                     EVAS_HINT_EXPAND,
+                                     EVAS_HINT_EXPAND);
 
-    Evas_Object* check = elm_check_add(popup);
-    evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
-    evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    evas_object_show(check);
+    Evas_Object* scroller = elm_scroller_add(layout);
+    elm_scroller_policy_set(scroller,
+                            ELM_SCROLLER_POLICY_OFF,
+                            ELM_SCROLLER_POLICY_AUTO);
 
+    Evas_Object* label = elm_label_add(scroller);
+    elm_label_line_wrap_set(label, ELM_WRAP_WORD);
+    elm_object_text_set(label, bodyText);
+
+    Evas_Object* check = elm_check_add(scroller);
     elm_object_part_text_set(layout, "elm.text", checkText);
-    elm_object_part_content_set(layout, "elm.swallow.label", label);
     elm_object_part_content_set(layout, "elm.swallow.checkbox", check);
 
-    evas_object_show(layout);
+    elm_object_content_set(scroller, label);
+    elm_object_part_content_set(layout, "elm.swallow.label", scroller);
     elm_object_content_set(popup, layout);
+
     Evas_Object* btn1 = elm_button_add(popup);
-    elm_object_text_set(btn1, WRT_SK_YES);
+    elm_object_text_set(btn1, WRT_OPT_ALLOW);
     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_text_set(btn2, WRT_SK_NO);
+    elm_object_text_set(btn2, WRT_SK_CANCEL);
     elm_object_part_content_set(popup, "button2", btn2);
     evas_object_smart_callback_add(btn2, "clicked", buttonCallback, data);
+
     return popup;
 }
 
@@ -165,7 +171,7 @@ CertificateDB::Result CertificateSupportUtil::getResult(
     if (popup == NULL) {
         return RESULT_UNKNOWN;
     }
-    bool allow = !strcmp(WRT_SK_YES, elm_object_text_get(button));
+    bool allow = !strcmp(WRT_OPT_ALLOW, elm_object_text_get(button));
 
     // get check evas_object
     Evas_Object* check = getCheck(popup);
index 1d3b95a..8feecf1 100644 (file)
@@ -58,7 +58,9 @@ SET(VIEW_MODULE_SOURCES
     ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_scheme_support.cpp
     ${PROJECT_SOURCE_DIR}/src/view/webkit/view_logic_user_agent_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}
 )
index 77d689e..abb702f 100644 (file)
@@ -61,7 +61,9 @@
 #include <view_logic_scheme_support.h>
 #include <view_logic_user_agent_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 <EWebKit2.h>
@@ -102,7 +104,6 @@ std::map<const std::string,
          const Evas_Smart_Cb> ViewLogic::m_ewkCallbacksMap = {
     { "load,started", &ViewLogic::loadStartedCallback },
     { "load,finished", &ViewLogic::loadFinishedCallback },
-    { "title,changed", &ViewLogic::titleChangedCallback },
     { "load,progress,started", &ViewLogic::loadProgressStartedCallback },
     { "load,progress", &ViewLogic::loadProgressCallback },
     { "load,progress,finished", &ViewLogic::loadProgressFinishedCallback },
@@ -192,7 +193,8 @@ ViewLogic::ViewLogic() :
     m_orientationThresholdTimer(NULL),
     m_isPopupReplyWait(false),
     m_appsSupport(new ViewModule::AppsSupport()),
-    m_vibrationSupport(new ViewModule::VibrationSupport())
+    m_vibrationSupport(new ViewModule::VibrationSupport()),
+    m_webNotificationSupport(new ViewModule::WebNotificationSupport())
 {
     ApplicationLauncherSingleton::Instance().Touch();
 }
@@ -240,7 +242,6 @@ void ViewLogic::prepareView(WidgetModel* m, const std::string &startUrl)
     Assert(NULL != m_ewkContext);
     Assert(m_window);
 
-
     ADD_PROFILING_POINT("initializeSupport", "start");
     initializeSupport();
     ADD_PROFILING_POINT("initializeSupport", "stop");
@@ -278,6 +279,7 @@ void ViewLogic::hideWidget()
     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()) {
@@ -554,9 +556,10 @@ void ViewLogic::checkAsyncMessageFromBundle(const char* name, const char* body)
     } else if (!strcmp(name, IPCMessageSupport::TIZEN_EXIT) ||
                !strcmp(name, IPCMessageSupport::TIZEN_HIDE))
     {
-        bool ret = m_schemeSupport->HandleTizenScheme(name,
-                                                      m_window,
-                                                      m_currentEwkView);
+        bool ret =
+            ViewModule::SchemeSupport::HandleTizenScheme(name,
+                                                         m_window,
+                                                         m_currentEwkView);
         if (ret == false) {
             _E("Fail to handle tizen scheme %s", name);
         }
@@ -593,20 +596,19 @@ void ViewLogic::initializeSupport()
         == BackgroundSupport_Enable)
     {
         LogDebug("Background support enabled, set process active");
-        pid_t pid = getpid();
-        sysman_inform_active(pid);
+        sysman_inform_active(getpid());
         m_isBackgroundSupport = true;
     }
     system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE,
                                    systemSettingsChangedCallback,
                                    this);
 
-    m_schemeSupport.reset(new SchemeSupport(m_model->Type.Get().appType));
     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_vibrationSupport->initialize();
+    m_webNotificationSupport->initialize(m_model->TzPkgId.Get());
 }
 
 void ViewLogic::initializePluginLoading()
@@ -927,39 +929,6 @@ void ViewLogic::loadFinishedCallback(
     }
 }
 
-void ViewLogic::titleChangedCallback(
-    void* data,
-    Evas_Object* obj,
-    void* eventInfo)
-{
-    LogDebug("titleChangedCallback called");
-    Assert(data);
-    ViewLogic* This = static_cast<ViewLogic*>(data);
-    Assert(eventInfo);
-    const char* title = static_cast<char*>(eventInfo);
-
-    if (0 == strlen(title)) {
-        LogDebug("title data is empty");
-        This->m_currentTitle = std::string();
-        return;
-    }
-    LogDebug("Title = [" << title << "]");
-    bool ret = This->m_schemeSupport->HandleTizenScheme(
-                                             title,
-                                             This->m_window,
-                                             This->m_currentEwkView);
-    // if result is true, this is tizen scheme
-    // and then, title is reset to page's real title
-    if (ret) {
-        std::string script = "document.title = \"";
-        script += This->m_currentTitle;
-        script +="\";";
-        ewk_view_script_execute(obj, script.c_str(), didRunJavaScriptCallback, This);
-    } else {
-        This->m_currentTitle = std::string(title);
-    }
-}
-
 void ViewLogic::loadProgressStartedCallback(
     void* data,
     Evas_Object* /*obj*/,
@@ -1112,11 +1081,10 @@ void ViewLogic::policyNavigationDecideCallback(
         }
     }
 
-    if (This->m_schemeSupport->filterURIByScheme(policyDecision,
-                                                 false,
-                                                 This->m_model,
-                                                 This->m_window,
-                                                 This->m_currentEwkView))
+    if (ViewModule::SchemeSupport::filterURIByScheme(policyDecision,
+                                                     false,
+                                                     This->m_window,
+                                                     This->m_currentEwkView))
     {
         LogDebug("use");
         ewk_policy_decision_use(policyDecision);
@@ -1175,11 +1143,10 @@ void ViewLogic::policyNewWindowDecideCallback(
         }
     }
 
-    if (This->m_schemeSupport->filterURIByScheme(policyDecision,
-                                                 true,
-                                                 This->m_model,
-                                                 This->m_window,
-                                                 This->m_currentEwkView))
+    if (ViewModule::SchemeSupport::filterURIByScheme(policyDecision,
+                                                     true,
+                                                     This->m_window,
+                                                     This->m_currentEwkView))
     {
         ewk_policy_decision_use(policyDecision);
     } else {
@@ -1335,49 +1302,44 @@ void ViewLogic::notificationShowCallback(
     Evas_Object* /*obj*/,
     void* eventInfo)
 {
-    LogDebug("notificationShowCallback called");
-    Assert(data);
-    ViewLogic* This = static_cast<ViewLogic*>(data);
-
     Assert(eventInfo);
-    Ewk_Notification* noti = static_cast<Ewk_Notification*>(eventInfo);
+    Ewk_Notification* ewkNotification =
+        static_cast<Ewk_Notification*>(eventInfo);
+    ViewModule::WebNotificationDataPtr notiData(
+        new ViewModule::WebNotificationData(ewkNotification));
 
-    using namespace ViewModule::WebNotification;
+    _D("notification id : %u", notiData->getEwkNotiId());
+    _D("notification iconURL : %s", notiData->getIconUrl());
+    _D("notification title : %s", notiData->getTitle());
+    _D("notification body : %s", notiData->getBody());
 
-    WebNotificationDataPtr notiData(
-        new WebNotificationData(
-            This->m_model,
-            ewk_notification_id_get(noti)));
-
-    DPL::OptionalString string =
-        DPL::FromUTF8String(ewk_notification_icon_url_get(noti));
-    if (!string.IsNull()) {
-        notiData->m_iconURL = DPL::ToUTF8String(*string);
-    }
-    string = DPL::FromUTF8String(ewk_notification_title_get(noti));
-    if (!string.IsNull()) {
-        notiData->m_title = DPL::ToUTF8String(*string);
-    }
-    string = DPL::FromUTF8String(ewk_notification_body_get(noti));
-    if (!string.IsNull()) {
-        notiData->m_body = DPL::ToUTF8String(*string);
+    Assert(data);
+    ViewLogic* This = static_cast<ViewLogic*>(data);
+    if (This->m_webNotificationSupport->show(notiData)) {
+        ewk_notification_showed(This->m_ewkContext, notiData->getEwkNotiId());
     }
-
-    LogDebug("notification id : " << notiData->m_id);
-    LogDebug("notification iconURL : " << notiData->m_iconURL);
-    LogDebug("notification title : " << notiData->m_title);
-    LogDebug("notification body : " << notiData->m_body);
-
-    showWebNotification(notiData);
-    ewk_notification_showed(This->m_ewkContext, ewk_notification_id_get(noti));
 }
 
 void ViewLogic::notificationCancelCallback(
-    void* /*data*/,
-    Evas_Object* /*obj*/,
-    void* /*eventInfo*/)
+    void* data,
+    Evas_Object* obj,
+    void* eventInfo)
 {
-    LogDebug("notificationCancelCallback called");
+    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);
+    }
 }
 
 void ViewLogic::notificationPermissionRequestCallback(
@@ -1388,17 +1350,9 @@ void ViewLogic::notificationPermissionRequestCallback(
     LogDebug("notificationPermissionRequestCallback called");
     Assert(data);
     ViewLogic* This = static_cast<ViewLogic*>(data);
-    if (This->m_model->WebNotificationUsage.Get() == WrtDB::SETTINGS_TYPE_OFF) {
-        Ewk_Notification_Permission_Request* request =
-            static_cast<Ewk_Notification_Permission_Request*>(eventInfo);
-        ewk_notification_permission_request_set(
-            request,
-            EINA_FALSE);
-        return;
-    }
 
     Assert(eventInfo);
-    ViewModule::WebNotification::webNotificationPermissionRequest(
+    ViewModule::WebNotificationPermissionSupport::permissionRequest(
         This->m_currentEwkView,
         This->m_securityOriginSupport->getSecurityOriginDAO(),
         eventInfo);
index 739be86..06173b2 100644 (file)
 
 #include <EWebKit2.h>
 
-class SchemeSupport;
 namespace ViewModule {
 class SecurityOriginSupport;
 class CertificateSupport;
+class WebNotificationSupport;
 }
 
 class ViewLogic : public ViewModule::IViewModule
@@ -100,10 +100,6 @@ class ViewLogic : public ViewModule::IViewModule
         void* data,
         Evas_Object* obj,
         void* eventInfo);
-    static void titleChangedCallback(
-        void* data,
-        Evas_Object* obj,
-        void* eventInfo);
     static void loadProgressStartedCallback(
         void* data,
         Evas_Object* obj,
@@ -308,7 +304,6 @@ class ViewLogic : public ViewModule::IViewModule
     Evas_Object* m_window;
     WidgetModel* m_model;
     std::string m_blockedUri;
-    std::string m_currentTitle;
     std::string m_theme;
     std::string m_startUrl;
     WRT::UserDelegatesPtr m_cbs;
@@ -321,11 +316,11 @@ class ViewLogic : public ViewModule::IViewModule
     Ecore_Timer* m_orientationThresholdTimer;
     bool m_isPopupReplyWait;
 
-    std::unique_ptr<SchemeSupport> m_schemeSupport;
     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::WebNotificationSupport> m_webNotificationSupport;
 
     static std::map<const std::string, const Evas_Smart_Cb> m_ewkCallbacksMap;
 };
index 2469c46..b1f680d 100644 (file)
 
 #include "view_logic_scheme_support.h"
 
-#include <appcore-common.h>
-#include <dpl/log/log.h>
-#include <widget_model.h>
+#include <dpl/assert.h>
+#include <dpl/log/secure_log.h>
 #include <common/scheme_action_map.h>
+#include <Elementary.h>
 #include <EWebKit2.h>
 
+namespace ViewModule {
 namespace {
 char const * const TIZEN_SCHEME = "tizen";
 char const * const TIZEN_EXIT = "tizen://exit";
@@ -40,48 +41,38 @@ static Eina_Bool exitAppIdlerCallback(void* /*data*/)
 }
 } // namespace
 
-bool SchemeSupport::HandleUri(
-    const char* uri,
-    ViewModule::SchemeActionMap::NavigationContext context)
-{
-    return ViewModule::SchemeActionMap::HandleUri(uri,
-                                                  context,
-                                                  m_type);
-}
-
 bool SchemeSupport::HandleTizenScheme(const char* uri,
                                       Evas_Object* window,
                                       Evas_Object* wkView)
 {
-    LogDebug("HandleTizenScheme called");
     if (!uri) {
-        LogError("Empty uri");
+        _W("Empty uri");
         return false;
     }
     if (!window) {
-        LogError("Empty window data");
+        _W("Empty window data");
         return false;
     }
 
     if (strncmp(uri, TIZEN_EXIT, strlen(TIZEN_EXIT)) == 0) {
-        LogDebug("Tizen scheme: " << uri << " exit");
+        _D("%s : exit", uri);
         ecore_idler_add(exitAppIdlerCallback, NULL);
         return true;
     } else if (strncmp(uri, TIZEN_HIDE, strlen(TIZEN_HIDE)) == 0) {
-        LogDebug("Tizen scheme: " << uri << " hide");
+        _D("%s : hide", uri);
         elm_win_lower(window);
         return true;
     } else if (strncmp(uri,
                        TIZEN_CHANGE_USERAGNET,
                        strlen(TIZEN_CHANGE_USERAGNET)) == 0)
     {
-        LogDebug("Tizen scheme: " << uri << " change UA");
+        _D("%s : change UA", uri);
         const char* userAgentString = strstr(uri, "=");
         if (NULL == userAgentString) {
-            LogDebug("UA string is NULL");
+            _W("UA string is NULL");
         } else {
             userAgentString++;
-            LogDebug("Setting custom user agent as: " << userAgentString);
+            _D("Setting custom user agent as: %s", userAgentString);
             ewk_view_user_agent_set(wkView, userAgentString);
         }
         return true;
@@ -91,13 +82,11 @@ bool SchemeSupport::HandleTizenScheme(const char* uri,
 
 bool SchemeSupport::filterURIByScheme(Ewk_Policy_Decision* policyDecision,
                                       bool newWindow,
-                                      WidgetModel* model,
                                       Evas_Object* window,
                                       Evas_Object* wkView)
 {
-    LogDebug("filterURIByScheme called");
+    _D("called");
     Assert(policyDecision);
-    Assert(model);
 
     const char* url = ewk_policy_decision_url_get(policyDecision);
     if (NULL == url) {
@@ -111,23 +100,20 @@ bool SchemeSupport::filterURIByScheme(Ewk_Policy_Decision* policyDecision,
 
     using namespace ViewModule::SchemeActionMap;
     if (HandleTizenScheme(url, window, wkView)) {
-        LogDebug("Scheme is tizen scheme");
+        _D("Scheme is tizen scheme");
         return false;
     }
 
     NavigationContext ctx;
     ctx = (mainFrame ? TOP_LEVEL : FRAME_LEVEL);
     if (newWindow) {
-        if (model->Type.Get().appType ==
-            WrtDB::APP_TYPE_TIZENWEBAPP)
-        {
-            // In case of Tizen,
-            // policy of new window should be applied,
-            // regardless level of this frame
-            ctx = NEW_WINDOW;
-        }
+        // In case of Tizen,
+        // policy of new window should be applied,
+        // regardless level of this frame
+        ctx = NEW_WINDOW;
     }
 
-    return HandleUri(url, ctx);
+    return SchemeActionMap::HandleUri(url, ctx);
 }
+} // namespace ViewModule
 
index 73a9560..f93dca6 100644 (file)
  * @version    1.0
  */
 
-#ifndef SCHEME_SUPPORT_H_
-#define SCHEME_SUPPORT_H_
+#ifndef VIEW_LOGIC_SCHEME_SUPPORT_H_
+#define VIEW_LOGIC_SCHEME_SUPPORT_H_
 
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-#include <common/scheme_action_map.h>
-#include <common/evas_object.h>
+#include <Elementary.h>
 #include <EWebKit2.h>
+#include <common/scheme_action_map.h>
 
-class WindowData;
-class WidgetModel;
-
-class SchemeSupport
-{
-  public:
-    explicit SchemeSupport(WrtDB::AppType type) : m_type(type) {}
-    bool HandleTizenScheme(const char* uri,
-                           Evas_Object* window,
-                           Evas_Object* wkView);
-    bool HandleUri(const char* uri,
-                   ViewModule::SchemeActionMap::NavigationContext context);
-
-    bool filterURIByScheme(Ewk_Policy_Decision* policyDecision,
-                           bool newWindow,
-                           WidgetModel* model,
-                           Evas_Object* window,
-                           Evas_Object* wkView);
-
-  private:
-    WrtDB::AppType m_type;
-};
-
-#endif /* SCHEME_SUPPORT_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_web_notification_data.cpp b/src/view/webkit/view_logic_web_notification_data.cpp
new file mode 100644 (file)
index 0000000..8814a7f
--- /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    view_logic_web_notification_data.cpp
+ * @author  Jihoon Chung (jihoon.chung@samsung.com)
+ *
+ */
+
+#include "view_logic_web_notification_data.h"
+
+#include <stdint.h>
+#include <EWebKit2.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..b5e195f
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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 <EWebKit2.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..aade0fa
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * 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/secure_log.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_security_origin_support.h>
+
+#include <app.h>
+#include <EWebKit2.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);
+static void popupCallback(void* data, Evas_Object* obj, void* eventInfo);
+
+bool askUserPermission(Evas_Object* parent, PermissionData* data)
+{
+    _D("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,
+                                     popupCallback,
+                                     data);
+    if (popup == NULL) {
+        delete data;
+        return false;
+    } else {
+        evas_object_show(popup);
+    }
+    return true;
+}
+
+void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/)
+{
+    LogDebug("called");
+    Assert(data);
+    PermissionData* permData = static_cast<PermissionData*>(data);
+    Ewk_Notification_Permission_Request* request =
+        static_cast<Ewk_Notification_Permission_Request*>(permData->m_data);
+
+    Evas_Object* popup = getPopup(obj);
+    Result result = getResult(obj);
+
+    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;
+    ewk_notification_permission_request_set(request, ret);
+    delete permData;
+    evas_object_hide(popup);
+    evas_object_del(popup);
+}
+} // 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) {
+        _D("allow");
+        ewk_notification_permission_request_set(request, EINA_TRUE);
+        return;
+    } else if (RESULT_DENY_ONCE == result || RESULT_DENY_ALWAYS == result) {
+        _D("deny");
+        ewk_notification_permission_request_set(request, EINA_FALSE);
+        return;
+    }
+
+    // ask to user
+    PermissionData* permissionData =
+        new PermissionData(securityOriginDAO,
+                           securityOriginData,
+                           request);
+
+    // suspend notification
+    ewk_notification_permission_request_suspend(request);
+    if (!askUserPermission(parent, permissionData)) {
+        _W("Fail to create user permission popup");
+        ewk_notification_permission_request_set(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_
+
index 9300391..1cda2c6 100644 (file)
  */
 
 #include "view_logic_web_notification_support.h"
+#include "view_logic_web_notification_data.h"
+
+#include <stdint.h>
 #include <string>
-#include <dpl/log/log.h>
-#include <dpl/string.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_security_origin_support.h>
+#include <map>
+#include <dpl/log/secure_log.h>
+#include <dpl/assert.h>
+#include <dpl/exception.h>
+#include <dpl/wrt-dao-ro/widget_config.h>
 
 #include <notification.h>
 #include <pcrecpp.h>
 #include <sstream>
 #include <curl/curl.h>
-#include <widget_model.h>
-#include <EWebKit2.h>
-#include <widget_string.h>
 
+namespace ViewModule {
 namespace {
 const char* PATTERN_CHECK_EXTERNAL = "^http(s)?://\\w+.*$";
-}
-
-namespace ViewModule {
-namespace WebNotification {
-using namespace SecurityOriginDB;
-using namespace ViewModule::SecurityOriginSupportUtil;
-
-bool notificationShow(WebNotificationDataPtr notiData);
-bool notificationHide(WebNotificationDataPtr notiData);
-bool isExternalUri(const std::string &pattern, const std::string &uri);
-bool downloadImage(WebNotificationDataPtr notiData);
-size_t curlWriteData(void *ptr, size_t size, size_t nmemb, FILE *stream);
-void askUserForWebNotificationPermission(
-    Evas_Object* window,
-    PermissionData* data);
-static void popupCallback(void* data, Evas_Object* obj, void* eventInfo);
-
-WebNotificationData::WebNotificationData(WidgetModel* widgetModel,
-                                         uint64_t id) :
-    m_widgetModel(widgetModel),
-    m_id(id)
-{
-    Assert(m_widgetModel);
-}
 
-WebNotificationData::~WebNotificationData()
-{}
+// Function declare
+bool isExternalUri(const std::string &uri);
+size_t curlWriteData(void* ptr, size_t size, size_t nmemb, FILE* stream);
 
-void webNotificationPermissionRequest(
-    Evas_Object* window,
-    SecurityOriginDAO* securityOriginDAO,
-    void* data)
+bool isExternalUri(const std::string &uri)
 {
-    LogDebug("permissionRequest called");
-    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) {
-        LogDebug("allow");
-        ewk_notification_permission_request_set(request, EINA_TRUE);
-        return;
-    } else if (RESULT_DENY_ONCE == result || RESULT_DENY_ALWAYS == result) {
-        LogDebug("deny");
-        ewk_notification_permission_request_set(request, EINA_FALSE);
-        return;
-    }
-
-    // ask to user
-    PermissionData* permissionData =
-        new PermissionData(securityOriginDAO,
-                           securityOriginData,
-                           request);
+    pcrecpp::RE_Options pcreOpt;
+    pcreOpt.set_caseless(true);
+    pcrecpp::RE re(PATTERN_CHECK_EXTERNAL, pcreOpt);
 
-    // suspend notification
-    ewk_notification_permission_request_suspend(request);
-    askUserForWebNotificationPermission(window, permissionData);
-    return;
+    return re.FullMatch(uri);
 }
 
-bool showWebNotification(WebNotificationDataPtr notiData)
+size_t curlWriteData(void* ptr, size_t size, size_t nmemb, FILE* stream)
 {
-    LogDebug("showWebNotification called");
-
-    /* TODO : register notification to database */
-    return notificationShow(notiData);
+    size_t written = fwrite(ptr, size, nmemb, stream);
+    return written;
 }
+} // anonymous namespace
 
-bool notificationShow(WebNotificationDataPtr notiData)
+// Implementation class
+class WebNotificationSupportImplementation
 {
-    LogDebug("notificationShow called");
-    Assert(notiData);
-    notification_h noti_h = NULL;
-    notification_error_e error = NOTIFICATION_ERROR_NONE;
-
-    Try {
-        // create notification
-        noti_h = notification_new(
-                NOTIFICATION_TYPE_NOTI,
-                NOTIFICATION_GROUP_ID_NONE,
-                notiData->m_id);
-        if (!noti_h) {
-            LogError("Fail to notification_new");
-            return false;
+  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);
+        _D("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());
         }
 
-        // set notification title
-        error = notification_set_text(
-                noti_h,
-                NOTIFICATION_TEXT_TYPE_TITLE,
-                notiData->m_title.c_str(),
-                NULL,
-                NOTIFICATION_VARIABLE_TYPE_NONE);
-        if (error != NOTIFICATION_ERROR_NONE) {
-            ThrowMsg(Exception::NotificationShowError, "Fail to set title");
-        }
+        downloadPath += rename;
+        _D("Valid file path : %s", downloadPath.c_str());
+        return downloadPath;
+    }
 
-        // set notification content
-        error = notification_set_text(
-                noti_h,
-                NOTIFICATION_TEXT_TYPE_CONTENT,
-                notiData->m_body.c_str(),
-                NULL,
-                NOTIFICATION_VARIABLE_TYPE_NONE);
-        if (error != NOTIFICATION_ERROR_NONE) {
-            ThrowMsg(Exception::NotificationShowError,
-                     "Fail to set content:" << error);
+    std::string downloadImage(const std::string& iconUrl)
+    {
+        if (iconUrl.empty()) {
+            _W("Icon url is empty");
+            return std::string();
         }
+        std::string downloadPath = createDownloadPath(iconUrl);
 
-        //check uri is "http", https" or not
-        bool validIconURL = true;
-        LogDebug("url path is " << notiData->m_iconURL);
-        if (isExternalUri(PATTERN_CHECK_EXTERNAL, notiData->m_iconURL)) {
-            //download image from url
-            validIconURL = downloadImage(notiData);
+        // Download image by curl
+        FILE *fp = NULL;
+        CURL *curl = NULL;
+
+        Try {
+            curl = curl_easy_init();
+            if (NULL == curl) {
+                _W("fail to curl_easy_init");
+                Throw(Exception::InitError);
+            }
+            fp = fopen(downloadPath.c_str(), "wb");
+            if (fp == NULL) {
+                _W("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) {
+                _W("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();
         }
+        _D("Download success");
+        return downloadPath;
+    }
 
-        //set image
-        // If fail to download external image, skip to set image.
-        // In this case, set to default package image.
-        if (true == validIconURL) {
-            error = notification_set_image(
+    int showNotification(WebNotificationDataPtr notiData)
+    {
+        Assert(notiData);
+        notification_h noti_h = NULL;
+        notification_error_e 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) {
+                _E("Fail to notification_new");
+                Throw(Exception::NotificationShowError);
+            }
+
+            // set notification title
+            error = notification_set_text(
                     noti_h,
-                    NOTIFICATION_IMAGE_TYPE_ICON,
-                    notiData->m_iconURL.c_str());
+                    NOTIFICATION_TEXT_TYPE_TITLE,
+                    notiData->getTitle(),
+                    NULL,
+                    NOTIFICATION_VARIABLE_TYPE_NONE);
             if (error != NOTIFICATION_ERROR_NONE) {
-                ThrowMsg(Exception::NotificationShowError,
-                         "Fail to free notification: " << error);
+                _E("Fail to set title");
+                Throw(Exception::NotificationShowError);
             }
-        }
 
-        // insert notification
-        int priv_id = NOTIFICATION_PRIV_ID_NONE;
-        error = notification_insert(noti_h, &priv_id);
-        if (error != NOTIFICATION_ERROR_NONE) {
-            ThrowMsg(Exception::NotificationShowError,
-                     "Fail to insert notification: " << error);
-        }
+            // 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) {
+                _E("Fail to set content: %d", error);
+                Throw(Exception::NotificationShowError);
+            }
 
-        LogDebug("Notification is inserted!");
-        LogDebug("noti id =[" << notiData->m_id << "] " <<
-                "priv_id =[" << priv_id << "]");
+            //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) {
+                        _E("Fail to free notification: %d", error);
+                        Throw(Exception::NotificationShowError);
+                    }
+                }
+            }
 
-        if (noti_h) {
-            error = notification_free(noti_h);
+            // insert notification
+            int privId = NOTIFICATION_PRIV_ID_NONE;
+            error = notification_insert(noti_h, &privId);
             if (error != NOTIFICATION_ERROR_NONE) {
-                ThrowMsg(Exception::NotificationShowError,
-                         "Fail to free notification: " << error);
+                _E("Fail to insert notification : %d", error);
+                Throw(Exception::NotificationShowError);
             }
+            _D("ewkId=[%u], notiId=[%d]", notiData->getEwkNotiId(), privId);
+
+            if (noti_h) {
+                error = notification_free(noti_h);
+                if (error != NOTIFICATION_ERROR_NONE) {
+                    _E("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) {
+            _E("Fail to show notification");
+            return false;
         }
         return true;
-    } Catch(Exception::NotificationShowError) {
-        LogError(_rethrown_exception.GetMessage());
-        notification_free(noti_h);
-        noti_h = NULL;
-        return false;
-    } Catch(DPL::Exception) {
-        LogError(_rethrown_exception.GetMessage());
-        return false;
     }
-}
 
-bool notificationHide(WebNotificationDataPtr notiData)
-{
-    LogDebug("notificationHide called");
+    bool hideNotification(uint64_t ewkNotiId)
+    {
+        notification_error_e 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) {
+            _D("Success to hide");
+            return true;
+        } else if (error == NOTIFICATION_ERROR_NOT_EXIST_ID) {
+            _D("Success to hide. Not exist noti");
+            return true;
+        } else {
+            _W("Error to hide : %d", error);
+            return false;
+        }
+    }
 
-    Assert(notiData);
-    return true;
-}
+    // manage noti data
+    bool isExistData(uint64_t ewkNotiId)
+    {
+        if (m_notiDataMap.find(ewkNotiId) == m_notiDataMap.end()) {
+            return false;
+        }
+        return true;
+    }
 
-bool isExternalUri(const std::string &pattern, const std::string &uri)
-{
-    LogDebug("isExternalUri called");
+    void insertData(WebNotificationDataPtr notiData)
+    {
+        m_notiDataMap[notiData->getEwkNotiId()] = notiData;
+    }
 
-    pcrecpp::RE_Options pcreOpt;
-    pcreOpt.set_caseless(true);
-    pcrecpp::RE re(pattern, pcreOpt);
+    void removeData(uint64_t ewkNotiId)
+    {
+        m_notiDataMap.erase(ewkNotiId);
+    }
 
-    return re.FullMatch(uri);
-}
+    WebNotificationDataPtr getData(uint64_t ewkNotiId)
+    {
+        return m_notiDataMap.find(ewkNotiId)->second;
+    }
 
-bool downloadImage(WebNotificationDataPtr notiData)
-{
-    LogDebug("downloadImage called");
-
-    Assert(notiData);
-    // download path is
-    // /opt/apps/tizen_id/data + '/' + filename
-    std::string downloadPath =
-        DPL::ToUTF8String(
-            notiData->m_widgetModel->PersistentStoragePath.Get()) + "/";
-    LogDebug("downloadPath " << downloadPath);
-
-    // Make valid filename
-    // If there is already exist filename, rename to "filename_%d"
-    std::string fileName =
-        notiData->m_iconURL.substr(notiData->m_iconURL.rfind('/') + 1);
-    LogDebug("fileName from URL: " << fileName);
-    std::string rename = fileName;
-    unsigned int renameSuffixNb = 0;
-    while (0 == access((downloadPath + rename).c_str(), F_OK)) {
-        std::ostringstream suffixOstr;
-        suffixOstr.str("");
-        suffixOstr << fileName << "_" << renameSuffixNb++;
-
-        rename = fileName;
-        rename.insert(rename.find('.'), suffixOstr.str());
+  public:
+    WebNotificationSupportImplementation() :
+        m_initialized(false)
+    {
     }
 
-    downloadPath += rename;
-    LogDebug("Valid file path : " << downloadPath);
+    void initialize(WrtDB::TizenPkgId pkgId)
+    {
+        // icon download path
+        // /opt/apps/tizen_id/data + '/' + filename
+        m_persistentPath =
+            WrtDB::WidgetConfig::GetWidgetPersistentStoragePath(pkgId) + '/';
+        _D("path %s", m_persistentPath.c_str());
+        m_initialized = true;
+    }
 
-    // Download image by curl
-    FILE *fp = NULL;
-    CURL *curl = NULL;
+    void deinitialize(void)
+    {
+        _D("called");
+        m_initialized = false;
+    }
 
-    Try {
-        curl = curl_easy_init();
-        if (NULL == curl) {
-            ThrowMsg(Exception::InitError, "fail to curl_easy_init");
+    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());
         }
-
-        fp = fopen(downloadPath.c_str(), "wb");
-        if (fp == NULL) {
-            ThrowMsg(Exception::InitError, "fail to open");
+        if (showNotification(notiData)) {
+            insertData(notiData);
+            return true;
         }
+        return false;
+    }
 
-        curl_easy_setopt(curl, CURLOPT_URL, notiData->m_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) {
-            ThrowMsg(Exception::DownloadImageError,
-                     "fail to curl_easy_perform: " << err);
+    void* hide(uint64_t ewkNotiId)
+    {
+        Assert(m_initialized);
+        if (!isExistData(ewkNotiId)) {
+            _W("Noti isn't exist");
+            return NULL;
         }
-        fclose(fp);
-        curl_easy_cleanup(curl);
-    } Catch(DPL::Exception) {
-        LogError(_rethrown_exception.GetMessage());
-        fclose(fp);
-        curl_easy_cleanup(curl);
-        return false;
+        if (!hideNotification(ewkNotiId)) {
+            return NULL;
+        }
+        WebNotificationDataPtr data = getData(ewkNotiId);
+        removeData(ewkNotiId);
+        return static_cast<void*>(data->getData());
     }
+};
 
-    LogDebug("Download success.. downloadedImgPath: " << downloadPath);
-    notiData->m_iconURL = downloadPath;
-    return true;
+WebNotificationSupport::WebNotificationSupport() :
+    m_impl(new WebNotificationSupportImplementation())
+{
 }
 
-size_t curlWriteData(void *ptr, size_t size, size_t nmemb, FILE *stream)
+WebNotificationSupport::~WebNotificationSupport()
 {
-    size_t written = fwrite(ptr, size, nmemb, stream);
-    return written;
 }
 
-void askUserForWebNotificationPermission(
-    Evas_Object* window,
-    PermissionData* data)
+void WebNotificationSupport::initialize(WrtDB::TizenAppId appId)
 {
-    LogDebug("askUserForWebNotificationPermission 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";
-    }
+    m_impl->initialize(appId);
+}
 
-    std::string body =
-        WrtText::replacePS({WRT_POP_WEB_NOTIFICATION_PERMISSION,
-                           appname,
-                           origin});
-    Evas_Object* popup = createPopup(window,
-                                     body.c_str(),
-                                     WRT_BODY_REMEMBER_PREFERENCE,
-                                     popupCallback,
-                                     data);
-    if (popup == NULL) {
-        LogError("Fail to create popup object");
-        delete data;
-        return;
-    } else {
-        evas_object_show(popup);
-    }
+void WebNotificationSupport::deinitialize(void)
+{
+    m_impl->deinitialize();
 }
 
-void popupCallback(void* data, Evas_Object* obj, void* /*eventInfo*/)
+bool WebNotificationSupport::show(WebNotificationDataPtr notiData)
 {
-    LogDebug("popupCallback");
-    Assert(data);
-    PermissionData* permData = static_cast<PermissionData*>(data);
-    Ewk_Notification_Permission_Request* request =
-        static_cast<Ewk_Notification_Permission_Request*>(permData->m_data);
-
-    Evas_Object* popup = getPopup(obj);
-    Result result = getResult(obj);
-
-    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;
-    ewk_notification_permission_request_set(request, ret);
-    delete permData;
-    evas_object_hide(popup);
-    evas_object_del(popup);
+    return m_impl->show(notiData);
+}
+
+void* WebNotificationSupport::hide(uint64_t ewkNotiId)
+{
+    return m_impl->hide(ewkNotiId);
 }
-} // namespace WebNotification
 } //namespace ViewModule
index 74c0d17..893e771 100644 (file)
 #define VIEW_LOGIC_WEB_NOTIFICATION_SUPPORT_H_
 
 #include <memory>
-#include <stdint.h>
-#include <Elementary.h>
-#include <dpl/exception.h>
-
-//Forward declarations
-class WidgetModel;
-namespace SecurityOriginDB {
-class SecurityOriginDAO;
-}
+#include <dpl/wrt-dao-ro/common_dao_types.h>
+#include "view_logic_web_notification_data.h"
 
 namespace ViewModule {
-namespace WebNotification {
-class WebNotificationData
+class WebNotificationSupportImplementation;
+class WebNotificationSupport
 {
   public:
-    WebNotificationData(WidgetModel* widgetModel, uint64_t id);
-    virtual ~WebNotificationData();
-
-    WidgetModel* m_widgetModel;
-    uint64_t m_id;
-    std::string m_iconURL;
-    std::string m_title;
-    std::string m_body;
-    std::string m_url;
-};
+    WebNotificationSupport();
+    virtual ~WebNotificationSupport();
+    void initialize(WrtDB::TizenPkgId pkgId);
+    void deinitialize(void);
 
-typedef std::shared_ptr<WebNotificationData> WebNotificationDataPtr;
+    bool show(WebNotificationDataPtr notiData);
+    void* hide(uint64_t ewkNotiId);
 
-class Exception
-{
-  public:
-    DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
-    DECLARE_EXCEPTION_TYPE(Base, InitError)
-    DECLARE_EXCEPTION_TYPE(Base, NotificationShowError)
-    DECLARE_EXCEPTION_TYPE(Base, DownloadImageError)
+  private:
+    std::unique_ptr<WebNotificationSupportImplementation> m_impl;
 };
-
-void webNotificationPermissionRequest(
-    Evas_Object* window,
-    SecurityOriginDB::SecurityOriginDAO* securityOriginDAO,
-    void* data);
-bool showWebNotification(WebNotificationDataPtr notiData);
-} // namespace SecuritySupport
-} // namespace WebNotification
-
+} // namespace ViewModule
 #endif /* VIEW_LOGIC_WEB_NOTIFICATION_H_ */
index 0d5fbd9..91c2a3a 100644 (file)
@@ -28,6 +28,7 @@
 #include <efl_assist_screen_reader.h>
 
 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 =
@@ -86,6 +87,18 @@ void WindowData::init()
     m_initialized = true;
 }
 
+void WindowData::postInit()
+{
+    Assert(m_win != NULL && "m_win is null");
+    Assert(m_initialized && "Not init");
+
+    // postInit should called after process permission is changed to app
+    if (UID_ROOT == getuid()) {
+        Assert(false && "Cannot do with root permission");
+    }
+    elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_SHOW);
+}
+
 bool WindowData::initScreenReaderSupport(bool isSupportAccessibility)
 {
     LogDebug("called");
@@ -354,9 +367,9 @@ void WindowData::toggleIndicator(bool fullscreen)
     LogDebug("fullscreen=" << (fullscreen ? "true" : "false"));
 
     if (!fullscreen) {
-        elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_SHOW);
+        elm_win_indicator_opacity_set(m_win, ELM_WIN_INDICATOR_OPAQUE);
     } else {
-        elm_win_indicator_mode_set(m_win, ELM_WIN_INDICATOR_HIDE);
+        elm_win_indicator_opacity_set(m_win, ELM_WIN_INDICATOR_TRANSPARENT);
     }
 }
 
index 4e0df8c..d7cb7f8 100644 (file)
@@ -63,6 +63,7 @@ class WindowData : private DPL::Noncopyable
     virtual ~WindowData();
 
     void init();
+    void postInit();
     bool initScreenReaderSupport(bool isSupportAccessibility);
 
     Evas_Object* getEvasObject(Layer layer);
index 3baaed0..baacc19 100644 (file)
@@ -466,6 +466,8 @@ void WrtClient::launchStep()
     //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(