Chromium Code Reviews| 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_ |