Chromium Code Reviews| Index: content/renderer/browser_plugin/browser_plugin_manager.cc |
| diff --git a/content/renderer/browser_plugin/browser_plugin_manager.cc b/content/renderer/browser_plugin/browser_plugin_manager.cc |
| index 4cc34267f413379186962e346a1a49a0f68cfe34..fa7cdf0d38851a2ae1566bdf4fb51374fd561c10 100644 |
| --- a/content/renderer/browser_plugin/browser_plugin_manager.cc |
| +++ b/content/renderer/browser_plugin/browser_plugin_manager.cc |
| @@ -6,8 +6,9 @@ |
| #include "base/lazy_instance.h" |
| #include "base/threading/thread_local.h" |
| +#include "content/common/browser_plugin_messages.h" |
| #include "content/public/renderer/render_thread.h" |
| -#include "content/renderer/browser_plugin/browser_plugin.h" |
| +#include "content/renderer/browser_plugin/browser_plugin_impl.h" |
| #include "content/renderer/browser_plugin/browser_plugin_manager_factory.h" |
| #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h" |
| @@ -34,7 +35,7 @@ BrowserPluginManager::~BrowserPluginManager() { |
| void BrowserPluginManager::AddBrowserPlugin( |
| int instance_id, |
| - BrowserPlugin* browser_plugin) { |
| + BrowserPluginImpl* browser_plugin) { |
| instances_.AddWithID(browser_plugin, instance_id); |
| } |
| @@ -42,19 +43,47 @@ void BrowserPluginManager::RemoveBrowserPlugin(int instance_id) { |
| instances_.Remove(instance_id); |
| } |
| -BrowserPlugin* BrowserPluginManager::GetBrowserPlugin(int instance_id) const { |
| +BrowserPluginImpl* BrowserPluginManager::GetBrowserPlugin( |
| + int instance_id) const { |
| return instances_.Lookup(instance_id); |
| } |
| void BrowserPluginManager::SetEmbedderFocus(const RenderViewImpl* embedder, |
| bool focused) { |
| - IDMap<BrowserPlugin>::iterator iter(&instances_); |
| + IDMap<BrowserPluginImpl>::iterator iter(&instances_); |
| while (!iter.IsAtEnd()) { |
| - BrowserPlugin* browser_plugin = iter.GetCurrentValue(); |
| + BrowserPluginImpl* browser_plugin = iter.GetCurrentValue(); |
| if (browser_plugin->render_view() == embedder) |
| browser_plugin->SetEmbedderFocus(focused); |
| iter.Advance(); |
| } |
| } |
| +void BrowserPluginManager::RequestMessage(uint32 message_id) { |
| + browser_plugin_messages_.insert(message_id); |
| +} |
| + |
| +bool BrowserPluginManager::ShouldForwardToBrowserPlugin( |
| + const IPC::Message& message) { |
| + switch (message.type()) { |
| + case BrowserPluginMsg_AdvanceFocus::ID: |
| + case BrowserPluginMsg_GuestContentWindowReady::ID: |
| + case BrowserPluginMsg_GuestGone::ID: |
| + case BrowserPluginMsg_GuestResponsive::ID: |
| + case BrowserPluginMsg_GuestUnresponsive::ID: |
| + case BrowserPluginMsg_LoadAbort::ID: |
| + case BrowserPluginMsg_LoadCommit::ID: |
| + case BrowserPluginMsg_LoadRedirect::ID: |
| + case BrowserPluginMsg_LoadStart::ID: |
| + case BrowserPluginMsg_LoadStop::ID: |
| + case BrowserPluginMsg_SetCursor::ID: |
| + case BrowserPluginMsg_ShouldAcceptTouchEvents::ID: |
| + case BrowserPluginMsg_UpdateRect::ID: |
|
sadrul
2013/01/09 15:21:54
Can this default set of messages be added to brows
Fady Samuel
2013/01/09 17:41:24
Done.
|
| + return true; |
| + default: |
| + break; |
| + } |
| + return browser_plugin_messages_.count(message.type()); |
| +} |
| + |
| } // namespace content |