| 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 "chrome/renderer/plugins/plugin_placeholder.h" | 5 #include "chrome/renderer/plugins/plugin_placeholder.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/json/string_escape.h" | 9 #include "base/json/string_escape.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/common/jstemplate_builder.h" | 14 #include "chrome/common/jstemplate_builder.h" |
| 15 #include "chrome/common/render_messages.h" | 15 #include "chrome/common/render_messages.h" |
| 16 #include "chrome/common/prerender_messages.h" |
| 16 #include "chrome/renderer/chrome_content_renderer_client.h" | 17 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 17 #include "chrome/renderer/custom_menu_commands.h" | 18 #include "chrome/renderer/custom_menu_commands.h" |
| 18 #include "chrome/renderer/plugins/plugin_uma.h" | 19 #include "chrome/renderer/plugins/plugin_uma.h" |
| 19 #include "content/public/renderer/render_thread.h" | 20 #include "content/public/renderer/render_thread.h" |
| 20 #include "content/public/renderer/render_view.h" | 21 #include "content/public/renderer/render_view.h" |
| 21 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 22 #include "grit/renderer_resources.h" | 23 #include "grit/renderer_resources.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h" |
| 24 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 IPC_END_MESSAGE_MAP() | 211 IPC_END_MESSAGE_MAP() |
| 211 | 212 |
| 212 if (handled) | 213 if (handled) |
| 213 return true; | 214 return true; |
| 214 #endif | 215 #endif |
| 215 | 216 |
| 216 // We don't swallow these messages because multiple blocked plugins have an | 217 // We don't swallow these messages because multiple blocked plugins have an |
| 217 // interest in them. | 218 // interest in them. |
| 218 IPC_BEGIN_MESSAGE_MAP(PluginPlaceholder, message) | 219 IPC_BEGIN_MESSAGE_MAP(PluginPlaceholder, message) |
| 219 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins) | 220 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins) |
| 220 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering) | 221 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering) |
| 221 IPC_END_MESSAGE_MAP() | 222 IPC_END_MESSAGE_MAP() |
| 222 | 223 |
| 223 return false; | 224 return false; |
| 224 } | 225 } |
| 225 | 226 |
| 226 void PluginPlaceholder::ReplacePlugin(WebPlugin* new_plugin) { | 227 void PluginPlaceholder::ReplacePlugin(WebPlugin* new_plugin) { |
| 227 CHECK(plugin_); | 228 CHECK(plugin_); |
| 228 WebPluginContainer* container = plugin_->container(); | 229 WebPluginContainer* container = plugin_->container(); |
| 229 if (new_plugin && new_plugin->initialize(container)) { | 230 if (new_plugin && new_plugin->initialize(container)) { |
| 230 plugin_->RestoreTitleText(); | 231 plugin_->RestoreTitleText(); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 RenderThread::Get()->Send( | 462 RenderThread::Get()->Send( |
| 462 new ChromeViewHostMsg_OpenAboutPlugins(routing_id())); | 463 new ChromeViewHostMsg_OpenAboutPlugins(routing_id())); |
| 463 } | 464 } |
| 464 | 465 |
| 465 void PluginPlaceholder::DidFinishLoadingCallback(const CppArgumentList& args, | 466 void PluginPlaceholder::DidFinishLoadingCallback(const CppArgumentList& args, |
| 466 CppVariant* result) { | 467 CppVariant* result) { |
| 467 finished_loading_ = true; | 468 finished_loading_ = true; |
| 468 if (message_.length() > 0) | 469 if (message_.length() > 0) |
| 469 UpdateMessage(); | 470 UpdateMessage(); |
| 470 } | 471 } |
| OLD | NEW |