| 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 "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/common/prerender_messages.h" | 10 #include "chrome/common/prerender_messages.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 void ChromePluginPlaceholder::PluginListChanged() { | 241 void ChromePluginPlaceholder::PluginListChanged() { |
| 242 if (!GetFrame() || !plugin()) | 242 if (!GetFrame() || !plugin()) |
| 243 return; | 243 return; |
| 244 blink::WebDocument document = GetFrame()->top()->document(); | 244 blink::WebDocument document = GetFrame()->top()->document(); |
| 245 if (document.isNull()) | 245 if (document.isNull()) |
| 246 return; | 246 return; |
| 247 | 247 |
| 248 ChromeViewHostMsg_GetPluginInfo_Output output; | 248 ChromeViewHostMsg_GetPluginInfo_Output output; |
| 249 std::string mime_type(GetPluginParams().mimeType.utf8()); | 249 std::string mime_type(GetPluginParams().mimeType.utf8()); |
| 250 render_frame()->Send( | 250 blink::WebString top_origin = GetFrame()->top()->securityOrigin().toString(); |
| 251 new ChromeViewHostMsg_GetPluginInfo(routing_id(), | 251 render_frame()->Send(new ChromeViewHostMsg_GetPluginInfo( |
| 252 GURL(GetPluginParams().url), | 252 routing_id(), GURL(GetPluginParams().url), GURL(top_origin), mime_type, |
| 253 document.url(), | 253 &output)); |
| 254 mime_type, | |
| 255 &output)); | |
| 256 if (output.status == status_) | 254 if (output.status == status_) |
| 257 return; | 255 return; |
| 258 blink::WebPlugin* new_plugin = ChromeContentRendererClient::CreatePlugin( | 256 blink::WebPlugin* new_plugin = ChromeContentRendererClient::CreatePlugin( |
| 259 render_frame(), GetFrame(), GetPluginParams(), output); | 257 render_frame(), GetFrame(), GetPluginParams(), output); |
| 260 ReplacePlugin(new_plugin); | 258 ReplacePlugin(new_plugin); |
| 261 if (!new_plugin) { | 259 if (!new_plugin) { |
| 262 PluginUMAReporter::GetInstance()->ReportPluginMissing( | 260 PluginUMAReporter::GetInstance()->ReportPluginMissing( |
| 263 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url)); | 261 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url)); |
| 264 } | 262 } |
| 265 } | 263 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 357 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 360 "hide", &ChromePluginPlaceholder::HideCallback) | 358 "hide", &ChromePluginPlaceholder::HideCallback) |
| 361 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 359 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 362 "load", &ChromePluginPlaceholder::LoadCallback) | 360 "load", &ChromePluginPlaceholder::LoadCallback) |
| 363 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 361 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
| 364 "didFinishLoading", | 362 "didFinishLoading", |
| 365 &ChromePluginPlaceholder::DidFinishLoadingCallback) | 363 &ChromePluginPlaceholder::DidFinishLoadingCallback) |
| 366 .SetMethod("openAboutPlugins", | 364 .SetMethod("openAboutPlugins", |
| 367 &ChromePluginPlaceholder::OpenAboutPluginsCallback); | 365 &ChromePluginPlaceholder::OpenAboutPluginsCallback); |
| 368 } | 366 } |
| OLD | NEW |