OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
556 #if defined(ENABLE_EXTENSIONS) | 556 #if defined(ENABLE_EXTENSIONS) |
557 if (!ChromeExtensionsRendererClient::GetInstance()->OverrideCreatePlugin( | 557 if (!ChromeExtensionsRendererClient::GetInstance()->OverrideCreatePlugin( |
558 render_frame, params)) { | 558 render_frame, params)) { |
559 return false; | 559 return false; |
560 } | 560 } |
561 #endif | 561 #endif |
562 | 562 |
563 GURL url(params.url); | 563 GURL url(params.url); |
564 #if defined(ENABLE_PLUGINS) | 564 #if defined(ENABLE_PLUGINS) |
565 ChromeViewHostMsg_GetPluginInfo_Output output; | 565 ChromeViewHostMsg_GetPluginInfo_Output output; |
566 WebString top_origin = frame->top()->getSecurityOrigin().toString(); | |
tommycli
2016/09/30 00:42:37
Here was where the issue was: WebSecurityOrigin.to
| |
567 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( | 566 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( |
568 render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin), | 567 render_frame->GetRoutingID(), url, frame->top()->getSecurityOrigin(), |
569 orig_mime_type, &output)); | 568 orig_mime_type, &output)); |
570 *plugin = CreatePlugin(render_frame, frame, params, output); | 569 *plugin = CreatePlugin(render_frame, frame, params, output); |
571 #else // !defined(ENABLE_PLUGINS) | 570 #else // !defined(ENABLE_PLUGINS) |
572 | 571 |
573 #if defined(OS_ANDROID) | 572 #if defined(OS_ANDROID) |
574 if (plugins::MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) { | 573 if (plugins::MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) { |
575 base::StringPiece template_html( | 574 base::StringPiece template_html( |
576 ResourceBundle::GetSharedInstance().GetRawDataResource( | 575 ResourceBundle::GetSharedInstance().GetRawDataResource( |
577 IDR_MOBILE_YOUTUBE_PLUGIN_HTML)); | 576 IDR_MOBILE_YOUTUBE_PLUGIN_HTML)); |
578 *plugin = (new plugins::MobileYouTubePlugin(render_frame, frame, params, | 577 *plugin = (new plugins::MobileYouTubePlugin(render_frame, frame, params, |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1459 | 1458 |
1460 url::Replacements<char> r; | 1459 url::Replacements<char> r; |
1461 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1460 r.SetPath(path.c_str(), url::Component(0, path.length())); |
1462 | 1461 |
1463 if (result == internal::NUM_PLUGIN_ERROR) | 1462 if (result == internal::NUM_PLUGIN_ERROR) |
1464 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1463 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
1465 | 1464 |
1466 RecordYouTubeRewriteUMA(result); | 1465 RecordYouTubeRewriteUMA(result); |
1467 return corrected_url.ReplaceComponents(r); | 1466 return corrected_url.ReplaceComponents(r); |
1468 } | 1467 } |
OLD | NEW |