OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace | 25 namespace |
26 { | 26 { |
27 typedef std::pair<NotificationType, std::string> NotificationTypeString; | 27 typedef std::pair<NotificationType, std::string> NotificationTypeString; |
28 typedef std::vector<NotificationTypeString> NotificationTypes; | 28 typedef std::vector<NotificationTypeString> NotificationTypes; |
29 NotificationTypes InitNotificationTypes() | 29 NotificationTypes InitNotificationTypes() |
30 { | 30 { |
31 NotificationTypes retValue; | 31 NotificationTypes retValue; |
32 retValue.push_back(std::make_pair(NotificationType::NOTIFICATION_TYPE_QUESTI
ON, "question")); | 32 retValue.push_back(std::make_pair(NotificationType::NOTIFICATION_TYPE_QUESTI
ON, "question")); |
33 retValue.push_back(std::make_pair(NotificationType::NOTIFICATION_TYPE_CRITIC
AL, "critical")); | 33 retValue.push_back(std::make_pair(NotificationType::NOTIFICATION_TYPE_CRITIC
AL, "critical")); |
| 34 retValue.push_back(std::make_pair(NotificationType::NOTIFICATION_TYPE_RELENT
LESS, "relentless")); |
34 retValue.push_back(std::make_pair(NotificationType::NOTIFICATION_TYPE_INFORM
ATION, "information")); | 35 retValue.push_back(std::make_pair(NotificationType::NOTIFICATION_TYPE_INFORM
ATION, "information")); |
35 return retValue; | 36 return retValue; |
36 } | 37 } |
37 | 38 |
38 const NotificationTypes notificationTypes = InitNotificationTypes(); | 39 const NotificationTypes notificationTypes = InitNotificationTypes(); |
39 | 40 |
40 NotificationType StringToNotificationType(const std::string& value) | 41 NotificationType StringToNotificationType(const std::string& value) |
41 { | 42 { |
42 struct IsSecondEqualToPredicate | 43 struct IsSecondEqualToPredicate |
43 { | 44 { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 { | 120 { |
120 retValue.push_back(link.AsString()); | 121 retValue.push_back(link.AsString()); |
121 } | 122 } |
122 return retValue; | 123 return retValue; |
123 } | 124 } |
124 | 125 |
125 void Notification::MarkAsShown() | 126 void Notification::MarkAsShown() |
126 { | 127 { |
127 jsEngine->Evaluate("API.markNotificationAsShown").Call(GetProperty("id")); | 128 jsEngine->Evaluate("API.markNotificationAsShown").Call(GetProperty("id")); |
128 } | 129 } |
OLD | NEW |