Clean-up application service
[framework/web/wrt-installer.git] / src / configuration_parser / widget_parser.cpp
index 5f0d6ca..8e25198 100644 (file)
@@ -88,6 +88,7 @@ void UpdateTextWithDirectionMark(Direction direction,
         break;
     default:
         Assert(false);
+        break;
     }
 }
 } // namespace Unicode
@@ -275,6 +276,7 @@ class AccessParser : public ElementParser
             break;
         default:
             LogError("Error in Access tag - unknown standard.");
+            break;
         }
     }
 
@@ -291,10 +293,15 @@ class AccessParser : public ElementParser
             return;
         }
 
+        if(m_strIRIOrigin == L"*") //wildcard match means yes for subdomains
+        {
+            m_bSubDomainAccess = true;
+        }
+
         ConfigParserData::AccessInfo accessInfo(m_strIRIOrigin,
                                                 m_bSubDomainAccess);
-        std::pair <ConfigParserData::AccessInfoSet::iterator, bool> ret =
-            m_data.accessInfoSet.insert(accessInfo);
+        //std::pair <ConfigParserData::AccessInfoSet::iterator, bool> ret =
+        m_data.accessInfoSet.insert(accessInfo);
     }
 
     virtual void Verify()
@@ -305,6 +312,7 @@ class AccessParser : public ElementParser
             break;
         default:
             LogError("Error in Access tag - unknown standard.");
+            break;
         }
     }
 
@@ -694,7 +702,8 @@ class ContentParser : public ElementParser
             m_type = value;
             MimeTypeUtils::MimeAttributes mimeAttributes =
                 MimeTypeUtils::getMimeAttributes(value);
-            if (mimeAttributes.count(L"charset") > 0) {
+            if ((mimeAttributes.count(L"charset") > 0) && m_encoding.IsNull())
+            {
                 m_encoding = mimeAttributes[L"charset"];
             }
         } else if (attribute.name == L"encoding") {
@@ -735,132 +744,6 @@ class ContentParser : public ElementParser
     ConfigParserData& m_data;
 };
 
-class FeatureParser : public ElementParser
-{
-  public:
-    struct ParamParser : public ElementParser
-    {
-        virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
-                                            const DPL::String& /*name*/)
-        {
-            return &IgnoringParser::Create;
-        }
-
-        virtual void Accept(const XmlAttribute& attribute)
-        {
-            if (attribute.name == L"name") {
-                m_name = attribute.value;
-                NormalizeString(m_name);
-            } else if (attribute.name == L"value") {
-                m_value = attribute.value;
-                NormalizeString(m_value);
-            }
-        }
-
-        virtual void Accept(const Element& /*element*/)
-        {}
-
-        virtual void Accept(const Text& /*text*/)
-        {
-            ThrowMsg(Exception::ParseError, "param element must be empty");
-        }
-
-        virtual void Verify()
-        {
-            if (m_name.IsNull() || *m_name == L"") {
-                return;
-            }
-            if (m_value.IsNull() || *m_value == L"") {
-                return;
-            }
-
-            ConfigParserData::Param param(*m_name);
-            param.value = *m_value;
-
-            if (m_data.paramsList.find(param) == m_data.paramsList.end()) {
-                m_data.paramsList.insert(param);
-            }
-        }
-
-        ParamParser(ConfigParserData::Feature& data) :
-            ElementParser(),
-            m_data(data)
-        {}
-
-      private:
-        DPL::OptionalString m_name;
-        DPL::OptionalString m_value;
-        ConfigParserData::Feature& m_data;
-    };
-
-    virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
-                                        const DPL::String& name)
-    {
-        if (name == L"param") {
-            return DPL::MakeDelegate(this, &FeatureParser::OnParamElement);
-        } else {
-            return &IgnoringParser::Create;
-        }
-    }
-
-    virtual void Accept(const Text& /*text*/)
-    {}
-
-    virtual void Accept(const Element& /*element*/)
-    {}
-
-    virtual void Accept(const XmlAttribute& attribute)
-    {
-        if (attribute.name == L"name") {
-            m_feature.name = attribute.value;
-        } else if (attribute.name == L"required") {
-            if (attribute.value == L"false") {
-                m_feature.required = false;
-            } else {
-                m_feature.required = true;
-            }
-        }
-    }
-
-    virtual void Verify()
-    {
-        LibIri::Wrapper iri(DPL::ToUTF8String(m_feature.name).c_str());
-
-        if (m_feature.name != L"") {
-            if (iri.Validate()) {
-                if (m_data.featuresList.find(m_feature) ==
-                    m_data.featuresList.end())
-                {
-                    m_data.featuresList.insert(m_feature);
-                } else {
-                    LogDebug("Ignoring feature with name" <<
-                             DPL::ToUTF8String(m_feature.name));
-                }
-            } else {
-                if (m_feature.required) {
-                    //Throw only if required
-                    ThrowMsg(Exception::ParseError, "invalid feature IRI");
-                }
-            }
-        }
-    }
-
-    ElementParserPtr OnParamElement()
-    {
-        return ElementParserPtr(new ParamParser(m_feature));
-    }
-
-    FeatureParser(ConfigParserData& data) :
-        ElementParser(),
-        m_data(data),
-        m_feature(L"")
-    {}
-
-  private:
-    ConfigParserData& m_data;
-    ConfigParserData::Feature m_feature;
-};
-
 class PreferenceParser : public ElementParser
 {
   public:
@@ -1036,109 +919,6 @@ class SettingParser : public ElementParser
     ConfigParserData::Setting m_setting;
 };
 
