| 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/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include "content/port/browser/render_widget_host_view_port.h" | 7 #include "content/port/browser/render_widget_host_view_port.h" |
| 8 | 8 |
| 9 using content::RenderWidgetHostImpl; | 9 namespace content { |
| 10 | 10 |
| 11 void RenderWidgetHostImpl::OnMsgCreatePluginContainer( | 11 void RenderWidgetHostImpl::OnMsgCreatePluginContainer( |
| 12 gfx::PluginWindowHandle id) { | 12 gfx::PluginWindowHandle id) { |
| 13 // TODO(piman): view_ can only be NULL with delayed view creation in | 13 // TODO(piman): view_ can only be NULL with delayed view creation in |
| 14 // extensions (see ExtensionHost::CreateRenderViewSoon). Figure out how to | 14 // extensions (see ExtensionHost::CreateRenderViewSoon). Figure out how to |
| 15 // support plugins in that case. | 15 // support plugins in that case. |
| 16 if (view_) { | 16 if (view_) { |
| 17 view_->CreatePluginContainer(id); | 17 view_->CreatePluginContainer(id); |
| 18 } else { | 18 } else { |
| 19 deferred_plugin_handles_.push_back(id); | 19 deferred_plugin_handles_.push_back(id); |
| 20 } | 20 } |
| 21 } | 21 } |
| 22 | 22 |
| 23 void RenderWidgetHostImpl::OnMsgDestroyPluginContainer( | 23 void RenderWidgetHostImpl::OnMsgDestroyPluginContainer( |
| 24 gfx::PluginWindowHandle id) { | 24 gfx::PluginWindowHandle id) { |
| 25 if (view_) { | 25 if (view_) { |
| 26 view_->DestroyPluginContainer(id); | 26 view_->DestroyPluginContainer(id); |
| 27 } else { | 27 } else { |
| 28 for (int i = 0; | 28 for (int i = 0; |
| 29 i < static_cast<int>(deferred_plugin_handles_.size()); | 29 i < static_cast<int>(deferred_plugin_handles_.size()); |
| 30 i++) { | 30 i++) { |
| 31 if (deferred_plugin_handles_[i] == id) { | 31 if (deferred_plugin_handles_[i] == id) { |
| 32 deferred_plugin_handles_.erase(deferred_plugin_handles_.begin() + i); | 32 deferred_plugin_handles_.erase(deferred_plugin_handles_.begin() + i); |
| 33 i--; | 33 i--; |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 |
| 39 } // namespace content |
| OLD | NEW |