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 blink::WebString top_origin = GetFrame()->top()->securityOrigin().toString(); |
250 render_frame()->Send( | 251 render_frame()->Send( |
251 new ChromeViewHostMsg_GetPluginInfo(routing_id(), | 252 new ChromeViewHostMsg_GetPluginInfo(routing_id(), |
252 GURL(GetPluginParams().url), | 253 GURL(GetPluginParams().url), |
253 document.url(), | 254 GURL(top_origin), |
254 mime_type, | 255 mime_type, |
255 &output)); | 256 &output)); |
256 if (output.status == status_) | 257 if (output.status == status_) |
257 return; | 258 return; |
258 blink::WebPlugin* new_plugin = ChromeContentRendererClient::CreatePlugin( | 259 blink::WebPlugin* new_plugin = ChromeContentRendererClient::CreatePlugin( |
259 render_frame(), GetFrame(), GetPluginParams(), output); | 260 render_frame(), GetFrame(), GetPluginParams(), output); |
260 ReplacePlugin(new_plugin); | 261 ReplacePlugin(new_plugin); |
261 if (!new_plugin) { | 262 if (!new_plugin) { |
262 PluginUMAReporter::GetInstance()->ReportPluginMissing( | 263 PluginUMAReporter::GetInstance()->ReportPluginMissing( |
263 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url)); | 264 GetPluginParams().mimeType.utf8(), GURL(GetPluginParams().url)); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 360 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
360 "hide", &ChromePluginPlaceholder::HideCallback) | 361 "hide", &ChromePluginPlaceholder::HideCallback) |
361 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 362 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
362 "load", &ChromePluginPlaceholder::LoadCallback) | 363 "load", &ChromePluginPlaceholder::LoadCallback) |
363 .SetMethod<void (ChromePluginPlaceholder::*)()>( | 364 .SetMethod<void (ChromePluginPlaceholder::*)()>( |
364 "didFinishLoading", | 365 "didFinishLoading", |
365 &ChromePluginPlaceholder::DidFinishLoadingCallback) | 366 &ChromePluginPlaceholder::DidFinishLoadingCallback) |
366 .SetMethod("openAboutPlugins", | 367 .SetMethod("openAboutPlugins", |
367 &ChromePluginPlaceholder::OpenAboutPluginsCallback); | 368 &ChromePluginPlaceholder::OpenAboutPluginsCallback); |
368 } | 369 } |
OLD | NEW |