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

Side by Side Diff: content/browser/intents/internal_web_intents_dispatcher.h

Issue 9692017: An internal intents dispatcher useful for initiating an intent from the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add typedef Created 8 years, 9 months 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) 2012 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_INTERNAL_WEB_INTENTS_DISPATCHER_H_
6 #define CONTENT_BROWSER_INTENTS_INTERNAL_WEB_INTENTS_DISPATCHER_H_
7
8 #include <vector>
9
10 #include "base/callback.h"
11 #include "base/compiler_specific.h"
12 #include "content/public/browser/web_intents_dispatcher.h"
13 #include "webkit/glue/web_intent_data.h"
14
15 class IntentInjector;
16
17 // This class implements a web intents dispatcher which originates
18 // within the browser process rather than with a particular renderer.
19 // The implementation handles replies to the web intents invocation by
20 // notifying a registered callback rather than returning
21 // those messages to any renderer.
22 class InternalWebIntentsDispatcher : public content::WebIntentsDispatcher {
23 public:
24 typedef base::Callback<void(webkit_glue::WebIntentReplyType,
25 const string16&)> ReplyCallback;
James Hawkins 2012/03/13 20:15:44 Document the callback and parameters.
Greg Billock 2012/03/13 20:34:42 Done.
26
27 // |intent| is the intent payload to be dispatched.
28 explicit InternalWebIntentsDispatcher(
29 const webkit_glue::WebIntentData& intent);
30
31 // |intent| is the intent payload to be dispatched.
32 // |reply_callback| is the callback to notify when the intent is replied to.
33 InternalWebIntentsDispatcher(
34 const webkit_glue::WebIntentData& intent,
35 ReplyCallback reply_callback);
James Hawkins 2012/03/13 20:15:44 const&
Greg Billock 2012/03/13 20:34:42 Done.
36
37 virtual ~InternalWebIntentsDispatcher();
38
39 // WebIntentsDispatcher implementation.
40 virtual const webkit_glue::WebIntentData& GetIntent() OVERRIDE;
41 virtual void DispatchIntent(content::WebContents* destination_tab) OVERRIDE;
42 virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type,
43 const string16& data) OVERRIDE;
44 virtual void RegisterReplyNotification(
45 const content::WebIntentsDispatcher::ReplyNotification& closure) OVERRIDE;
46
47 private:
48 // The intent data to be delivered.
49 webkit_glue::WebIntentData intent_;
50
51 // Weak pointer to the internal object which provides the intent to the
James Hawkins 2012/03/13 20:15:44 When I read "provides" I thought it meant "provide
Greg Billock 2012/03/13 20:34:42 Done.
52 // newly-created service tab contents. This object is self-deleting
53 // (connected to the service TabContents).
54 IntentInjector* intent_injector_;
55
56 // Callbacks to be notified when SendReplyMessage is called.
57 std::vector<content::WebIntentsDispatcher::ReplyNotification>
58 reply_notifiers_;
59
60 // Callback to be invoked when the intent is replied to.
61 ReplyCallback reply_callback_;
62
63 DISALLOW_COPY_AND_ASSIGN(InternalWebIntentsDispatcher);
64 };
65
66 #endif // CONTENT_BROWSER_INTENTS_INTERNAL_WEB_INTENTS_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698