| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/intents/internal_web_intents_dispatcher.h" |
| 8 #include "content/browser/tab_contents/tab_contents.h" | 9 #include "content/browser/tab_contents/tab_contents.h" |
| 9 #include "content/common/intents_messages.h" | 10 #include "content/common/intents_messages.h" |
| 10 #include "webkit/glue/web_intent_data.h" | 11 #include "webkit/glue/web_intent_data.h" |
| 11 #include "webkit/glue/web_intent_reply_data.h" | 12 #include "webkit/glue/web_intent_reply_data.h" |
| 12 | 13 |
| 13 using content::WebContents; | 14 using content::WebContents; |
| 14 | 15 |
| 16 namespace content { |
| 17 |
| 18 WebIntentsDispatcher* WebIntentsDispatcher::Create( |
| 19 const webkit_glue::WebIntentData& data) { |
| 20 return new InternalWebIntentsDispatcher(data); |
| 21 } |
| 22 |
| 23 } // namespace content |
| 24 |
| 25 |
| 15 WebIntentsDispatcherImpl::WebIntentsDispatcherImpl( | 26 WebIntentsDispatcherImpl::WebIntentsDispatcherImpl( |
| 16 TabContents* source_tab, | 27 TabContents* source_tab, |
| 17 const webkit_glue::WebIntentData& intent, | 28 const webkit_glue::WebIntentData& intent, |
| 18 int intent_id) | 29 int intent_id) |
| 19 : content::WebContentsObserver(source_tab), | 30 : content::WebContentsObserver(source_tab), |
| 20 intent_(intent), | 31 intent_(intent), |
| 21 intent_id_(intent_id), | 32 intent_id_(intent_id), |
| 22 intent_injector_(NULL) {} | 33 intent_injector_(NULL) {} |
| 23 | 34 |
| 24 WebIntentsDispatcherImpl::~WebIntentsDispatcherImpl() {} | 35 WebIntentsDispatcherImpl::~WebIntentsDispatcherImpl() {} |
| (...skipping 30 matching lines...) Expand all Loading... |
| 55 const content::WebIntentsDispatcher::ReplyNotification& closure) { | 66 const content::WebIntentsDispatcher::ReplyNotification& closure) { |
| 56 reply_notifiers_.push_back(closure); | 67 reply_notifiers_.push_back(closure); |
| 57 } | 68 } |
| 58 | 69 |
| 59 void WebIntentsDispatcherImpl::WebContentsDestroyed(WebContents* tab) { | 70 void WebIntentsDispatcherImpl::WebContentsDestroyed(WebContents* tab) { |
| 60 if (intent_injector_) | 71 if (intent_injector_) |
| 61 intent_injector_->SourceWebContentsDestroyed(tab); | 72 intent_injector_->SourceWebContentsDestroyed(tab); |
| 62 | 73 |
| 63 intent_injector_ = NULL; | 74 intent_injector_ = NULL; |
| 64 } | 75 } |
| OLD | NEW |