var converter_ = utils_.converter;
var validator_ = utils_.validator;
var types_ = validator_.Types;
+var privilege_ = xwalk.utils.privilege;
var native_ = new xwalk.utils.NativeManager(extension);
function convertColorToInt(rgbaColor) {
NotificationManager.prototype.post = function(notification) {
+ xwalk.utils.checkPrivilegeAccess(privilege_.NOTIFICATION);
+
var args = validator_.validateArgs(arguments, [
{name: 'notification', type: types_.PLATFORM_OBJECT, values: StatusNotification}
]);
};
NotificationManager.prototype.update = function(notification) {
+ xwalk.utils.checkPrivilegeAccess(privilege_.NOTIFICATION);
+
var args = validator_.validateArgs(arguments, [
{name: 'notification', type: types_.PLATFORM_OBJECT, values: StatusNotification}
]);
};
NotificationManager.prototype.remove = function(id) {
+ xwalk.utils.checkPrivilegeAccess(privilege_.NOTIFICATION);
+
var args = validator_.validateArgs(arguments, [
{name: 'id', type: types_.STRING}
]);
};
NotificationManager.prototype.removeAll = function() {
+ xwalk.utils.checkPrivilegeAccess(privilege_.NOTIFICATION);
+
var result = native_.callSync('NotificationManager_removeAll', {});
if (native_.isFailure(result)) {
namespace extension {
namespace notification {
-namespace {
-// The privileges that required in Notification API
-const std::string kPrivilegeNotification = "http://tizen.org/privilege/notification";
-} // namespace
-
using namespace common;
NotificationInstance::NotificationInstance() {
void NotificationInstance::NotificationManagerPost(const picojson::value& args,
picojson::object& out) {
- CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out);
picojson::value val{picojson::object{}};
PlatformResult status =
void NotificationInstance::NotificationManagerUpdate(
const picojson::value& args,
picojson::object& out) {
- CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out);
PlatformResult status = manager_->Update(args.get<picojson::object>());
void NotificationInstance::NotificationManagerRemove(
const picojson::value& args,
picojson::object& out) {
- CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out);
PlatformResult status = manager_->Remove(args.get<picojson::object>());
void NotificationInstance::NotificationManagerRemoveAll(
const picojson::value& args,
picojson::object& out) {
- CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out);
PlatformResult status = manager_->RemoveAll();