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