Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: chrome/renderer/plugins/plugin_placeholder.cc

Issue 9623018: Prerendered pages are swapped in at browser::Navigate time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 IPC_END_MESSAGE_MAP() 213 IPC_END_MESSAGE_MAP()
213 214
214 if (handled) 215 if (handled)
215 return true; 216 return true;
216 #endif 217 #endif
217 218
218 // We don't swallow these messages because multiple blocked plugins have an 219 // We don't swallow these messages because multiple blocked plugins have an
219 // interest in them. 220 // interest in them.
220 IPC_BEGIN_MESSAGE_MAP(PluginPlaceholder, message) 221 IPC_BEGIN_MESSAGE_MAP(PluginPlaceholder, message)
221 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins) 222 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins)
222 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering) 223 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering)
223 IPC_END_MESSAGE_MAP() 224 IPC_END_MESSAGE_MAP()
224 225
225 return false; 226 return false;
226 } 227 }
227 228
228 void PluginPlaceholder::ReplacePlugin(WebPlugin* new_plugin) { 229 void PluginPlaceholder::ReplacePlugin(WebPlugin* new_plugin) {
229 CHECK(plugin_); 230 CHECK(plugin_);
230 WebPluginContainer* container = plugin_->container(); 231 WebPluginContainer* container = plugin_->container();
231 if (new_plugin && new_plugin->initialize(container)) { 232 if (new_plugin && new_plugin->initialize(container)) {
232 plugin_->RestoreTitleText(); 233 plugin_->RestoreTitleText();
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 RenderThread::Get()->Send( 471 RenderThread::Get()->Send(
471 new ChromeViewHostMsg_OpenAboutPlugins(routing_id())); 472 new ChromeViewHostMsg_OpenAboutPlugins(routing_id()));
472 } 473 }
473 474
474 void PluginPlaceholder::DidFinishLoadingCallback(const CppArgumentList& args, 475 void PluginPlaceholder::DidFinishLoadingCallback(const CppArgumentList& args,
475 CppVariant* result) { 476 CppVariant* result) {
476 finished_loading_ = true; 477 finished_loading_ = true;
477 if (message_.length() > 0) 478 if (message_.length() > 0)
478 UpdateMessage(); 479 UpdateMessage();
479 } 480 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698