OLD | NEW |
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 prerender::PrerenderMode mode) { | 282 prerender::PrerenderMode mode) { |
283 OnSetIsPrerendering(mode != prerender::NO_PRERENDER); | 283 OnSetIsPrerendering(mode != prerender::NO_PRERENDER); |
284 } | 284 } |
285 | 285 |
286 void ChromePluginPlaceholder::PluginListChanged() { | 286 void ChromePluginPlaceholder::PluginListChanged() { |
287 if (!GetFrame() || !plugin()) | 287 if (!GetFrame() || !plugin()) |
288 return; | 288 return; |
289 | 289 |
290 ChromeViewHostMsg_GetPluginInfo_Output output; | 290 ChromeViewHostMsg_GetPluginInfo_Output output; |
291 std::string mime_type(GetPluginParams().mimeType.utf8()); | 291 std::string mime_type(GetPluginParams().mimeType.utf8()); |
292 blink::WebString top_origin = | 292 render_frame()->Send(new ChromeViewHostMsg_GetPluginInfo( |
293 GetFrame()->top()->getSecurityOrigin().toString(); | 293 routing_id(), GURL(GetPluginParams().url), |
294 render_frame()->Send( | 294 GetFrame()->top()->getSecurityOrigin(), mime_type, &output)); |
295 new ChromeViewHostMsg_GetPluginInfo(routing_id(), | |
296 GURL(GetPluginParams().url), | |
297 blink::WebStringToGURL(top_origin), | |
298 mime_type, | |
299 &output)); | |
300 if (output.status == status_) | 295 if (output.status == status_) |
301 return; | 296 return; |
302 blink::WebPlugin* new_plugin = ChromeContentRendererClient::CreatePlugin( | 297 blink::WebPlugin* new_plugin = ChromeContentRendererClient::CreatePlugin( |
303 render_frame(), GetFrame(), GetPluginParams(), output); | 298 render_frame(), GetFrame(), GetPluginParams(), output); |
304 ReplacePlugin(new_plugin); | 299 ReplacePlugin(new_plugin); |
305 if (!new_plugin) { | 300 if (!new_plugin) { |
306 PluginUMAReporter::GetInstance()->ReportPluginMissing( | 301 PluginUMAReporter::GetInstance()->ReportPluginMissing( |
307 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url)); | 302 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url)); |
308 } | 303 } |
309 } | 304 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 422 |
428 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 423 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
429 switches::kEnablePluginPlaceholderTesting)) { | 424 switches::kEnablePluginPlaceholderTesting)) { |
430 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( | 425 builder.SetMethod<void (ChromePluginPlaceholder::*)()>( |
431 "didFinishIconRepositionForTesting", | 426 "didFinishIconRepositionForTesting", |
432 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); | 427 &ChromePluginPlaceholder::DidFinishIconRepositionForTestingCallback); |
433 } | 428 } |
434 | 429 |
435 return builder; | 430 return builder; |
436 } | 431 } |
OLD | NEW |