| 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/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 GURL(kBlockedPluginDataURL)); | 59 GURL(kBlockedPluginDataURL)); |
| 60 | 60 |
| 61 registrar_.Add(this, | 61 registrar_.Add(this, |
| 62 NotificationType::SHOULD_LOAD_PLUGINS, | 62 NotificationType::SHOULD_LOAD_PLUGINS, |
| 63 NotificationService::AllSources()); | 63 NotificationService::AllSources()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 BlockedPlugin::~BlockedPlugin() {} | 66 BlockedPlugin::~BlockedPlugin() {} |
| 67 | 67 |
| 68 void BlockedPlugin::BindWebFrame(WebFrame* frame) { | 68 void BlockedPlugin::BindWebFrame(WebFrame* frame) { |
| 69 BindToJavascript(frame, L"plugin"); | 69 BindToJavascript(frame, "plugin"); |
| 70 BindMethod("load", &BlockedPlugin::Load); | 70 BindMethod("load", &BlockedPlugin::Load); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void BlockedPlugin::WillDestroyPlugin() { | 73 void BlockedPlugin::WillDestroyPlugin() { |
| 74 delete this; | 74 delete this; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void BlockedPlugin::Observe(NotificationType type, | 77 void BlockedPlugin::Observe(NotificationType type, |
| 78 const NotificationSource& source, | 78 const NotificationSource& source, |
| 79 const NotificationDetails& details) { | 79 const NotificationDetails& details) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 95 render_view_->CreatePluginNoCheck(frame_, | 95 render_view_->CreatePluginNoCheck(frame_, |
| 96 plugin_params_); | 96 plugin_params_); |
| 97 if (new_plugin && new_plugin->initialize(container)) { | 97 if (new_plugin && new_plugin->initialize(container)) { |
| 98 container->setPlugin(new_plugin); | 98 container->setPlugin(new_plugin); |
| 99 container->invalidate(); | 99 container->invalidate(); |
| 100 container->reportGeometry(); | 100 container->reportGeometry(); |
| 101 plugin_->ReplayReceivedData(new_plugin); | 101 plugin_->ReplayReceivedData(new_plugin); |
| 102 plugin_->destroy(); | 102 plugin_->destroy(); |
| 103 } | 103 } |
| 104 } | 104 } |
| OLD | NEW |