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_PUBLIC_BROWSER_INTENTS_HOST_H_ | |
| 6 #define CONTENT_PUBLIC_BROWSER_INTENTS_HOST_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "webkit/glue/web_intent_reply_data.h" | |
| 10 | |
| 11 namespace webkit_glue { | |
| 12 struct WebIntentData; | |
| 13 } | |
| 14 | |
| 15 namespace content { | |
| 16 | |
| 17 // This class is the coordinator for dispatching web intents and seeing that | |
| 18 // return messages are sent to the correct invoking context. The TabContents | |
| 19 // for the invoking context will create one of these for each intent and hand | |
| 20 // ownership to the client TabContentsDelegate code. The TabContentsDelegate | |
| 21 // code can then read the intent data, create UI to pick the service, and | |
| 22 // create a new context for that service. At that point, it should call | |
| 23 // DispatchIntent, which will connect the object to the new context. | |
| 24 class CONTENT_EXPORT IntentsHost { | |
| 25 public: | |
| 26 virtual ~IntentsHost() {} | |
| 27 | |
| 28 // Get the intent data being dispatched. | |
| 29 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.
| |
| 30 | |
| 31 // Attach the intent to a new context in which the service is loaded. | |
| 32 virtual void DispatchIntent(TabContents* tab_contents) = 0; | |
| 33 | |
| 34 // Return a success or failure message to the source context which invoked | |
| 35 // the intent. | |
| 36 virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type, | |
| 37 const string16& data) = 0; | |
| 38 | |
| 39 // Register a callback to be notified when SendReplyMessage is called. | |
| 40 virtual void RegisterReplyNotification(const base::Closure& closure) = 0; | |
| 41 }; | |
| 42 | |
| 43 } // namespace content | |
| 44 | |
| 45 #endif // CONTENT_PUBLIC_BROWSER_INTENTS_HOST_H_ | |
| OLD | NEW |