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/intent_injector.h" | 5 #include "content/browser/intents/intent_injector.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "content/common/content_switches.h" | |
11 #include "content/browser/renderer_host/render_view_host.h" | 10 #include "content/browser/renderer_host/render_view_host.h" |
12 #include "content/browser/tab_contents/tab_contents.h" | 11 #include "content/browser/tab_contents/tab_contents.h" |
| 12 #include "content/public/common/content_switches.h" |
13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
14 #include "webkit/glue/web_intent_data.h" | 14 #include "webkit/glue/web_intent_data.h" |
15 #include "webkit/glue/web_intent_reply_data.h" | 15 #include "webkit/glue/web_intent_reply_data.h" |
16 | 16 |
17 IntentInjector::IntentInjector(TabContents* tab_contents) | 17 IntentInjector::IntentInjector(TabContents* tab_contents) |
18 : TabContentsObserver(tab_contents), | 18 : TabContentsObserver(tab_contents), |
19 intent_id_(0) { | 19 intent_id_(0) { |
20 DCHECK(tab_contents); | 20 DCHECK(tab_contents); |
21 } | 21 } |
22 | 22 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 const string16& data, | 83 const string16& data, |
84 int intent_id) { | 84 int intent_id) { |
85 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) | 85 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
86 NOTREACHED(); | 86 NOTREACHED(); |
87 | 87 |
88 // TODO(gbillock): We need to observe source_tab_ and make | 88 // TODO(gbillock): We need to observe source_tab_ and make |
89 // sure it hasn't been closed or something... | 89 // sure it hasn't been closed or something... |
90 source_tab_->Send(new IntentsMsg_WebIntentReply( | 90 source_tab_->Send(new IntentsMsg_WebIntentReply( |
91 0, reply_type, data, intent_id)); | 91 0, reply_type, data, intent_id)); |
92 } | 92 } |
OLD | NEW |