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

Side by Side Diff: content/public/browser/intents_host.h

Issue 8666013: Add a public content/ interface for intents. Use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix IntentInjector; use TCO::tab_contents() Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 class TabContents;
12
13 namespace webkit_glue {
14 struct WebIntentData;
15 }
16
17 namespace content {
18
19 // This class is the coordinator for dispatching web intents and seeing that
20 // return messages are sent to the correct invoking context. The TabContents
21 // for the invoking context will create one of these for each intent and hand
22 // ownership to the client TabContentsDelegate code. The TabContentsDelegate
23 // code can then read the intent data, create UI to pick the service, and
24 // create a new context for that service. At that point, it should call
25 // DispatchIntent, which will connect the object to the new context.
26 class CONTENT_EXPORT IntentsHost {
27 public:
28 virtual ~IntentsHost() {}
James Hawkins 2011/11/29 02:57:55 Move to protected.
Greg Billock 2011/11/29 19:18:16 This object is created by the content API, but own
29
30 // Get the intent data being dispatched.
31 virtual const webkit_glue::WebIntentData& GetIntent() = 0;
32
33 // Attach the intent to a new context in which the service is loaded.
34 virtual void DispatchIntent(TabContents* tab_contents) = 0;
35
36 // Return a success or failure message to the source context which invoked
37 // the intent.
38 virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type,
39 const string16& data) = 0;
40
41 // Register a callback to be notified when SendReplyMessage is called.
42 virtual void RegisterReplyNotification(const base::Closure& closure) = 0;
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_PUBLIC_BROWSER_INTENTS_HOST_H_
OLDNEW
« content/browser/tab_contents/tab_contents_delegate.cc ('K') | « content/content_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698