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

Unified Diff: content/browser/intents/intents_host_impl.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/browser/intents/intents_host_impl.h
diff --git a/content/browser/intents/intents_host_impl.h b/content/browser/intents/intents_host_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..ec600dd31a5c1160b0534a6f684d65969892a998
--- /dev/null
+++ b/content/browser/intents/intents_host_impl.h
@@ -0,0 +1,55 @@
+// 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_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_
+#define CONTENT_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_
+
+#include "base/callback.h"
+#include "content/browser/tab_contents/tab_contents_observer.h"
+#include "content/public/browser/intents_host.h"
+#include "webkit/glue/web_intent_data.h"
+
+class IntentInjector;
+class TabContents;
jam 2011/11/23 21:00:00 nit: not needed since this is a TabContentsObserve
Greg Billock 2011/11/24 00:42:13 Done.
+
+class IntentsHostImpl : public content::IntentsHost,
+ public TabContentsObserver {
+ public:
+ IntentsHostImpl(TabContents* source_tab,
+ const webkit_glue::WebIntentData& intent,
+ int intent_id);
+ virtual ~IntentsHostImpl();
+
+ // Implement IntentsHost
+ virtual const webkit_glue::WebIntentData& intent() OVERRIDE;
+ virtual void DispatchIntent(TabContents* tab_contents) OVERRIDE;
+ virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type,
+ const string16& data) OVERRIDE;
+ virtual void RegisterReplyNotification(const base::Closure& closure) OVERRIDE;
+
+ // Implement TabContentsObserver
+ virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE;
+
+ private:
+ // Weak pointer to the tab invoking the intent.
+ TabContents* source_tab_;
jam 2011/11/23 21:00:00 nit: not needed, TabContentsObserver has a tab_con
Greg Billock 2011/11/24 00:42:13 Yes. I'm using value=null to also flag a "should I
jam 2011/11/24 21:27:50 tab_contents() will return NULL after TabContentsD
Greg Billock 2011/11/29 00:19:55 Good point. It's documented in the API and everyth
+
+ // The intent data.
+ webkit_glue::WebIntentData intent_;
+
+ // The intent ID.
+ int intent_id_;
+
+ // Weak pointer to the internal object which provides the intent to the
+ // newly-created service tab contents. This object is self-deleting
+ // (connected to the service TabContents).
+ IntentInjector* intent_injector_;
+
+ // A callback to be notified when SendReplyMessage is called.
+ base::Closure reply_notifier_;
+
+ DISALLOW_COPY_AND_ASSIGN(IntentsHostImpl);
+};
+
+#endif // CONTENT_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698