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 |
13 InternalWebIntentsDispatcher::InternalWebIntentsDispatcher( | 15 InternalWebIntentsDispatcher::InternalWebIntentsDispatcher( |
14 const webkit_glue::WebIntentData& intent) | 16 const webkit_glue::WebIntentData& intent) |
15 : intent_(intent), | 17 : intent_(intent), |
16 intent_injector_(NULL) {} | 18 intent_injector_(NULL) {} |
17 | 19 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 if (!reply_callback_.is_null()) | 52 if (!reply_callback_.is_null()) |
51 reply_callback_.Run(reply_type, data); | 53 reply_callback_.Run(reply_type, data); |
52 | 54 |
53 delete this; | 55 delete this; |
54 } | 56 } |
55 | 57 |
56 void InternalWebIntentsDispatcher::RegisterReplyNotification( | 58 void InternalWebIntentsDispatcher::RegisterReplyNotification( |
57 const content::WebIntentsDispatcher::ReplyNotification& closure) { | 59 const content::WebIntentsDispatcher::ReplyNotification& closure) { |
58 reply_notifiers_.push_back(closure); | 60 reply_notifiers_.push_back(closure); |
59 } | 61 } |
| 62 |
| 63 namespace content { |
| 64 |
| 65 void DispatchInternalIntent(const webkit_glue::WebIntentData& data, |
| 66 WebContents* target) { |
| 67 WebIntentsDispatcher* dispatcher = new InternalWebIntentsDispatcher(data); |
| 68 target->GetDelegate()->WebIntentDispatch(target, dispatcher); |
| 69 } |
| 70 |
| 71 } // namespace content |
OLD | NEW |