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/shadow_dom_plugin_placeholder.h" | 5 #include "chrome/renderer/plugins/shadow_dom_plugin_placeholder.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
(...skipping 28 matching lines...) Expand all Loading... | |
39 const blink::WebPluginParams& orig_params) { | 39 const blink::WebPluginParams& orig_params) { |
40 using Status = ChromeViewHostMsg_GetPluginInfo_Status; | 40 using Status = ChromeViewHostMsg_GetPluginInfo_Status; |
41 | 41 |
42 if (!ShadowDOMPluginPlaceholderEnabled()) | 42 if (!ShadowDOMPluginPlaceholderEnabled()) |
43 return nullptr; | 43 return nullptr; |
44 | 44 |
45 std::string orig_mime_type = orig_params.mimeType.utf8(); | 45 std::string orig_mime_type = orig_params.mimeType.utf8(); |
46 // TODO(jbroman): Investigate whether browser plugin needs special handling. | 46 // TODO(jbroman): Investigate whether browser plugin needs special handling. |
47 ChromeViewHostMsg_GetPluginInfo_Output output; | 47 ChromeViewHostMsg_GetPluginInfo_Output output; |
48 #if defined(ENABLE_PLUGINS) | 48 #if defined(ENABLE_PLUGINS) |
49 render_frame->Send( | 49 blink::WebString top_origin = frame->top()->securityOrigin().toString(); |
50 new ChromeViewHostMsg_GetPluginInfo(render_frame->GetRoutingID(), | 50 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( |
51 GURL(orig_params.url), | 51 render_frame->GetRoutingID(), GURL(orig_params.url), GURL(top_origin), |
Lei Zhang
2015/08/20 21:33:28
nit: Can you keep the old formatting if it fits in
alexmos
2015/08/20 21:45:07
Done.
| |
52 frame->top()->document().url(), | 52 orig_mime_type, &output)); |
53 orig_mime_type, | |
54 &output)); | |
55 #else | 53 #else |
56 output.status = Status::kNotFound; | 54 output.status = Status::kNotFound; |
57 #endif | 55 #endif |
58 | 56 |
59 if (output.status == Status::kNotFound) { | 57 if (output.status == Status::kNotFound) { |
60 // TODO(jbroman): Handle YouTube specially here, as in | 58 // TODO(jbroman): Handle YouTube specially here, as in |
61 // ChromeContentRendererClient::CreatePlugin. | 59 // ChromeContentRendererClient::CreatePlugin. |
62 PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, | 60 PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, |
63 orig_params.url); | 61 orig_params.url); |
64 return CreateShadowDOMPlaceholderForMissingPlugin(); | 62 return CreateShadowDOMPlaceholderForMissingPlugin(); |
65 } | 63 } |
66 | 64 |
67 return nullptr; | 65 return nullptr; |
68 } | 66 } |
69 | 67 |
70 scoped_ptr<blink::WebPluginPlaceholder> | 68 scoped_ptr<blink::WebPluginPlaceholder> |
71 CreateShadowDOMPlaceholderForMissingPlugin() { | 69 CreateShadowDOMPlaceholderForMissingPlugin() { |
72 return make_scoped_ptr(new MissingPluginPlaceholder); | 70 return make_scoped_ptr(new MissingPluginPlaceholder); |
73 } | 71 } |
OLD | NEW |