OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "content/browser/tab_contents/tab_contents_observer.h" |
| 10 #include "content/public/browser/intents_host.h" |
| 11 #include "webkit/glue/web_intent_data.h" |
| 12 |
| 13 class IntentInjector; |
| 14 |
| 15 class IntentsHostImpl : public content::IntentsHost, |
| 16 public TabContentsObserver { |
| 17 public: |
| 18 IntentsHostImpl(TabContents* source_tab, |
| 19 const webkit_glue::WebIntentData& intent, |
| 20 int intent_id); |
| 21 virtual ~IntentsHostImpl(); |
| 22 |
| 23 // Implement IntentsHost |
| 24 virtual const webkit_glue::WebIntentData& GetIntent() OVERRIDE; |
| 25 virtual void DispatchIntent(TabContents* tab_contents) OVERRIDE; |
| 26 virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type, |
| 27 const string16& data) OVERRIDE; |
| 28 virtual void RegisterReplyNotification(const base::Closure& closure) OVERRIDE; |
| 29 |
| 30 // Implement TabContentsObserver |
| 31 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; |
| 32 |
| 33 private: |
| 34 // Weak pointer to the tab invoking the intent. |
| 35 TabContents* source_tab_; |
| 36 |
| 37 // The intent data. |
| 38 webkit_glue::WebIntentData intent_; |
| 39 |
| 40 // The intent ID. |
| 41 int intent_id_; |
| 42 |
| 43 // Weak pointer to the internal object which provides the intent to the |
| 44 // newly-created service tab contents. This object is self-deleting |
| 45 // (connected to the service TabContents). |
| 46 IntentInjector* intent_injector_; |
| 47 |
| 48 // A callback to be notified when SendReplyMessage is called. |
| 49 base::Closure reply_notifier_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(IntentsHostImpl); |
| 52 }; |
| 53 |
| 54 #endif // CONTENT_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_ |
OLD | NEW |