| 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_APP_APP_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/extensions/extension_function.h" | 8 #include "chrome/browser/extensions/extension_function.h" |
| 9 | 9 |
| 10 class Profile; | 10 class Profile; |
| 11 class GURL; | 11 class GURL; |
| 12 | 12 |
| 13 namespace webkit_glue { | 13 namespace content { |
| 14 struct WebIntentData; | 14 class WebIntentsDispatcher; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace extensions { | 17 namespace extensions { |
| 18 | 18 |
| 19 class Extension; | 19 class Extension; |
| 20 | 20 |
| 21 class AppNotifyFunction : public SyncExtensionFunction { | 21 class AppNotifyFunction : public SyncExtensionFunction { |
| 22 public: | 22 public: |
| 23 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.notify"); | 23 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.notify"); |
| 24 | 24 |
| 25 protected: | 25 protected: |
| 26 virtual ~AppNotifyFunction() {} | 26 virtual ~AppNotifyFunction() {} |
| 27 virtual bool RunImpl() OVERRIDE; | 27 virtual bool RunImpl() OVERRIDE; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 class AppClearAllNotificationsFunction : public SyncExtensionFunction { | 30 class AppClearAllNotificationsFunction : public SyncExtensionFunction { |
| 31 public: | 31 public: |
| 32 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.clearAllNotifications"); | 32 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.clearAllNotifications"); |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 virtual ~AppClearAllNotificationsFunction() {} | 35 virtual ~AppClearAllNotificationsFunction() {} |
| 36 virtual bool RunImpl() OVERRIDE; | 36 virtual bool RunImpl() OVERRIDE; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 class PostIntentResponseFunction : public SyncExtensionFunction { |
| 40 public: |
| 41 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.postIntentResponse"); |
| 42 |
| 43 protected: |
| 44 virtual ~PostIntentResponseFunction() {} |
| 45 virtual bool RunImpl() OVERRIDE; |
| 46 }; |
| 47 |
| 39 class AppEventRouter { | 48 class AppEventRouter { |
| 40 public: | 49 public: |
| 41 // Dispatches the onLaunched event to the given app, providing no launch | 50 // Dispatches the onLaunched event to the given app, providing no launch |
| 42 // data. | 51 // data. |
| 43 static void DispatchOnLaunchedEvent(Profile* profile, | 52 static void DispatchOnLaunchedEvent(Profile* profile, |
| 44 const Extension* extension); | 53 const Extension* extension); |
| 45 | 54 |
| 46 // Dispatches the onLaunched event to the given app, providing launch data of | 55 // Dispatches the onLaunched event to the given app, providing launch data of |
| 47 // the form: | 56 // the form: |
| 48 // { | 57 // { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 64 const string16& action, | 73 const string16& action, |
| 65 const std::string& file_system_id, | 74 const std::string& file_system_id, |
| 66 const std::string& base_name); | 75 const std::string& base_name); |
| 67 | 76 |
| 68 // Dispatches the onLaunched event to the app implemented by |extension| | 77 // Dispatches the onLaunched event to the app implemented by |extension| |
| 69 // running in |profile|. The event parameter launchData will have a field | 78 // running in |profile|. The event parameter launchData will have a field |
| 70 // called intent, populated by |web_intent_data|. | 79 // called intent, populated by |web_intent_data|. |
| 71 static void DispatchOnLaunchedEventWithWebIntent( | 80 static void DispatchOnLaunchedEventWithWebIntent( |
| 72 Profile* profile, | 81 Profile* profile, |
| 73 const Extension* extension, | 82 const Extension* extension, |
| 74 const webkit_glue::WebIntentData web_intent_data); | 83 content::WebIntentsDispatcher* intents_dispatcher); |
| 75 }; | 84 }; |
| 76 | 85 |
| 77 } // namespace extensions | 86 } // namespace extensions |
| 78 | 87 |
| 79 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_ | 88 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_ |
| OLD | NEW |