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

Side by Side Diff: content/browser/intents/intents_host_impl.cc

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
(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 #include "content/browser/intents/intents_host_impl.h"
6
7 #include "content/browser/intents/intent_injector.h"
8 #include "content/common/intents_messages.h"
9 #include "webkit/glue/web_intent_data.h"
10 #include "webkit/glue/web_intent_reply_data.h"
11
12 IntentsHostImpl::IntentsHostImpl(TabContents* source_tab,
13 const webkit_glue::WebIntentData& intent,
14 int intent_id)
15 : TabContentsObserver(source_tab),
16 intent_(intent),
17 intent_id_(intent_id),
18 intent_injector_(NULL) {}
19
20 IntentsHostImpl::~IntentsHostImpl() {}
21
22 const webkit_glue::WebIntentData& IntentsHostImpl::GetIntent() {
23 return intent_;
24 }
25
26 void IntentsHostImpl::DispatchIntent(TabContents* destination_tab) {
27 DCHECK(!intent_injector_);
28 intent_injector_ = new IntentInjector(destination_tab);
29 intent_injector_->SetIntent(this, intent_);
30 }
31
32 void IntentsHostImpl::SendReplyMessage(
33 webkit_glue::WebIntentReplyType reply_type,
34 const string16& data) {
35 intent_injector_ = NULL;
36
37 if (!tab_contents())
38 return;
39
40 Send(new IntentsMsg_WebIntentReply(
41 routing_id(), reply_type, data, intent_id_));
42 if (!reply_notifier_.is_null())
43 reply_notifier_.Run();
44 }
45
46 void IntentsHostImpl::RegisterReplyNotification(const base::Closure& closure) {
47 reply_notifier_ = closure;
48 }
49
50 void IntentsHostImpl::TabContentsDestroyed(TabContents* tab) {
51 if (intent_injector_)
52 intent_injector_->SourceTabContentsDestroyed(tab);
53
54 intent_injector_ = NULL;
55 }
OLDNEW
« no previous file with comments | « content/browser/intents/intents_host_impl.h ('k') | content/browser/intents/web_intents_dispatcher_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698