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/browser_plugin/browser_plugin_message_filter.h" | 5 #include "content/browser/browser_plugin/browser_plugin_message_filter.h" |
6 | 6 |
7 #include "base/supports_user_data.h" | 7 #include "base/supports_user_data.h" |
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 8 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
9 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
11 #include "content/common/browser_plugin/browser_plugin_constants.h" | 11 #include "content/common/browser_plugin/browser_plugin_constants.h" |
12 #include "content/common/browser_plugin/browser_plugin_messages.h" | 12 #include "content/common/browser_plugin/browser_plugin_messages.h" |
13 #include "content/common/view_messages.h" | 13 #include "content/common/view_messages.h" |
14 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 BrowserPluginMessageFilter::BrowserPluginMessageFilter(int render_process_id, | 20 BrowserPluginMessageFilter::BrowserPluginMessageFilter(int render_process_id, |
21 bool is_guest) | 21 bool is_guest) |
22 : BrowserMessageFilter(BrowserPluginMsgStart), | 22 : render_process_id_(render_process_id), |
23 render_process_id_(render_process_id), | |
24 is_guest_(is_guest) { | 23 is_guest_(is_guest) { |
25 } | 24 } |
26 | 25 |
27 BrowserPluginMessageFilter::~BrowserPluginMessageFilter() { | 26 BrowserPluginMessageFilter::~BrowserPluginMessageFilter() { |
28 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
29 } | 28 } |
30 | 29 |
31 bool BrowserPluginMessageFilter::OnMessageReceived( | 30 bool BrowserPluginMessageFilter::OnMessageReceived( |
32 const IPC::Message& message, | 31 const IPC::Message& message, |
33 bool* message_was_ok) { | 32 bool* message_was_ok) { |
(...skipping 30 matching lines...) Expand all Loading... |
64 if (!host) | 63 if (!host) |
65 return NULL; | 64 return NULL; |
66 | 65 |
67 BrowserContext* browser_context = host->GetBrowserContext(); | 66 BrowserContext* browser_context = host->GetBrowserContext(); |
68 return static_cast<BrowserPluginGuestManager*>( | 67 return static_cast<BrowserPluginGuestManager*>( |
69 browser_context->GetUserData( | 68 browser_context->GetUserData( |
70 browser_plugin::kBrowserPluginGuestManagerKeyName)); | 69 browser_plugin::kBrowserPluginGuestManagerKeyName)); |
71 } | 70 } |
72 | 71 |
73 } // namespace content | 72 } // namespace content |
OLD | NEW |