| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 public: | 55 public: |
| 56 NotificationsCreateFunction(); | 56 NotificationsCreateFunction(); |
| 57 | 57 |
| 58 // NotificationsApiFunction: | 58 // NotificationsApiFunction: |
| 59 bool RunNotificationsApi() override; | 59 bool RunNotificationsApi() override; |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 ~NotificationsCreateFunction() override; | 62 ~NotificationsCreateFunction() override; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 scoped_ptr<api::notifications::Create::Params> params_; | 65 std::unique_ptr<api::notifications::Create::Params> params_; |
| 66 | 66 |
| 67 DECLARE_EXTENSION_FUNCTION("notifications.create", NOTIFICATIONS_CREATE) | 67 DECLARE_EXTENSION_FUNCTION("notifications.create", NOTIFICATIONS_CREATE) |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 class NotificationsUpdateFunction : public NotificationsApiFunction { | 70 class NotificationsUpdateFunction : public NotificationsApiFunction { |
| 71 public: | 71 public: |
| 72 NotificationsUpdateFunction(); | 72 NotificationsUpdateFunction(); |
| 73 | 73 |
| 74 // NotificationsApiFunction: | 74 // NotificationsApiFunction: |
| 75 bool RunNotificationsApi() override; | 75 bool RunNotificationsApi() override; |
| 76 | 76 |
| 77 protected: | 77 protected: |
| 78 ~NotificationsUpdateFunction() override; | 78 ~NotificationsUpdateFunction() override; |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 scoped_ptr<api::notifications::Update::Params> params_; | 81 std::unique_ptr<api::notifications::Update::Params> params_; |
| 82 | 82 |
| 83 DECLARE_EXTENSION_FUNCTION("notifications.update", NOTIFICATIONS_UPDATE) | 83 DECLARE_EXTENSION_FUNCTION("notifications.update", NOTIFICATIONS_UPDATE) |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class NotificationsClearFunction : public NotificationsApiFunction { | 86 class NotificationsClearFunction : public NotificationsApiFunction { |
| 87 public: | 87 public: |
| 88 NotificationsClearFunction(); | 88 NotificationsClearFunction(); |
| 89 | 89 |
| 90 // NotificationsApiFunction: | 90 // NotificationsApiFunction: |
| 91 bool RunNotificationsApi() override; | 91 bool RunNotificationsApi() override; |
| 92 | 92 |
| 93 protected: | 93 protected: |
| 94 ~NotificationsClearFunction() override; | 94 ~NotificationsClearFunction() override; |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 scoped_ptr<api::notifications::Clear::Params> params_; | 97 std::unique_ptr<api::notifications::Clear::Params> params_; |
| 98 | 98 |
| 99 DECLARE_EXTENSION_FUNCTION("notifications.clear", NOTIFICATIONS_CLEAR) | 99 DECLARE_EXTENSION_FUNCTION("notifications.clear", NOTIFICATIONS_CLEAR) |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 class NotificationsGetAllFunction : public NotificationsApiFunction { | 102 class NotificationsGetAllFunction : public NotificationsApiFunction { |
| 103 public: | 103 public: |
| 104 NotificationsGetAllFunction(); | 104 NotificationsGetAllFunction(); |
| 105 | 105 |
| 106 // NotificationsApiFunction: | 106 // NotificationsApiFunction: |
| 107 bool RunNotificationsApi() override; | 107 bool RunNotificationsApi() override; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 126 ~NotificationsGetPermissionLevelFunction() override; | 126 ~NotificationsGetPermissionLevelFunction() override; |
| 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 |