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

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

Issue 2378573005: [HBD] Blanket BLOCK on all non-HTTP(s) and non-FILE URLs for Flash. (Closed)
Patch Set: Done, though it's insane Created 4 years, 2 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 prerender::PrerenderMode mode) { 283 prerender::PrerenderMode mode) {
284 OnSetIsPrerendering(mode != prerender::NO_PRERENDER); 284 OnSetIsPrerendering(mode != prerender::NO_PRERENDER);
285 } 285 }
286 286
287 void ChromePluginPlaceholder::PluginListChanged() { 287 void ChromePluginPlaceholder::PluginListChanged() {
288 if (!GetFrame() || !plugin()) 288 if (!GetFrame() || !plugin())
289 return; 289 return;
290 290
291 ChromeViewHostMsg_GetPluginInfo_Output output; 291 ChromeViewHostMsg_GetPluginInfo_Output output;
292 std::string mime_type(GetPluginParams().mimeType.utf8()); 292 std::string mime_type(GetPluginParams().mimeType.utf8());
293 blink::WebString top_origin = 293 render_frame()->Send(new ChromeViewHostMsg_GetPluginInfo(
294 GetFrame()->top()->getSecurityOrigin().toString(); 294 routing_id(), GURL(GetPluginParams().url),
295 render_frame()->Send( 295 GetFrame()->top()->getSecurityOrigin(), mime_type, &output));
296 new ChromeViewHostMsg_GetPluginInfo(routing_id(),
297 GURL(GetPluginParams().url),
298 blink::WebStringToGURL(top_origin),
299 mime_type,
300 &output));
301 if (output.status == status_) 296 if (output.status == status_)
302 return; 297 return;
303 blink::WebPlugin* new_plugin = ChromeContentRendererClient::CreatePlugin( 298 blink::WebPlugin* new_plugin = ChromeContentRendererClient::CreatePlugin(
304 render_frame(), GetFrame(), GetPluginParams(), output); 299 render_frame(), GetFrame(), GetPluginParams(), output);
305 ReplacePlugin(new_plugin); 300 ReplacePlugin(new_plugin);
306 if (!new_plugin) { 301 if (!new_plugin) {
307 PluginUMAReporter::GetInstance()->ReportPluginMissing( 302 PluginUMAReporter::GetInstance()->ReportPluginMissing(
308 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url)); 303 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url));
309 } 304 }
310 } 305 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 423
429 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 424 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
430 switches::kEnablePluginPlaceholderTesting)) { 425 switches::kEnablePluginPlaceholderTesting)) {
431 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( 426 builder.SetMethod<void (ChromePluginPlaceholder::*)()>(
432 "didFinishIconRepositionForTesting", 427 "didFinishIconRepositionForTesting",
433 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); 428 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback);
434 } 429 }
435 430
436 return builder; 431 return builder;
437 } 432 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698