blob: 01932c723bd320ca9b6c5c6fc174d71e2c2ffa93 [file] [log] [blame]
Vitaly Buka4615e0d2015-10-14 15:35:12 -07001// Copyright 2015 The Weave Authors. All rights reserved.
Alex Vakulenko6e3c30e2015-05-21 17:39:25 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Vitaly Buka912b6982015-07-06 11:13:03 -07005#ifndef LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_PARSER_H_
6#define LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_PARSER_H_
Alex Vakulenko6e3c30e2015-05-21 17:39:25 -07007
8#include <string>
9
10#include <base/values.h>
11
Stefan Sauer2d16dfa2015-09-25 17:08:35 +020012#include "src/notification/notification_delegate.h"
Alex Vakulenko6e3c30e2015-05-21 17:39:25 -070013
Vitaly Bukab6f015a2015-07-09 14:59:23 -070014namespace weave {
Alex Vakulenko6e3c30e2015-05-21 17:39:25 -070015
16// Parses the notification JSON object received from GCD server and invokes
17// the appropriate method from the |delegate|.
18// Returns false if unexpected or malformed notification is received.
19bool ParseNotificationJson(const base::DictionaryValue& notification,
Alex Vakulenkoe07c29d2015-10-22 10:31:12 -070020 NotificationDelegate* delegate,
21 const std::string& channel_name);
Alex Vakulenko6e3c30e2015-05-21 17:39:25 -070022
Vitaly Bukab6f015a2015-07-09 14:59:23 -070023} // namespace weave
Alex Vakulenko6e3c30e2015-05-21 17:39:25 -070024
Vitaly Buka912b6982015-07-06 11:13:03 -070025#endif // LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_PARSER_H_