Chromium Code Reviews| 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 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.
| |
| 15 | |
| 16 class IntentsHostImpl : public content::IntentsHost, | |
| 17 public TabContentsObserver { | |
| 18 public: | |
| 19 IntentsHostImpl(TabContents* source_tab, | |
| 20 const webkit_glue::WebIntentData& intent, | |
| 21 int intent_id); | |
| 22 virtual ~IntentsHostImpl(); | |
| 23 | |
| 24 // Implement IntentsHost | |
| 25 virtual const webkit_glue::WebIntentData& intent() OVERRIDE; | |
| 26 virtual void DispatchIntent(TabContents* tab_contents) OVERRIDE; | |
| 27 virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type, | |
| 28 const string16& data) OVERRIDE; | |
| 29 virtual void RegisterReplyNotification(const base::Closure& closure) OVERRIDE; | |
| 30 | |
| 31 // Implement TabContentsObserver | |
| 32 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; | |
| 33 | |
| 34 private: | |
| 35 // Weak pointer to the tab invoking the intent. | |
| 36 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
| |
| 37 | |
| 38 // The intent data. | |
| 39 webkit_glue::WebIntentData intent_; | |
| 40 | |
| 41 // The intent ID. | |
| 42 int intent_id_; | |
| 43 | |
| 44 // Weak pointer to the internal object which provides the intent to the | |
| 45 // newly-created service tab contents. This object is self-deleting | |
| 46 // (connected to the service TabContents). | |
| 47 IntentInjector* intent_injector_; | |
| 48 | |
| 49 // A callback to be notified when SendReplyMessage is called. | |
| 50 base::Closure reply_notifier_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(IntentsHostImpl); | |
| 53 }; | |
| 54 | |
| 55 #endif // CONTENT_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_ | |
| OLD | NEW |