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/internal_web_intents_dispatcher.h" | 5 #include "content/browser/intents/internal_web_intents_dispatcher.h" |
6 | 6 |
7 #include "content/browser/intents/intent_injector.h" | 7 #include "content/browser/intents/intent_injector.h" |
| 8 #include "content/public/browser/web_contents.h" |
| 9 #include "content/public/browser/web_contents_delegate.h" |
8 #include "webkit/glue/web_intent_data.h" | 10 #include "webkit/glue/web_intent_data.h" |
9 #include "webkit/glue/web_intent_reply_data.h" | 11 #include "webkit/glue/web_intent_reply_data.h" |
10 | 12 |
11 using content::WebContents; | 13 using content::WebContents; |
12 | 14 |
| 15 namespace content { |
| 16 |
| 17 content::WebIntentsDispatcher* WebIntentsDispatcher::Create( |
| 18 const webkit_glue::WebIntentData& data) { |
| 19 return new InternalWebIntentsDispatcher(data); |
| 20 } |
| 21 |
| 22 // InternalWebIntentsDispatcher |
| 23 |
13 InternalWebIntentsDispatcher::InternalWebIntentsDispatcher( | 24 InternalWebIntentsDispatcher::InternalWebIntentsDispatcher( |
14 const webkit_glue::WebIntentData& intent) | 25 const webkit_glue::WebIntentData& intent) |
15 : intent_(intent), | 26 : intent_(intent), |
16 intent_injector_(NULL) {} | 27 intent_injector_(NULL) {} |
17 | 28 |
18 InternalWebIntentsDispatcher::InternalWebIntentsDispatcher( | 29 InternalWebIntentsDispatcher::InternalWebIntentsDispatcher( |
19 const webkit_glue::WebIntentData& intent, | 30 const webkit_glue::WebIntentData& intent, |
20 const ReplyCallback& reply_callback) | 31 const ReplyCallback& reply_callback) |
21 : intent_(intent), | 32 : intent_(intent), |
22 intent_injector_(NULL), | 33 intent_injector_(NULL), |
(...skipping 27 matching lines...) Expand all Loading... |
50 if (!reply_callback_.is_null()) | 61 if (!reply_callback_.is_null()) |
51 reply_callback_.Run(reply_type, data); | 62 reply_callback_.Run(reply_type, data); |
52 | 63 |
53 delete this; | 64 delete this; |
54 } | 65 } |
55 | 66 |
56 void InternalWebIntentsDispatcher::RegisterReplyNotification( | 67 void InternalWebIntentsDispatcher::RegisterReplyNotification( |
57 const content::WebIntentsDispatcher::ReplyNotification& closure) { | 68 const content::WebIntentsDispatcher::ReplyNotification& closure) { |
58 reply_notifiers_.push_back(closure); | 69 reply_notifiers_.push_back(closure); |
59 } | 70 } |
| 71 |
| 72 } // namespace content |
OLD | NEW |