OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_NOTIFICATIONS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_NOTIFICATIONS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_NOTIFICATIONS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_NOTIFICATIONS_API_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 Notification* notification); | 34 Notification* notification); |
35 | 35 |
36 bool IsNotificationsApiEnabled() const; | 36 bool IsNotificationsApiEnabled() const; |
37 | 37 |
38 bool AreExtensionNotificationsAllowed() const; | 38 bool AreExtensionNotificationsAllowed() const; |
39 | 39 |
40 // Returns true if the API function is still allowed to run even when the | 40 // Returns true if the API function is still allowed to run even when the |
41 // notifications for a notifier have been disabled. | 41 // notifications for a notifier have been disabled. |
42 virtual bool CanRunWhileDisabled() const; | 42 virtual bool CanRunWhileDisabled() const; |
43 | 43 |
44 // Called inside of RunImpl. | 44 // Called inside of RunAsync. |
45 virtual bool RunNotificationsApi() = 0; | 45 virtual bool RunNotificationsApi() = 0; |
46 | 46 |
47 // UITHreadExtensionFunction: | 47 // UITHreadExtensionFunction: |
48 virtual bool RunImpl() OVERRIDE; | 48 virtual bool RunAsync() OVERRIDE; |
49 | 49 |
50 message_center::NotificationType MapApiTemplateTypeToType( | 50 message_center::NotificationType MapApiTemplateTypeToType( |
51 api::notifications::TemplateType type); | 51 api::notifications::TemplateType type); |
52 }; | 52 }; |
53 | 53 |
54 class NotificationsCreateFunction : public NotificationsApiFunction { | 54 class NotificationsCreateFunction : public NotificationsApiFunction { |
55 public: | 55 public: |
56 NotificationsCreateFunction(); | 56 NotificationsCreateFunction(); |
57 | 57 |
58 // NotificationsApiFunction: | 58 // NotificationsApiFunction: |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 virtual ~NotificationsGetPermissionLevelFunction(); | 126 virtual ~NotificationsGetPermissionLevelFunction(); |
127 | 127 |
128 private: | 128 private: |
129 DECLARE_EXTENSION_FUNCTION("notifications.getPermissionLevel", | 129 DECLARE_EXTENSION_FUNCTION("notifications.getPermissionLevel", |
130 NOTIFICATIONS_GET_ALL) | 130 NOTIFICATIONS_GET_ALL) |
131 }; | 131 }; |
132 | 132 |
133 } // namespace extensions | 133 } // namespace extensions |
134 | 134 |
135 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_NOTIFICATIONS_API_H_ | 135 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_NOTIFICATIONS_API_H_ |
OLD | NEW |