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

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

Issue 12225076: Delete most web intents code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 "base/gtest_prod_util.h"
13 #include "content/public/browser/web_intents_dispatcher.h"
14 #include "webkit/glue/web_intent_data.h"
15
16 namespace content {
17 class IntentInjector;
18
19 // This class implements a web intents dispatcher which originates
20 // within the browser process rather than with a particular renderer.
21 // The implementation handles replies to the web intents invocation by
22 // notifying a registered callback rather than returning
23 // those messages to any renderer.
24 class CONTENT_EXPORT InternalWebIntentsDispatcher
25 : public WebIntentsDispatcher {
26 public:
27 // This callback will be called during, and receives the same args as,
28 // |SendReplyMessage|.
29 typedef base::Callback<void(const webkit_glue::WebIntentReply&)>
30 ReplyCallback;
31
32 // |intent| is the intent payload to be dispatched.
33 explicit InternalWebIntentsDispatcher(
34 const webkit_glue::WebIntentData& intent);
35
36 // |intent| is the intent payload to be dispatched.
37 // |reply_callback| is the callback to notify when the intent is replied to.
38 InternalWebIntentsDispatcher(
39 const webkit_glue::WebIntentData& intent,
40 const ReplyCallback& reply_callback);
41
42 virtual ~InternalWebIntentsDispatcher();
43
44 // WebIntentsDispatcher implementation.
45 virtual const webkit_glue::WebIntentData& GetIntent() OVERRIDE;
46 virtual void DispatchIntent(WebContents* destination_contents) OVERRIDE;
47 virtual void ResetDispatch() OVERRIDE;
48 virtual void SendReply(const webkit_glue::WebIntentReply& reply) OVERRIDE;
49 virtual void RegisterReplyNotification(
50 const WebIntentsDispatcher::ReplyNotification& closure) OVERRIDE;
51
52 private:
53 FRIEND_TEST_ALL_PREFIXES(InternalWebIntentsDispatcherTest,
54 CancelAbandonsInjector);
55 // The intent data to be delivered.
56 webkit_glue::WebIntentData intent_;
57
58 // Weak pointer to the internal object which delivers the intent to the
59 // newly-created service WebContents. This object is self-deleting
60 // (connected to the service WebContents).
61 IntentInjector* intent_injector_;
62
63 // Callbacks to be notified when SendReplyMessage is called.
64 std::vector<WebIntentsDispatcher::ReplyNotification> reply_notifiers_;
65
66 // Callback to be invoked when the intent is replied to.
67 ReplyCallback reply_callback_;
68
69 DISALLOW_COPY_AND_ASSIGN(InternalWebIntentsDispatcher);
70 };
71
72 } // namespace content
73
74 #endif // CONTENT_BROWSER_INTENTS_INTERNAL_WEB_INTENTS_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/browser/intents/intent_injector_unittest.cc ('k') | content/browser/intents/internal_web_intents_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698