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

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

Powered by Google App Engine
This is Rietveld 408576698