OLD | NEW |
---|---|
(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 #include "base/callback.h" | |
James Hawkins
2012/03/12 23:19:11
nit: Blank line in between std includes and src in
Greg Billock
2012/03/12 23:52:22
Done.
| |
10 #include "base/compiler_specific.h" | |
11 #include "content/public/browser/web_intents_dispatcher.h" | |
12 #include "webkit/glue/web_intent_data.h" | |
13 | |
14 class IntentInjector; | |
15 | |
16 // This class implements a web intents coordinator object which originates | |
James Hawkins
2012/03/12 23:19:11
We use coordinator in the comment and dispatcher i
Greg Billock
2012/03/12 23:52:22
Reworded a bit.
| |
17 // within the browser process rather than with a particular renderer. | |
18 // It will terminate callbacks by notifying its delegate rather than returning | |
James Hawkins
2012/03/12 23:19:11
We should probably expand on some of the terminolo
James Hawkins
2012/03/12 23:19:11
Optional nit: "It" is less ambiguous in class-leve
Greg Billock
2012/03/12 23:52:22
Done.
Greg Billock
2012/03/12 23:52:22
Done.
| |
19 // those messages to a renderer. | |
20 class InternalWebIntentsDispatcher : public content::WebIntentsDispatcher { | |
21 public: | |
22 // |intent| is the intent payload to be dispatched. | |
23 explicit InternalWebIntentsDispatcher( | |
24 const webkit_glue::WebIntentData& intent); | |
25 | |
26 // |intent| is the intent payload to be dispatched. | |
27 // |reply_callback| is the callback to notify when the intent is replied to. | |
28 InternalWebIntentsDispatcher( | |
29 const webkit_glue::WebIntentData& intent, | |
30 base::Callback<void(webkit_glue::WebIntentReplyType, | |
James Hawkins
2012/03/12 23:19:11
typedef this.
Greg Billock
2012/03/12 23:52:22
Done.
| |
31 const string16&)> reply_callback); | |
32 | |
33 virtual ~InternalWebIntentsDispatcher(); | |
34 | |
35 // WebIntentsDispatcher implementation. | |
36 virtual const webkit_glue::WebIntentData& GetIntent() OVERRIDE; | |
37 virtual void DispatchIntent(content::WebContents* destination_tab) OVERRIDE; | |
38 virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type, | |
39 const string16& data) OVERRIDE; | |
40 virtual void RegisterReplyNotification( | |
41 const base::Callback<void(webkit_glue::WebIntentReplyType)>& | |
42 closure) OVERRIDE; | |
43 | |
44 private: | |
45 webkit_glue::WebIntentData intent_; | |
James Hawkins
2012/03/12 23:19:11
Document member variable.
Greg Billock
2012/03/12 23:52:22
Done.
| |
46 | |
47 // Weak pointer to the internal object which provides the intent to the | |
48 // newly-created service tab contents. This object is self-deleting | |
49 // (connected to the service TabContents). | |
50 IntentInjector* intent_injector_; | |
51 | |
52 // Callbacks to be notified when SendReplyMessage is called. | |
53 std::vector<base::Callback<void(webkit_glue::WebIntentReplyType)> > | |
54 reply_notifiers_; | |
55 | |
56 // Callback to be invoked when the intent is replied to. | |
57 base::Callback<void(webkit_glue::WebIntentReplyType, | |
58 const string16&)> reply_callback_; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(InternalWebIntentsDispatcher); | |
61 }; | |
62 | |
63 #endif // CONTENT_BROWSER_INTENTS_INTERNAL_WEB_INTENTS_DISPATCHER_H_ | |
OLD | NEW |