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(); | |
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 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 | 1468 |
1470 url::Replacements<char> r; | 1469 url::Replacements<char> r; |
1471 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1470 r.SetPath(path.c_str(), url::Component(0, path.length())); |
1472 | 1471 |
1473 if (result == internal::NUM_PLUGIN_ERROR) | 1472 if (result == internal::NUM_PLUGIN_ERROR) |
1474 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1473 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
1475 | 1474 |
1476 RecordYouTubeRewriteUMA(result); | 1475 RecordYouTubeRewriteUMA(result); |
1477 return corrected_url.ReplaceComponents(r); | 1476 return corrected_url.ReplaceComponents(r); |
1478 } | 1477 } |
OLD | NEW |