| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "chrome/browser/extensions/api/api_function.h" | 9 #include "chrome/browser/extensions/api/api_function.h" |
| 10 #include "chrome/browser/extensions/api/api_resource_manager.h" | 10 #include "chrome/browser/extensions/api/api_resource_manager.h" |
| 11 #include "chrome/browser/extensions/extension_function.h" | 11 #include "chrome/browser/extensions/extension_function.h" |
| 12 #include "chrome/common/extensions/api/experimental_notification.h" | 12 #include "chrome/common/extensions/api/experimental_notification.h" |
| 13 | 13 |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 namespace extensions { | 16 namespace extensions { |
| 17 | 17 |
| 18 class NotificationShowFunction : public AsyncApiFunction { | 18 class ApiResourceEventNotifier; |
| 19 |
| 20 class NotificationShowFunction : public ApiFunction { |
| 19 public: | 21 public: |
| 20 DECLARE_EXTENSION_FUNCTION_NAME("notification.show") | |
| 21 | |
| 22 NotificationShowFunction(); | 22 NotificationShowFunction(); |
| 23 | 23 |
| 24 // AsyncApiFunction: | 24 // UIThreadExtensionFunction: |
| 25 virtual bool Prepare() OVERRIDE; | 25 virtual bool RunImpl() OVERRIDE; |
| 26 virtual void Work() OVERRIDE; | |
| 27 virtual bool Respond() OVERRIDE; | |
| 28 | 26 |
| 29 protected: | 27 protected: |
| 30 virtual ~NotificationShowFunction(); | 28 virtual ~NotificationShowFunction(); |
| 31 | 29 |
| 32 private: | 30 private: |
| 33 scoped_ptr<api::experimental_notification::Show::Params> params_; | 31 scoped_ptr<api::experimental_notification::Show::Params> params_; |
| 32 int src_id_; |
| 33 ApiResourceEventNotifier* event_notifier_; |
| 34 |
| 35 DECLARE_EXTENSION_FUNCTION_NAME("experimental.notification.show") |
| 34 }; | 36 }; |
| 35 | 37 |
| 36 } // namespace extensions | 38 } // namespace extensions |
| 37 | 39 |
| 38 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ | 40 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ |
| OLD | NEW |