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

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

Issue 8934011: Rename IntentsHost -> WebIntentsDispatcher and IntentsDispatcher -> WebIntentsHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_INTENTS_WEB_INTENTS_DISPATCHER_IMPL_H_
6 #define CONTENT_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_INTENTS_WEB_INTENTS_DISPATCHER_IMPL_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "content/browser/tab_contents/tab_contents_observer.h" 10 #include "content/browser/tab_contents/tab_contents_observer.h"
11 #include "content/public/browser/intents_host.h" 11 #include "content/public/browser/web_intents_dispatcher.h"
12 #include "webkit/glue/web_intent_data.h" 12 #include "webkit/glue/web_intent_data.h"
13 13
14 class IntentInjector; 14 class IntentInjector;
15 15
16 // Implements the coordinator object interface for Web Intents. 16 // Implements the coordinator object interface for Web Intents.
17 // Observes the source (client) tab to make sure messages sent back by the 17 // Observes the source (client) tab to make sure messages sent back by the
18 // service can be delivered. Keeps a copy of triggering intent data to 18 // service can be delivered. Keeps a copy of triggering intent data to
19 // be delivered to the service and serves as a forwarder for sending reply 19 // be delivered to the service and serves as a forwarder for sending reply
20 // messages back to the client page. 20 // messages back to the client page.
21 class IntentsHostImpl : public content::IntentsHost, 21 class WebIntentsDispatcherImpl : public content::WebIntentsDispatcher,
22 public TabContentsObserver { 22 public TabContentsObserver {
23 public: 23 public:
24 // |source_tab| is the page which triggered the web intent. 24 // |source_tab| is the page which triggered the web intent.
25 // |intent| is the intent payload created by that page. 25 // |intent| is the intent payload created by that page.
26 // |intent_id| is the identifier assigned by WebKit to direct replies back to 26 // |intent_id| is the identifier assigned by WebKit to direct replies back to
27 // the correct Javascript callback. 27 // the correct Javascript callback.
28 IntentsHostImpl(TabContents* source_tab, 28 WebIntentsDispatcherImpl(TabContents* source_tab,
29 const webkit_glue::WebIntentData& intent, 29 const webkit_glue::WebIntentData& intent,
30 int intent_id); 30 int intent_id);
31 virtual ~IntentsHostImpl(); 31 virtual ~WebIntentsDispatcherImpl();
32 32
33 // IntentsHost implementation 33 // WebIntentsDispatcher implementation.
34 virtual const webkit_glue::WebIntentData& GetIntent() OVERRIDE; 34 virtual const webkit_glue::WebIntentData& GetIntent() OVERRIDE;
35 virtual void DispatchIntent(TabContents* destination_tab) OVERRIDE; 35 virtual void DispatchIntent(TabContents* destination_tab) OVERRIDE;
36 virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type, 36 virtual void SendReplyMessage(webkit_glue::WebIntentReplyType reply_type,
37 const string16& data) OVERRIDE; 37 const string16& data) OVERRIDE;
38 virtual void RegisterReplyNotification(const base::Closure& closure) OVERRIDE; 38 virtual void RegisterReplyNotification(const base::Closure& closure) OVERRIDE;
39 39
40 // TabContentsObserver implementation 40 // TabContentsObserver implementation.
41 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE; 41 virtual void TabContentsDestroyed(TabContents* tab) OVERRIDE;
42 42
43 private: 43 private:
44 webkit_glue::WebIntentData intent_; 44 webkit_glue::WebIntentData intent_;
45 45
46 int intent_id_; 46 int intent_id_;
47 47
48 // Weak pointer to the internal object which provides the intent to the 48 // Weak pointer to the internal object which provides the intent to the
49 // newly-created service tab contents. This object is self-deleting 49 // newly-created service tab contents. This object is self-deleting
50 // (connected to the service TabContents). 50 // (connected to the service TabContents).
51 IntentInjector* intent_injector_; 51 IntentInjector* intent_injector_;
52 52
53 // A callback to be notified when SendReplyMessage is called. 53 // A callback to be notified when SendReplyMessage is called.
54 base::Closure reply_notifier_; 54 base::Closure reply_notifier_;
55 55
56 DISALLOW_COPY_AND_ASSIGN(IntentsHostImpl); 56 DISALLOW_COPY_AND_ASSIGN(WebIntentsDispatcherImpl);
57 }; 57 };
58 58
59 #endif // CONTENT_BROWSER_INTENTS_INTENTS_HOST_IMPL_H_ 59 #endif // CONTENT_BROWSER_INTENTS_WEB_INTENTS_DISPATCHER_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/intents/intents_host_impl.cc ('k') | content/browser/intents/web_intents_dispatcher_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698