-class AppServiceParser : public ElementParser
-{
-  public:
-    virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
-                                        const DPL::String& /*name*/)
-    {
-        return &IgnoringParser::Create;
-    }
-
-    virtual void Accept(const XmlAttribute& attribute)
-    {
-        if (attribute.name == L"src") {
-            m_src = attribute.value;
-        } else if (attribute.name == L"operation") {
-            m_operation = attribute.value;
-        } else if (attribute.name == L"scheme") {
-            m_scheme = attribute.value;
-        } else if (attribute.name == L"mime") {
-            m_mime = attribute.value;
-        }
-    }
-
-    virtual void Accept(const Element& element)
-    {
-        LogWarning("namespace for app service = " << element.ns);
-        if (element.ns == ConfigurationNamespace::W3CWidgetNamespaceName) {
-            ThrowMsg(Exception::ParseError,
-                     "Wrong xml namespace for widget element");
-        }
-    }
-
-    virtual void Accept(const Text& /*text*/)
-    {
-        ThrowMsg(Exception::ParseError, "param element must be empty");
-    }
-
-    virtual void Verify()
-    {
-        if (m_src.IsNull()) {
-            LogWarning("service element must have target attribute");
-            return;
-        } else if (m_operation.IsNull()) {
-            LogWarning("service element must have operation attribute");
-            return;
-        }
-        NormalizeString(m_src);
-        NormalizeString(m_operation);
-        NormalizeString(m_scheme);
-        NormalizeString(m_mime);
-
-        // verify duplicate element
-        DPL::String wildString(L"*/*");
-        DPL::String nullString(L"");
-        ConfigParserData::ServiceInfo serviceInfo(
-            m_src.IsNull() ? nullString : *m_src,
-            m_operation.IsNull() ? nullString : *m_operation,
-            m_scheme.IsNull() ? nullString : *m_scheme,
-            m_mime.IsNull() ? nullString : *m_mime);
-
-        FOREACH(iterator, m_data.appServiceList) {
-            if (iterator->m_operation == serviceInfo.m_operation &&
-                // check scheme
-                (iterator->m_scheme == serviceInfo.m_scheme ||
-                 // check input scheme is "*/*" case
-                 (iterator->m_scheme == wildString &&
-                  serviceInfo.m_scheme != nullString) ||
-                 // check iterator scheme is "*/*" case
-                 (serviceInfo.m_scheme == wildString &&
-                  iterator->m_scheme != nullString)) &&
-
-                (iterator->m_mime == serviceInfo.m_mime ||
-                 // check input mime is "*/*" case
-                 (iterator->m_mime == wildString &&
-                  serviceInfo.m_mime != nullString) ||
-                 // check iterator mime is "*/*" case
-                 (serviceInfo.m_mime == wildString &&
-                  iterator->m_mime != nullString)))
-            {
-                ThrowMsg(Exception::ParseError,
-                         "service operation is duplicated " +
-                         DPL::ToUTF8String(*m_operation));
-            }
-        }
-        m_data.appServiceList.push_back(serviceInfo);
-    }
-
-    AppServiceParser(ConfigParserData& data) :
-        ElementParser(),
-        m_src(DPL::OptionalString::Null),
-        m_operation(DPL::OptionalString::Null),
-        m_scheme(DPL::OptionalString::Null),
-        m_mime(DPL::OptionalString::Null),
-        m_data(data)
-    {}
-
-  private:
-    DPL::OptionalString m_src;
-    DPL::OptionalString m_operation;
-    DPL::OptionalString m_scheme;
-    DPL::OptionalString m_mime;
-    ConfigParserData& m_data;
-};
-
 class AppControlParser : public ElementParser
 {
   public:
@@ -1261,15 +1041,22 @@ class AppControlParser : public ElementParser
 
         virtual void Verify()
         {
+            // exception
+            DPL::String ignoreUri(L"file");
+
+            if (!m_value.IsNull() && *m_value == ignoreUri)
+            {
+                LogInfo("exception : '" << *m_value << "' scheme will be ignored.");
+                m_value = DPL::OptionalString::Null;
+            }
+
             if (m_value.IsNull() || *m_value == L"") {
                 return;
             }
 
             DPL::String wildString(L"*/*");
-            if ((m_data.m_uriList.find(wildString) ==
-                 m_data.m_uriList.end())
-                && (m_data.m_uriList.find(*m_value) ==
-                    m_data.m_uriList.end()))
+            if ((m_data.m_uriList.find(wildString) == m_data.m_uriList.end())
+                && (m_data.m_uriList.find(*m_value) == m_data.m_uriList.end()))
             {
                 m_data.m_uriList.insert(*m_value);
             } else {
@@ -1346,6 +1133,53 @@ class AppControlParser : public ElementParser
         ConfigParserData::AppControlInfo& m_data;
     };
 
+    struct DispositionParser : public ElementParser
+    {
+      public:
+        virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                                            const DPL::String& /*name*/)
+        {
+            return &IgnoringParser::Create;
+        }
+
+        virtual void Accept(const Text& /*text*/)
+        {}
+
+        virtual void Accept(const Element& /*element*/)
+        {}
+
+        virtual void Accept(const XmlAttribute& attribute)
+        {
+            if (attribute.name == L"disposition") {
+                if (attribute.value.size() > 0) {
+                    m_value = attribute.value;
+                    NormalizeString(m_value);
+                }
+            }
+        }
+
+        virtual void Verify()
+        {
+            if (m_value.IsNull() || *m_value != L"inline") {
+                m_data.m_disposition = ConfigParserData::AppControlInfo::Disposition::WINDOW;
+            }
+            else {
+                m_data.m_disposition = ConfigParserData::AppControlInfo::Disposition::INLINE;
+            }
+        }
+
+        DispositionParser(ConfigParserData::AppControlInfo& data) :
+            ElementParser(),
+            m_properNamespace(false),
+            m_data(data)
+        {}
+
+      private:
+        bool m_properNamespace;
+        DPL::OptionalString m_value;
+        ConfigParserData::AppControlInfo& m_data;
+    };
+
     virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
                                         const DPL::String& name)
     {
@@ -1358,12 +1192,15 @@ class AppControlParser : public ElementParser
             return DPL::MakeDelegate(this, &AppControlParser::OnUriElement);
         } else if (name == L"mime") {
             return DPL::MakeDelegate(this, &AppControlParser::OnMimeElement);
+        } else if (name == L"disposition") {
+            return DPL::MakeDelegate(this,
+                                     &AppControlParser::OnDispositionElement);
         } else {
             return &IgnoringParser::Create;
         }
     }
 
