[Notification] Add support for PROGRESS status type
[platform/framework/web/tizen-extensions-crosswalk.git] / notification / notification_parameters.cc
1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "notification/notification_parameters.h"
6
7 #include "common/picojson.h"
8
9 NotificationParameters ReadNotificationParameters(const picojson::value& v) {
10   NotificationParameters params;
11   params.status_type = v.get("statusType").to_str();
12
13   params.title = v.get("title").to_str();
14   params.content = v.get("content").to_str();
15
16   if (params.status_type == "PROGRESS") {
17     params.progress_type = v.get("progressType").to_str();
18     params.progress_value = v.get("progressValue").get<double>();
19   }
20
21   return params;
22 }