OLD | NEW |
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/web_intents_dispatcher_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/browser/tab_contents/tab_contents.h" | 8 #include "content/browser/tab_contents/tab_contents.h" |
9 #include "content/common/intents_messages.h" | 9 #include "content/common/intents_messages.h" |
10 #include "webkit/glue/web_intent_data.h" | 10 #include "webkit/glue/web_intent_data.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 DCHECK(!intent_injector_); | 31 DCHECK(!intent_injector_); |
32 intent_injector_ = new IntentInjector(destination_tab); | 32 intent_injector_ = new IntentInjector(destination_tab); |
33 intent_injector_->SetIntent(this, intent_); | 33 intent_injector_->SetIntent(this, intent_); |
34 } | 34 } |
35 | 35 |
36 void WebIntentsDispatcherImpl::SendReplyMessage( | 36 void WebIntentsDispatcherImpl::SendReplyMessage( |
37 webkit_glue::WebIntentReplyType reply_type, | 37 webkit_glue::WebIntentReplyType reply_type, |
38 const string16& data) { | 38 const string16& data) { |
39 intent_injector_ = NULL; | 39 intent_injector_ = NULL; |
40 | 40 |
41 if (!tab_contents()) | 41 if (!web_contents()) |
42 return; | 42 return; |
43 | 43 |
44 Send(new IntentsMsg_WebIntentReply( | 44 Send(new IntentsMsg_WebIntentReply( |
45 routing_id(), reply_type, data, intent_id_)); | 45 routing_id(), reply_type, data, intent_id_)); |
46 if (!reply_notifier_.is_null()) | 46 if (!reply_notifier_.is_null()) |
47 reply_notifier_.Run(); | 47 reply_notifier_.Run(); |
48 } | 48 } |
49 | 49 |
50 void WebIntentsDispatcherImpl::RegisterReplyNotification( | 50 void WebIntentsDispatcherImpl::RegisterReplyNotification( |
51 const base::Closure& closure) { | 51 const base::Closure& closure) { |
52 reply_notifier_ = closure; | 52 reply_notifier_ = closure; |
53 } | 53 } |
54 | 54 |
55 void WebIntentsDispatcherImpl::WebContentsDestroyed(WebContents* tab) { | 55 void WebIntentsDispatcherImpl::WebContentsDestroyed(WebContents* tab) { |
56 if (intent_injector_) | 56 if (intent_injector_) |
57 intent_injector_->SourceWebContentsDestroyed(tab); | 57 intent_injector_->SourceWebContentsDestroyed(tab); |
58 | 58 |
59 intent_injector_ = NULL; | 59 intent_injector_ = NULL; |
60 } | 60 } |
OLD | NEW |