-    virtual void Accept(const XmlAttribute& attribute)
+    virtual void Accept(const XmlAttribute& /*attribute*/)
     {}
 
     virtual void Accept(const Element& element)
@@ -1392,16 +1229,6 @@ class AppControlParser : public ElementParser
             return;
         }
 
-        FOREACH(iterator, m_data.appControlList) {
-            if (iterator->m_src == m_appControl.m_src &&
-                iterator->m_operation == m_appControl.m_operation)
-            {
-                ThrowMsg(Exception::ParseError,
-                         "app control element is duplicated " +
-                         DPL::ToUTF8String(m_appControl.m_src) + ", " +
-                         DPL::ToUTF8String(m_appControl.m_operation));
-            }
-        }
         m_data.appControlList.push_back(m_appControl);
     }
 
@@ -1425,6 +1252,11 @@ class AppControlParser : public ElementParser
         return ElementParserPtr(new MimeParser(m_appControl));
     }
 
+    ElementParserPtr OnDispositionElement()
+    {
+        return ElementParserPtr(new DispositionParser(m_appControl));
+    }
+
     AppControlParser(ConfigParserData& data) :
         ElementParser(),
         m_data(data),
@@ -1445,7 +1277,7 @@ class ApplicationParser : public ElementParser
         return &IgnoringParser::Create;
     }
 
-    virtual void Accept(const Text& text)
+    virtual void Accept(const Text& /*text*/)
     {
         if (m_properNamespace) {
             LogDebug("text");
@@ -1539,7 +1371,7 @@ class SplashParser : public ElementParser
         }
     }
 
-    virtual void Accept(const Element& element)
+    virtual void Accept(const Element& /*element*/)
     {}
 
     virtual void Accept(const Text& /*text*/)
@@ -1614,7 +1446,7 @@ class PrivilegeParser : public ElementParser
 {
   public:
     virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
-                                        const DPL::String& name)
+                                        const DPL::String& /*name*/)
     {
         return &IgnoringParser::Create;
     }
@@ -1640,7 +1472,6 @@ class PrivilegeParser : public ElementParser
                 m_privilege.name = attribute.value;
             }
         }
-        m_feature.required = false;
     }
 
     virtual void Verify()
@@ -1655,7 +1486,7 @@ class PrivilegeParser : public ElementParser
                     m_data.featuresList.insert(m_feature);
                 } else {
                     LogDebug("Ignoring feature with name" <<
-                             DPL::ToUTF8String(m_feature.name));
+                        DPL::ToUTF8String(m_feature.name));
                 }
             }
         }
@@ -1740,7 +1571,7 @@ class CategoryParser : public ElementParser
     ConfigParserData& m_data;
 };
 
-class LiveboxParser : public ElementParser
+class AppWidgetParser : public ElementParser
 {
   public:
 
@@ -1752,7 +1583,7 @@ class LiveboxParser : public ElementParser
             return &IgnoringParser::Create;
         }
 
-        virtual void Accept(const XmlAttribute& attribute)
+        virtual void Accept(const XmlAttribute& /*attribute*/)
         {}
 
         virtual void Accept(const Element& element)
@@ -1880,6 +1711,7 @@ class LiveboxParser : public ElementParser
             explicit BoxSizeParser(
                 ConfigParserData::LiveboxInfo::BoxContentInfo& data) :
                 ElementParser(),
+                m_properNamespace(false),
                 m_data(data)
             {}
 
@@ -1893,7 +1725,7 @@ class LiveboxParser : public ElementParser
         struct PdParser : public ElementParser
         {
             virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
-                                                const DPL::String& name)
+                                                const DPL::String& /*name*/)
             {
                 return &IgnoringParser::Create;
             }
@@ -1952,12 +1784,12 @@ class LiveboxParser : public ElementParser
             if (name == L"box-size") {
                 return DPL::MakeDelegate(
                            this,
-                           &LiveboxParser::BoxContentParser::
+                           &AppWidgetParser::BoxContentParser::
                                OnBoxSizeElement);
             } else if (name == L"pd") {
                 return DPL::MakeDelegate(
                            this,
-                           &LiveboxParser::BoxContentParser::
+                           &AppWidgetParser::BoxContentParser::
                                OnPdElement);
             } else {
                 ThrowMsg(Exception::ParseError,
@@ -1974,6 +1806,9 @@ class LiveboxParser : public ElementParser
                 if (attribute.name == L"mouse-event") {
                     m_box.m_boxMouseEvent = attribute.value;
                 }
+                if (attribute.name == L"touch-effect") {
+                    m_box.m_boxTouchEffect = attribute.value;
+                }
             }
         }
 
@@ -2021,11 +1856,11 @@ class LiveboxParser : public ElementParser
                                         const DPL::String& name)
     {
         if (name == L"box-label") {
-            return DPL::MakeDelegate(this, &LiveboxParser::OnBoxLabelElement);
+            return DPL::MakeDelegate(this, &AppWidgetParser::OnBoxLabelElement);
         } else if (name == L"box-icon") {
-            return DPL::MakeDelegate(this, &LiveboxParser::OnBoxIconElement);
+            return DPL::MakeDelegate(this, &AppWidgetParser::OnBoxIconElement);
         } else if (name == L"box-content") {
-            return DPL::MakeDelegate(this, &LiveboxParser::OnBoxContentElement);
+            return DPL::MakeDelegate(this, &AppWidgetParser::OnBoxContentElement);
         } else {
             return &IgnoringParser::Create;
         }
@@ -2071,7 +1906,7 @@ class LiveboxParser : public ElementParser
         m_data.m_livebox.push_back(m_livebox);
     }
 
-    explicit LiveboxParser(ConfigParserData& data) :
+    explicit AppWidgetParser(ConfigParserData& data) :
         ElementParser(),
         m_data(data),
         m_properNamespace(false)
@@ -2108,8 +1943,8 @@ class LiveboxParser : public ElementParser
 class CspParser : public ElementParser
 {
   public:
-    virtual ActionFunc GetElementParser(const DPL::String& ns,
-                                        const DPL::String& name)
+    virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                                        const DPL::String& /*name*/)
     {
         return &IgnoringParser::Create;
     }
@@ -2127,7 +1962,7 @@ class CspParser : public ElementParser
         }
     }
 
-    virtual void Accept(const XmlAttribute& attribute)
+    virtual void Accept(const XmlAttribute& /*attribute*/)
     {}
 
     virtual void Accept(const Text& text)
@@ -2150,6 +1985,323 @@ class CspParser : public ElementParser
     DPL::OptionalString m_policy;
 };
 
+class CspReportOnlyParser : public ElementParser
+{
+  public:
+    virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                                        const DPL::String& /*name*/)
+    {
+        return &IgnoringParser::Create;
+    }
+
+    CspReportOnlyParser(ConfigParserData& data) :
+        ElementParser(),
+        m_data(data),
+        m_properNamespace(false)
+    {}
+
+    virtual void Accept(const Element& element)
+    {
+        if (element.ns == ConfigurationNamespace::TizenWebAppNamespaceName) {
+            m_properNamespace = true;
+        }
+    }
+
+    virtual void Accept(const XmlAttribute& /*attribute*/)
+    {}
+
+    virtual void Accept(const Text& text)
+    {
+        if (m_properNamespace) {
+            m_policy = text.value;
+        }
+    }
+
+    virtual void Verify()
+    {
+        if (!m_policy.IsNull()) {
+            m_data.cspPolicyReportOnly = *m_policy;
+        }
+    }
+
+  private:
+    ConfigParserData& m_data;
+    bool m_properNamespace;
+    DPL::OptionalString m_policy;
+};
+
+class AccountParser : public ElementParser
+{
+  public:
+    struct AccountProviderParser : public ElementParser
+    {
+      public:
+
+          struct IconParser : public ElementParser
+        {
+            public:
+                virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                        const DPL::String& /*name*/)
+                {
+                    return &IgnoringParser::Create;
+                }
+
+                virtual void Accept(const Text& text)
+                {
+                    if (text.value == L"") {
+                        return;
+                    }
+                    m_value = text.value;
+                }
+
+                virtual void Accept(const Element& /*element*/)
+                {}
+
+                virtual void Accept(const XmlAttribute& attribute)
+                {
+                    if (attribute.name == L"section") {
+                        if (attribute.value == L"account") {
+                            m_type = ConfigParserData::IconSectionType::DefaultIcon;
+                        } else if (attribute.value == L"account-small") {
+                            m_type = ConfigParserData::IconSectionType::SmallIcon;
+                        }
+                    }
+                }
+
+                virtual void Verify()
+                {
+                    if (m_value.IsNull() || *m_value == L"") {
+                        return;
+                    }
+
+                    std::pair<ConfigParserData::IconSectionType, DPL::String> icon;
+                    icon.first = m_type;
+                    icon.second = *m_value;
+
+                    m_data.m_iconSet.insert(icon);
+                }
+
+                IconParser(ConfigParserData::AccountProvider& data) :
+                    ElementParser(),
+                    m_properNamespace(false),
+                    m_type(ConfigParserData::DefaultIcon),
+                    m_data(data)
+            {}
+
+            private:
+                bool m_properNamespace;
+                ConfigParserData::IconSectionType m_type;
+                ConfigParserData::AccountProvider& m_data;
+                DPL::OptionalString m_value;
+        };
+
+          struct DisplayNameParser : public ElementParser
+        {
+            public:
+                virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                        const DPL::String& /*name*/)
+                {
+                    return &IgnoringParser::Create;
+                }
+
+                virtual void Accept(const Text& text)
+                {
+                    if (text.value == L"") {
+                        return;
+                    }
+                    m_value = text.value;
+                }
+
+                virtual void Accept(const Element& element)
+                {
+                    m_lang = element.lang;
+                    m_value= L"";
+                }
+
+                virtual void Accept(const XmlAttribute& /*attribute*/)
+                {}
+
+                virtual void Verify()
+                {
+                    if (m_value.IsNull() || *m_value == L"") {
+                        return;
+                    }
+
+                    std::pair<DPL::String, DPL::String> name;
+                    name.first = *m_lang;
+                    name.second = *m_value;
+
+                    m_data.m_displayNameSet.insert(name);
+                }
+
+                DisplayNameParser(ConfigParserData::AccountProvider& data) :
+                    ElementParser(),
+                    m_properNamespace(false),
+                    m_data(data)
+            {}
+
+            private:
+                bool m_properNamespace;
+                DPL::OptionalString m_lang;
+                DPL::OptionalString m_value;
+                ConfigParserData::AccountProvider& m_data;
+        };
+
+          struct CapabilityParser : public ElementParser
+        {
+            public:
+                virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                        const DPL::String& /*name*/)
+                {
+                    return &IgnoringParser::Create;
+                }
+
+                virtual void Accept(const Text& text)
+                {
+                    if (text.value == L"") {
+                        return;
+                    }
+                    m_value = text.value;
+                }
+
+                virtual void Accept(const Element& /*element*/)
+                {}
+
+                virtual void Accept(const XmlAttribute& /*attribute*/)
+                {}
+
+                virtual void Verify()
+                {
+                    if (m_value.IsNull() || *m_value == L"") {
+                        return;
+                    }
+                    m_data.m_capabilityList.push_back(*m_value);
+                }
+
+                CapabilityParser(ConfigParserData::AccountProvider& data) :
+                    ElementParser(),
+                    m_properNamespace(false),
+                    m_data(data)
+            {}
+
+            private:
+                bool m_properNamespace;
+                DPL::OptionalString m_value;
+                ConfigParserData::AccountProvider& m_data;
+        };
+          virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                  const DPL::String& name)
+          {
+              if (name == L"icon") {
+                  return DPL::MakeDelegate(this, &AccountProviderParser::OnIconElement);
+              } else if (name == L"display-name") {
+                  return DPL::MakeDelegate(this,
+                          &AccountProviderParser::OnDisplayNameElement);
+              } else if (name == L"capability") {
+                  return DPL::MakeDelegate(this, &AccountProviderParser::OnCapabilityElement);
+              } else {
+                  return &IgnoringParser::Create;
+              }
+          }
+
+          virtual void Accept(const Text& /*text*/)
+          {}
+
+          virtual void Accept(const Element& /*element*/)
+          {}
+
+          virtual void Accept(const XmlAttribute& attribute)
+          {
+              if (attribute.name == L"multiple-accounts-support") {
+                  if (attribute.value == L"") {
+                      return;
+                  }
+
+                  if (attribute.value == L"ture") {
+                      m_multiSupport = true;
+                  }
+              }
+          }
+
+          virtual void Verify()
+          {
+              m_data.m_multiAccountSupport = m_multiSupport;
+          }
+
+          ElementParserPtr OnIconElement()
+          {
+              return ElementParserPtr(new IconParser(m_data));
+          }
+
+          ElementParserPtr OnDisplayNameElement()
+          {
+              return ElementParserPtr(new DisplayNameParser(m_data));
+          }
+
+          ElementParserPtr OnCapabilityElement()
+          {
+              return ElementParserPtr(new CapabilityParser(m_data));
+          }
+
+          AccountProviderParser(ConfigParserData::AccountProvider& data) :
+              ElementParser(),
+              m_properNamespace(false),
+              m_multiSupport(false),
+              m_data(data)
+        {}
+
+      private:
+          bool m_properNamespace;
+          bool m_multiSupport;
+          ConfigParserData::AccountProvider& m_data;
+    };
+
+    virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+            const DPL::String& name)
+    {
+        if (name == L"account-provider") {
+            return DPL::MakeDelegate(this, &AccountParser::OnProviderElement);
+        } else {
+            return &IgnoringParser::Create;
+        }
+    }
+
+    virtual void Accept(const Element& element)
+    {
+        if (element.ns == ConfigurationNamespace::TizenWebAppNamespaceName) {
+            m_properNamespace = true;
+        }
+    }
+
+    virtual void Accept(const XmlAttribute& /*attribute*/)
+    {}
+
+    virtual void Accept(const Text& /*text*/)
+    {}
+
+    virtual void Verify()
+    {}
+
+    ElementParserPtr OnProviderElement()
+    {
+        return ElementParserPtr(new AccountProviderParser(m_account));
+    }
+
+    AccountParser(ConfigParserData& data) :
+        ElementParser(),
+        m_data(data),
+        m_account(data.accountProvider),
+        m_properNamespace(false),
+        m_multiSupport(false)
+    {}
+
+  private:
+    ConfigParserData& m_data;
+    ConfigParserData::AccountProvider& m_account;
+    bool m_properNamespace;
+    bool m_multiSupport;
+};
+
 ElementParser::ActionFunc WidgetParser::GetElementParser(
     const DPL::String& /*ns*/,
     const DPL::String&
@@ -2177,16 +2329,11 @@ WidgetParser::WidgetParser(ConfigParserData& data) :
     m_map[L"icon"] = DPL::MakeDelegate(this, &WidgetParser::OnIconElement);
     m_map[L"content"] =
         DPL::MakeDelegate(this, &WidgetParser::OnContentElement);
-    m_map[L"feature"] =
-        DPL::MakeDelegate(this, &WidgetParser::OnFeatureElement);
     m_map[L"preference"] =
         DPL::MakeDelegate(this, &WidgetParser::OnPreferenceElement);
     m_map[L"link"] = DPL::MakeDelegate(this, &WidgetParser::OnLinkElement);
     m_map[L"setting"] =
         DPL::MakeDelegate(this, &WidgetParser::OnSettingElement);
-    // TODO: appservice will be removed
-    m_map[L"appservice"] = DPL::MakeDelegate(this,
-                                             &WidgetParser::OnAppServiceElement);
     m_map[L"application"] = DPL::MakeDelegate(
             this,
             &WidgetParser::
@@ -2202,13 +2349,18 @@ WidgetParser::WidgetParser(ConfigParserData& data) :
                 OnAppControlElement);
     m_map[L"category"] = DPL::MakeDelegate(this,
                                            &WidgetParser::OnCategoryElement);
-    m_map[L"livebox"] = DPL::MakeDelegate(this, &WidgetParser::OnLiveboxElement);
+    m_map[L"app-widget"] = DPL::MakeDelegate(this, &WidgetParser::OnAppWidgetElement);
 #ifdef CSP_ENABLED
-    m_map[L"Content-Security-Policy"] = DPL::MakeDelegate(
+    m_map[L"content-security-policy"] = DPL::MakeDelegate(
             this,
             &WidgetParser::
                 OnCspElement);
+    m_map[L"content-security-policy-report-only"] = DPL::MakeDelegate(
+            this,
+            &WidgetParser::
+                OnCspReportOnlyElement);
 #endif
+    m_map[L"account"] = DPL::MakeDelegate(this, &WidgetParser::OnAccountElement);
 }
 
 ElementParserPtr WidgetParser::OnNameElement()
@@ -2246,11 +2398,6 @@ ElementParserPtr WidgetParser::OnContentElement()
     return ElementParserPtr(new ContentParser(m_data));
 }
 
-ElementParserPtr WidgetParser::OnFeatureElement()
-{
-    return ElementParserPtr(new FeatureParser(m_data));
-}
-
 ElementParserPtr WidgetParser::OnPreferenceElement()
 {
     return ElementParserPtr(new PreferenceParser(m_data));
@@ -2286,11 +2433,6 @@ ElementParserPtr WidgetParser::OnPrivilegeElement()
     return ElementParserPtr(new PrivilegeParser(m_data));
 }
 
-ElementParserPtr WidgetParser::OnAppServiceElement()
-{
-    return ElementParserPtr(new AppServiceParser(m_data));
-}
-
 ElementParserPtr WidgetParser::OnAppControlElement()
 {
     return ElementParserPtr(new AppControlParser(m_data));
@@ -2301,9 +2443,9 @@ ElementParserPtr WidgetParser::OnCategoryElement()
     return ElementParserPtr(new CategoryParser(m_data));
 }
 
-ElementParserPtr WidgetParser::OnLiveboxElement()
+ElementParserPtr WidgetParser::OnAppWidgetElement()
 {
-    return ElementParserPtr(new LiveboxParser(m_data));
+    return ElementParserPtr(new AppWidgetParser(m_data));
 }
 
 ElementParserPtr WidgetParser::OnCspElement()
@@ -2311,6 +2453,16 @@ ElementParserPtr WidgetParser::OnCspElement()
     return ElementParserPtr(new CspParser(m_data));
 }
 
+ElementParserPtr WidgetParser::OnCspReportOnlyElement()
+{
+    return ElementParserPtr(new CspReportOnlyParser(m_data));
+}
+
+ElementParserPtr WidgetParser::OnAccountElement()
+{
+    return ElementParserPtr(new AccountParser(m_data));
+}
+
 void WidgetParser::Accept(const Element& element)
 {
     if (element.ns != ConfigurationNamespace::W3CWidgetNamespaceName &&