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" |
11 #include "chrome/browser/extensions/api/api_function.h" | 11 #include "chrome/browser/extensions/api/api_function.h" |
12 #include "chrome/browser/extensions/extension_function.h" | |
13 #include "chrome/common/extensions/api/notifications.h" | 12 #include "chrome/common/extensions/api/notifications.h" |
| 13 #include "extensions/browser/extension_function.h" |
14 #include "ui/message_center/notification_types.h" | 14 #include "ui/message_center/notification_types.h" |
15 | 15 |
16 class Notification; | 16 class Notification; |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 | 19 |
20 class NotificationsApiFunction : public ApiFunction { | 20 class NotificationsApiFunction : public ApiFunction { |
21 public: | 21 public: |
22 // Whether the current extension and channel allow the API. Public for | 22 // Whether the current extension and channel allow the API. Public for |
23 // testing. | 23 // testing. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // NotificationsApiFunction: | 106 // NotificationsApiFunction: |
107 virtual bool RunNotificationsApi() OVERRIDE; | 107 virtual bool RunNotificationsApi() OVERRIDE; |
108 | 108 |
109 protected: | 109 protected: |
110 virtual ~NotificationsGetAllFunction(); | 110 virtual ~NotificationsGetAllFunction(); |
111 | 111 |
112 private: | 112 private: |
113 DECLARE_EXTENSION_FUNCTION("notifications.getAll", NOTIFICATIONS_GET_ALL) | 113 DECLARE_EXTENSION_FUNCTION("notifications.getAll", NOTIFICATIONS_GET_ALL) |
114 }; | 114 }; |
115 | 115 |
116 class NotificationsGetPermissionLevelFunction : | 116 class NotificationsGetPermissionLevelFunction |
117 public NotificationsApiFunction { | 117 : public NotificationsApiFunction { |
118 public: | 118 public: |
119 NotificationsGetPermissionLevelFunction(); | 119 NotificationsGetPermissionLevelFunction(); |
120 | 120 |
121 // NotificationsApiFunction: | 121 // NotificationsApiFunction: |
122 virtual bool CanRunWhileDisabled() const OVERRIDE; | 122 virtual bool CanRunWhileDisabled() const OVERRIDE; |
123 virtual bool RunNotificationsApi() OVERRIDE; | 123 virtual bool RunNotificationsApi() OVERRIDE; |
124 | 124 |
125 protected: | 125 protected: |
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 |