| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/crash_logging.h" | 10 #include "base/debug/crash_logging.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 #include "content/public/renderer/plugin_instance_throttler.h" | 82 #include "content/public/renderer/plugin_instance_throttler.h" |
| 83 #include "content/public/renderer/render_frame.h" | 83 #include "content/public/renderer/render_frame.h" |
| 84 #include "content/public/renderer/render_thread.h" | 84 #include "content/public/renderer/render_thread.h" |
| 85 #include "content/public/renderer/render_view.h" | 85 #include "content/public/renderer/render_view.h" |
| 86 #include "content/public/renderer/render_view_visitor.h" | 86 #include "content/public/renderer/render_view_visitor.h" |
| 87 #include "extensions/common/constants.h" | 87 #include "extensions/common/constants.h" |
| 88 #include "ipc/ipc_sync_channel.h" | 88 #include "ipc/ipc_sync_channel.h" |
| 89 #include "net/base/net_errors.h" | 89 #include "net/base/net_errors.h" |
| 90 #include "ppapi/c/private/ppb_pdf.h" | 90 #include "ppapi/c/private/ppb_pdf.h" |
| 91 #include "ppapi/shared_impl/ppapi_switches.h" | 91 #include "ppapi/shared_impl/ppapi_switches.h" |
| 92 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 92 #include "third_party/WebKit/public/platform/WebURL.h" | 93 #include "third_party/WebKit/public/platform/WebURL.h" |
| 93 #include "third_party/WebKit/public/platform/WebURLError.h" | 94 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 94 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 95 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 95 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 96 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 96 #include "third_party/WebKit/public/web/WebCache.h" | 97 #include "third_party/WebKit/public/web/WebCache.h" |
| 97 #include "third_party/WebKit/public/web/WebDataSource.h" | 98 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 98 #include "third_party/WebKit/public/web/WebDocument.h" | 99 #include "third_party/WebKit/public/web/WebDocument.h" |
| 99 #include "third_party/WebKit/public/web/WebElement.h" | 100 #include "third_party/WebKit/public/web/WebElement.h" |
| 100 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 101 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 101 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 102 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 render_frame, params)) { | 551 render_frame, params)) { |
| 551 return false; | 552 return false; |
| 552 } | 553 } |
| 553 #endif | 554 #endif |
| 554 | 555 |
| 555 GURL url(params.url); | 556 GURL url(params.url); |
| 556 #if defined(ENABLE_PLUGINS) | 557 #if defined(ENABLE_PLUGINS) |
| 557 ChromeViewHostMsg_GetPluginInfo_Output output; | 558 ChromeViewHostMsg_GetPluginInfo_Output output; |
| 558 WebString top_origin = frame->top()->securityOrigin().toString(); | 559 WebString top_origin = frame->top()->securityOrigin().toString(); |
| 559 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( | 560 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( |
| 560 render_frame->GetRoutingID(), url, GURL(top_origin), orig_mime_type, | 561 render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin), |
| 561 &output)); | 562 orig_mime_type, &output)); |
| 562 *plugin = CreatePlugin(render_frame, frame, params, output); | 563 *plugin = CreatePlugin(render_frame, frame, params, output); |
| 563 #else // !defined(ENABLE_PLUGINS) | 564 #else // !defined(ENABLE_PLUGINS) |
| 564 | 565 |
| 565 #if defined(OS_ANDROID) | 566 #if defined(OS_ANDROID) |
| 566 if (plugins::MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) { | 567 if (plugins::MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) { |
| 567 base::StringPiece template_html( | 568 base::StringPiece template_html( |
| 568 ResourceBundle::GetSharedInstance().GetRawDataResource( | 569 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 569 IDR_MOBILE_YOUTUBE_PLUGIN_HTML)); | 570 IDR_MOBILE_YOUTUBE_PLUGIN_HTML)); |
| 570 *plugin = (new plugins::MobileYouTubePlugin(render_frame, frame, params, | 571 *plugin = (new plugins::MobileYouTubePlugin(render_frame, frame, params, |
| 571 template_html))->plugin(); | 572 template_html))->plugin(); |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1414 // chrome.system.network.getNetworkInterfaces provides the same | 1415 // chrome.system.network.getNetworkInterfaces provides the same |
| 1415 // information. Also, the enforcement of sending and binding UDP is already done | 1416 // information. Also, the enforcement of sending and binding UDP is already done |
| 1416 // by chrome extension permission model. | 1417 // by chrome extension permission model. |
| 1417 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { | 1418 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { |
| 1418 #if defined(ENABLE_EXTENSIONS) | 1419 #if defined(ENABLE_EXTENSIONS) |
| 1419 return !IsStandaloneExtensionProcess(); | 1420 return !IsStandaloneExtensionProcess(); |
| 1420 #else | 1421 #else |
| 1421 return true; | 1422 return true; |
| 1422 #endif | 1423 #endif |
| 1423 } | 1424 } |
| OLD | NEW |