| 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |