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 CONTENT_PUBLIC_BROWSER_WEB_INTENTS_DISPATCHER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_INTENTS_DISPATCHER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_INTENTS_DISPATCHER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_INTENTS_DISPATCHER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "webkit/glue/web_intent_reply_data.h" | 10 #include "webkit/glue/web_intent_reply_data.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // Get the intent data being dispatched. | 51 // Get the intent data being dispatched. |
52 virtual const webkit_glue::WebIntentData& GetIntent() = 0; | 52 virtual const webkit_glue::WebIntentData& GetIntent() = 0; |
53 | 53 |
54 // Attach the intent to a new context in which the service page is loaded. | 54 // Attach the intent to a new context in which the service page is loaded. |
55 // |web_contents| must not be NULL. | 55 // |web_contents| must not be NULL. |
56 virtual void DispatchIntent(WebContents* web_contents) = 0; | 56 virtual void DispatchIntent(WebContents* web_contents) = 0; |
57 | 57 |
58 // Abandon current attempt to dispatch, allow new call to DispatchIntent. | 58 // Abandon current attempt to dispatch, allow new call to DispatchIntent. |
59 virtual void ResetDispatch() = 0; | 59 virtual void ResetDispatch() = 0; |
60 | 60 |
61 // Deprecated. Use SendReply. | |
62 virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type, | |
63 const string16& data) = 0; | |
64 | |
65 // Return a reply to the source context which invoked the intent. | 61 // Return a reply to the source context which invoked the intent. |
66 // Calls the reply notifications, if any are registered. | 62 // Calls the reply notifications, if any are registered. |
67 // Deletes |this| object after handling is complete. | 63 // Deletes |this| object after handling is complete. |
68 virtual void SendReply(const webkit_glue::WebIntentReply& reply) = 0; | 64 virtual void SendReply(const webkit_glue::WebIntentReply& reply) = 0; |
69 | 65 |
70 // Register a callback to be notified when SendReplyMessage is called. | 66 // Register a callback to be notified when SendReplyMessage is called. |
71 // Multiple callbacks may be registered. | 67 // Multiple callbacks may be registered. |
72 virtual void RegisterReplyNotification(const ReplyNotification& closure) = 0; | 68 virtual void RegisterReplyNotification(const ReplyNotification& closure) = 0; |
73 }; | 69 }; |
74 | 70 |
75 } // namespace content | 71 } // namespace content |
76 | 72 |
77 #endif // CONTENT_PUBLIC_BROWSER_WEB_INTENTS_DISPATCHER_H_ | 73 #endif // CONTENT_PUBLIC_BROWSER_WEB_INTENTS_DISPATCHER_H_ |
OLD | NEW |