Vitaly Buka | 4615e0d | 2015-10-14 15:35:12 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Weave Authors. All rights reserved. |
Alex Vakulenko | 6e3c30e | 2015-05-21 17:39:25 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Vitaly Buka | 912b698 | 2015-07-06 11:13:03 -0700 | [diff] [blame] | 5 | #ifndef LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_PARSER_H_ |
| 6 | #define LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_PARSER_H_ |
Alex Vakulenko | 6e3c30e | 2015-05-21 17:39:25 -0700 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/values.h> |
| 11 | |
Stefan Sauer | 2d16dfa | 2015-09-25 17:08:35 +0200 | [diff] [blame] | 12 | #include "src/notification/notification_delegate.h" |
Alex Vakulenko | 6e3c30e | 2015-05-21 17:39:25 -0700 | [diff] [blame] | 13 | |
Vitaly Buka | b6f015a | 2015-07-09 14:59:23 -0700 | [diff] [blame] | 14 | namespace weave { |
Alex Vakulenko | 6e3c30e | 2015-05-21 17:39:25 -0700 | [diff] [blame] | 15 | |
| 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. |
| 19 | bool ParseNotificationJson(const base::DictionaryValue& notification, |
Alex Vakulenko | e07c29d | 2015-10-22 10:31:12 -0700 | [diff] [blame] | 20 | NotificationDelegate* delegate, |
| 21 | const std::string& channel_name); |
Alex Vakulenko | 6e3c30e | 2015-05-21 17:39:25 -0700 | [diff] [blame] | 22 | |
Vitaly Buka | b6f015a | 2015-07-09 14:59:23 -0700 | [diff] [blame] | 23 | } // namespace weave |
Alex Vakulenko | 6e3c30e | 2015-05-21 17:39:25 -0700 | [diff] [blame] | 24 | |
Vitaly Buka | 912b698 | 2015-07-06 11:13:03 -0700 | [diff] [blame] | 25 | #endif // LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_PARSER_H_ |