| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/renderer/blocked_plugin.h" | 5 #include "chrome/renderer/blocked_plugin.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| 11 #include "chrome/common/jstemplate_builder.h" | 11 #include "chrome/common/jstemplate_builder.h" |
| 12 #include "chrome/common/notification_service.h" | 12 #include "chrome/common/notification_service.h" |
| 13 #include "chrome/common/render_messages.h" |
| 13 #include "chrome/renderer/render_view.h" | 14 #include "chrome/renderer/render_view.h" |
| 14 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 15 #include "grit/renderer_resources.h" | 16 #include "grit/renderer_resources.h" |
| 16 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebData.h" |
| 17 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 18 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
| 18 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" | 19 #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" |
| 19 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 20 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
| 20 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 21 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
| 21 #include "webkit/glue/plugins/webview_plugin.h" | 22 #include "webkit/glue/plugins/webview_plugin.h" |
| 22 | 23 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 } | 85 } |
| 85 | 86 |
| 86 void BlockedPlugin::Load(const CppArgumentList& args, CppVariant* result) { | 87 void BlockedPlugin::Load(const CppArgumentList& args, CppVariant* result) { |
| 87 LoadPlugin(); | 88 LoadPlugin(); |
| 88 } | 89 } |
| 89 | 90 |
| 90 void BlockedPlugin::LoadPlugin() { | 91 void BlockedPlugin::LoadPlugin() { |
| 91 CHECK(plugin_); | 92 CHECK(plugin_); |
| 92 WebPluginContainer* container = plugin_->container(); | 93 WebPluginContainer* container = plugin_->container(); |
| 93 WebPlugin* new_plugin = | 94 WebPlugin* new_plugin = |
| 94 render_view_->CreatePluginInternal(frame_, | 95 render_view_->CreatePluginNoCheck(frame_, |
| 95 plugin_params_, | 96 plugin_params_); |
| 96 NULL, | |
| 97 std::string()); | |
| 98 if (new_plugin && new_plugin->initialize(container)) { | 97 if (new_plugin && new_plugin->initialize(container)) { |
| 99 container->setPlugin(new_plugin); | 98 container->setPlugin(new_plugin); |
| 100 plugin_->ReplayReceivedData(new_plugin); | 99 plugin_->ReplayReceivedData(new_plugin); |
| 101 container->invalidate(); | 100 container->invalidate(); |
| 102 container->reportGeometry(); | 101 container->reportGeometry(); |
| 103 plugin_->destroy(); | 102 plugin_->destroy(); |
| 103 render_view_->Send( |
| 104 new ViewHostMsg_BlockedPluginLoaded(render_view_->routing_id())); |
| 104 } | 105 } |
| 105 } | 106 } |
| OLD | NEW |