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

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

Issue 8666013: Add a public content/ interface for intents. Use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/intents_host.h
diff --git a/content/public/browser/intents_host.h b/content/public/browser/intents_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..1a4108a3c52b7f79d915e4bacf3ee1f3b067cbc5
--- /dev/null
+++ b/content/public/browser/intents_host.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_INTENTS_HOST_H_
+#define CONTENT_PUBLIC_BROWSER_INTENTS_HOST_H_
+
+#include "base/callback.h"
+#include "webkit/glue/web_intent_reply_data.h"
+
+namespace webkit_glue {
+struct WebIntentData;
+}
+
+namespace content {
+
+// This class is the coordinator for dispatching web intents and seeing that
+// return messages are sent to the correct invoking context. The TabContents
+// for the invoking context will create one of these for each intent and hand
+// ownership to the client TabContentsDelegate code. The TabContentsDelegate
+// 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.
+class CONTENT_EXPORT IntentsHost {
+ public:
+ virtual ~IntentsHost() {}
+
+ // Get the intent data being dispatched.
+ virtual const webkit_glue::WebIntentData& intent() = 0;
jam 2011/11/23 21:00:00 nit: chrome style is to use CamelCaps for virtual
Greg Billock 2011/11/24 00:42:13 Done.
+
+ // Attach the intent to a new context in which the service is loaded.
+ virtual void DispatchIntent(TabContents* tab_contents) = 0;
+
+ // Return a success or failure message to the source context which invoked
+ // the intent.
+ virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type,
+ const string16& data) = 0;
+
+ // Register a callback to be notified when SendReplyMessage is called.
+ virtual void RegisterReplyNotification(const base::Closure& closure) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_INTENTS_HOST_H_
« content/browser/intents/intents_host_impl.h ('K') | « content/content_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698