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

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

Issue 2179903005: [Prerender] Change IPC from bool to enum for more prerender modes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefetchProto
Patch Set: Fix windows compile Created 4 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chrome_plugin_placeholder.h" 5 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 IPC_MESSAGE_UNHANDLED(handled = false) 201 IPC_MESSAGE_UNHANDLED(handled = false)
202 IPC_END_MESSAGE_MAP() 202 IPC_END_MESSAGE_MAP()
203 203
204 if (handled) 204 if (handled)
205 return true; 205 return true;
206 #endif 206 #endif
207 207
208 // We don't swallow these messages because multiple blocked plugins and other 208 // We don't swallow these messages because multiple blocked plugins and other
209 // objects have an interest in them. 209 // objects have an interest in them.
210 IPC_BEGIN_MESSAGE_MAP(ChromePluginPlaceholder, message) 210 IPC_BEGIN_MESSAGE_MAP(ChromePluginPlaceholder, message)
211 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering) 211 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetPrerenderMode)
212 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins) 212 IPC_MESSAGE_HANDLER(ChromeViewMsg_LoadBlockedPlugins, OnLoadBlockedPlugins)
213 IPC_END_MESSAGE_MAP() 213 IPC_END_MESSAGE_MAP()
214 214
215 return false; 215 return false;
216 } 216 }
217 217
218 void ChromePluginPlaceholder::OpenAboutPluginsCallback() { 218 void ChromePluginPlaceholder::OpenAboutPluginsCallback() {
219 RenderThread::Get()->Send( 219 RenderThread::Get()->Send(
220 new ChromeViewHostMsg_OpenAboutPlugins(routing_id())); 220 new ChromeViewHostMsg_OpenAboutPlugins(routing_id()));
221 } 221 }
(...skipping 28 matching lines...) Expand all
250 SetMessage(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_ERROR, 250 SetMessage(l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_ERROR,
251 base::UTF8ToUTF16(error))); 251 base::UTF8ToUTF16(error)));
252 } 252 }
253 253
254 void ChromePluginPlaceholder::OnCancelledDownloadingPlugin() { 254 void ChromePluginPlaceholder::OnCancelledDownloadingPlugin() {
255 SetMessage( 255 SetMessage(
256 l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED, plugin_name_)); 256 l10n_util::GetStringFUTF16(IDS_PLUGIN_DOWNLOAD_CANCELLED, plugin_name_));
257 } 257 }
258 #endif // defined(ENABLE_PLUGIN_INSTALLATION) 258 #endif // defined(ENABLE_PLUGIN_INSTALLATION)
259 259
260 void ChromePluginPlaceholder::OnSetPrerenderMode(
261 prerender::PrerenderMode mode) {
262 OnSetIsPrerendering(mode != prerender::NO_PRERENDER);
263 }
264
260 void ChromePluginPlaceholder::PluginListChanged() { 265 void ChromePluginPlaceholder::PluginListChanged() {
261 if (!GetFrame() || !plugin()) 266 if (!GetFrame() || !plugin())
262 return; 267 return;
263 268
264 ChromeViewHostMsg_GetPluginInfo_Output output; 269 ChromeViewHostMsg_GetPluginInfo_Output output;
265 std::string mime_type(GetPluginParams().mimeType.utf8()); 270 std::string mime_type(GetPluginParams().mimeType.utf8());
266 blink::WebString top_origin = 271 blink::WebString top_origin =
267 GetFrame()->top()->getSecurityOrigin().toString(); 272 GetFrame()->top()->getSecurityOrigin().toString();
268 render_frame()->Send( 273 render_frame()->Send(
269 new ChromeViewHostMsg_GetPluginInfo(routing_id(), 274 new ChromeViewHostMsg_GetPluginInfo(routing_id(),
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 402
398 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 403 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
399 switches::kEnablePluginPlaceholderTesting)) { 404 switches::kEnablePluginPlaceholderTesting)) {
400 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( 405 builder.SetMethod<void (ChromePluginPlaceholder::*)()>(
401 "didFinishIconRepositionForTesting", 406 "didFinishIconRepositionForTesting",
402 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); 407 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback);
403 } 408 }
404 409
405 return builder; 410 return builder;
406 } 411 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698