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

Unified Diff: content/public/browser/web_intents_dispatcher.h

Issue 9692017: An internal intents dispatcher useful for initiating an intent from the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve comments. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/web_intents_dispatcher.h
diff --git a/content/public/browser/web_intents_dispatcher.h b/content/public/browser/web_intents_dispatcher.h
index ccfdf524a75cebb05cf61435afa0ebce940ec237..87e982f2457dd00bdaa0c86bf69b16bab8b86a86 100644
--- a/content/public/browser/web_intents_dispatcher.h
+++ b/content/public/browser/web_intents_dispatcher.h
@@ -6,6 +6,7 @@
#define CONTENT_PUBLIC_BROWSER_WEB_INTENTS_DISPATCHER_H_
#include "base/callback.h"
+#include "content/common/content_export.h"
#include "webkit/glue/web_intent_reply_data.h"
namespace webkit_glue {
@@ -24,13 +25,14 @@ class WebContents;
// code can then read the intent data, create UI to pick the service, and
// create a new context for that service.
//
-// At that point, it should call DispatchIntent, which will connect the object
-// to the new context. If anything goes wrong, the client should call
-// SendReplyMessage with an error. That will self-delete the object.
+// At that point, it should call DispatchIntent, which will deliver the intent
+// to the new context. If anything goes wrong during setup, the client
+// should call SendReplyMessage with an error. The dispatcher lives until the
+// SendReplyMessage method is called, which will self-delete the object.
//
-// At that point, before the client may use the object again, it must register a
-// reply notification, so it can avoid referencing the dispatcher after other
-// code calls SendReplyMessage.
+// The client should also register a reply notification, so it can avoid
+// referencing the dispatcher after other code calls SendReplyMessage, which can
+// happen if, for example, the user closes the delivery context.
class CONTENT_EXPORT WebIntentsDispatcher {
public:
virtual ~WebIntentsDispatcher() {}
@@ -39,15 +41,17 @@ class CONTENT_EXPORT WebIntentsDispatcher {
virtual const webkit_glue::WebIntentData& GetIntent() = 0;
// Attach the intent to a new context in which the service page is loaded.
+ // |web_contents| cannot be null.
James Hawkins 2012/03/13 00:59:02 s/cannot/must not/ It actually *can* be null ;-)
James Hawkins 2012/03/13 00:59:02 s/null/NULL/
Greg Billock 2012/03/13 17:42:38 Done.
virtual void DispatchIntent(WebContents* web_contents) = 0;
// Return a success or failure message to the source context which invoked
// the intent. Deletes the object; it should not be used after this call
- // returns. Calls the reply notification, if registered.
+ // returns. Calls the reply notifications, if any are registered.
virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type,
const string16& data) = 0;
// Register a callback to be notified when SendReplyMessage is called.
+ // Multiple callbacks may be registered.
virtual void RegisterReplyNotification(
const base::Callback<void(webkit_glue::WebIntentReplyType)>& closure) = 0;
};

Powered by Google App Engine
This is Rietveld 408576698