| 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_NOTIFICATION_NOTIFICATION_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "chrome/browser/extensions/api/api_function.h" | 11 #include "chrome/browser/extensions/api/api_function.h" |
| 10 #include "chrome/browser/extensions/extension_function.h" | 12 #include "chrome/browser/extensions/extension_function.h" |
| 11 #include "chrome/common/extensions/api/experimental_notification.h" | 13 #include "chrome/common/extensions/api/experimental_notification.h" |
| 12 | 14 #include "ui/notifications/notification_types.h" |
| 13 #include <string> | |
| 14 | 15 |
| 15 namespace extensions { | 16 namespace extensions { |
| 16 | 17 |
| 17 class NotificationApiFunction : public ApiFunction { | 18 class NotificationApiFunction : public ApiFunction { |
| 18 protected: | 19 protected: |
| 19 NotificationApiFunction(); | 20 NotificationApiFunction(); |
| 20 virtual ~NotificationApiFunction(); | 21 virtual ~NotificationApiFunction(); |
| 21 | 22 |
| 22 void CreateNotification( | 23 void CreateNotification( |
| 23 const std::string& id, | 24 const std::string& id, |
| 24 api::experimental_notification::NotificationOptions* options); | 25 api::experimental_notification::NotificationOptions* options); |
| 26 ui::notifications::NotificationType MapApiTemplateTypeToType( |
| 27 api::experimental_notification::TemplateType type); |
| 25 }; | 28 }; |
| 26 | 29 |
| 27 class NotificationCreateFunction : public NotificationApiFunction { | 30 class NotificationCreateFunction : public NotificationApiFunction { |
| 28 public: | 31 public: |
| 29 NotificationCreateFunction(); | 32 NotificationCreateFunction(); |
| 30 | 33 |
| 31 // UIThreadExtensionFunction: | 34 // UIThreadExtensionFunction: |
| 32 virtual bool RunImpl() OVERRIDE; | 35 virtual bool RunImpl() OVERRIDE; |
| 33 | 36 |
| 34 protected: | 37 protected: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 private: | 74 private: |
| 72 scoped_ptr<api::experimental_notification::Delete::Params> params_; | 75 scoped_ptr<api::experimental_notification::Delete::Params> params_; |
| 73 | 76 |
| 74 DECLARE_EXTENSION_FUNCTION("experimental.notification.delete", | 77 DECLARE_EXTENSION_FUNCTION("experimental.notification.delete", |
| 75 EXPERIMENTAL_NOTIFICATION_DELETE) | 78 EXPERIMENTAL_NOTIFICATION_DELETE) |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 } // namespace extensions | 81 } // namespace extensions |
| 79 | 82 |
| 80 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ | 83 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ |
| OLD | NEW |