Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Side by Side Diff: chrome/browser/extensions/api/app/app_api.h

Issue 10828172: Allow platform apps to respond to Web Intents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Hooked up observing of source WebContents Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 WebContents;
15 class WebIntentsDispatcher;
15 } 16 }
16 17
17 namespace extensions { 18 namespace extensions {
18 19
19 class Extension; 20 class Extension;
20 21
21 class AppNotifyFunction : public SyncExtensionFunction { 22 class AppNotifyFunction : public SyncExtensionFunction {
22 public: 23 public:
23 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.notify"); 24 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.notify");
24 25
25 protected: 26 protected:
26 virtual ~AppNotifyFunction() {} 27 virtual ~AppNotifyFunction() {}
27 virtual bool RunImpl() OVERRIDE; 28 virtual bool RunImpl() OVERRIDE;
28 }; 29 };
29 30
30 class AppClearAllNotificationsFunction : public SyncExtensionFunction { 31 class AppClearAllNotificationsFunction : public SyncExtensionFunction {
31 public: 32 public:
32 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.clearAllNotifications"); 33 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.clearAllNotifications");
33 34
34 protected: 35 protected:
35 virtual ~AppClearAllNotificationsFunction() {} 36 virtual ~AppClearAllNotificationsFunction() {}
36 virtual bool RunImpl() OVERRIDE; 37 virtual bool RunImpl() OVERRIDE;
37 }; 38 };
38 39
40 class PostIntentResponseFunction : public SyncExtensionFunction {
41 public:
42 DECLARE_EXTENSION_FUNCTION_NAME("experimental.app.postIntentResponse");
43
44 protected:
45 virtual ~PostIntentResponseFunction() {}
46 virtual bool RunImpl() OVERRIDE;
47 };
48
39 class AppEventRouter { 49 class AppEventRouter {
40 public: 50 public:
41 // Dispatches the onLaunched event to the given app, providing no launch 51 // Dispatches the onLaunched event to the given app, providing no launch
42 // data. 52 // data.
43 static void DispatchOnLaunchedEvent(Profile* profile, 53 static void DispatchOnLaunchedEvent(Profile* profile,
44 const Extension* extension); 54 const Extension* extension);
45 55
46 // Dispatches the onLaunched event to the given app, providing launch data of 56 // Dispatches the onLaunched event to the given app, providing launch data of
47 // the form: 57 // the form:
48 // { 58 // {
(...skipping 15 matching lines...) Expand all
64 const string16& action, 74 const string16& action,
65 const std::string& file_system_id, 75 const std::string& file_system_id,
66 const std::string& base_name); 76 const std::string& base_name);
67 77
68 // Dispatches the onLaunched event to the app implemented by |extension| 78 // Dispatches the onLaunched event to the app implemented by |extension|
69 // running in |profile|. The event parameter launchData will have a field 79 // running in |profile|. The event parameter launchData will have a field
70 // called intent, populated by |web_intent_data|. 80 // called intent, populated by |web_intent_data|.
71 static void DispatchOnLaunchedEventWithWebIntent( 81 static void DispatchOnLaunchedEventWithWebIntent(
72 Profile* profile, 82 Profile* profile,
73 const Extension* extension, 83 const Extension* extension,
74 const webkit_glue::WebIntentData web_intent_data); 84 content::WebIntentsDispatcher* intents_dispatcher,
85 content::WebContents* source);
75 }; 86 };
76 87
77 } // namespace extensions 88 } // namespace extensions
78 89
79 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_ 90 #endif // CHROME_BROWSER_EXTENSIONS_API_APP_APP_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/app/app_api.cc » ('j') | chrome/browser/extensions/shell_window_registry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698