| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 456 } |
| 457 | 457 |
| 458 WebPlugin* ChromeContentRendererClient::CreatePluginReplacement( | 458 WebPlugin* ChromeContentRendererClient::CreatePluginReplacement( |
| 459 content::RenderView* render_view, | 459 content::RenderView* render_view, |
| 460 const base::FilePath& plugin_path) { | 460 const base::FilePath& plugin_path) { |
| 461 PluginPlaceholder* placeholder = | 461 PluginPlaceholder* placeholder = |
| 462 PluginPlaceholder::CreateErrorPlugin(render_view, plugin_path); | 462 PluginPlaceholder::CreateErrorPlugin(render_view, plugin_path); |
| 463 return placeholder->plugin(); | 463 return placeholder->plugin(); |
| 464 } | 464 } |
| 465 | 465 |
| 466 webkit_media::WebMediaPlayerImpl* | 466 webkit_media::MediaLoadDelegate* |
| 467 ChromeContentRendererClient::OverrideCreateWebMediaPlayer( | 467 ChromeContentRendererClient::OverrideCreateMediaLoadDelegate( |
| 468 content::RenderView* render_view, | 468 content::RenderView* render_view) { |
| 469 WebKit::WebFrame* frame, | |
| 470 WebKit::WebMediaPlayerClient* client, | |
| 471 base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, | |
| 472 const webkit_media::WebMediaPlayerParams& params) { | |
| 473 #if defined(OS_ANDROID) | 469 #if defined(OS_ANDROID) |
| 474 // Chromium for Android doesn't support prerender yet. | 470 // Chromium for Android doesn't support prerender yet. |
| 475 return NULL; | 471 return NULL; |
| 476 #else | 472 #else |
| 477 if (!prerender::PrerenderHelper::IsPrerendering(render_view)) | 473 if (!prerender::PrerenderHelper::IsPrerendering(render_view)) |
| 478 return NULL; | 474 return NULL; |
| 479 | 475 |
| 480 return new prerender::PrerenderWebMediaPlayer( | 476 return new prerender::PrerenderWebMediaPlayer(render_view); |
| 481 render_view, frame, client, delegate, params); | |
| 482 #endif | 477 #endif |
| 483 } | 478 } |
| 484 | 479 |
| 485 WebPlugin* ChromeContentRendererClient::CreatePlugin( | 480 WebPlugin* ChromeContentRendererClient::CreatePlugin( |
| 486 content::RenderView* render_view, | 481 content::RenderView* render_view, |
| 487 WebFrame* frame, | 482 WebFrame* frame, |
| 488 const WebPluginParams& original_params, | 483 const WebPluginParams& original_params, |
| 489 const ChromeViewHostMsg_GetPluginInfo_Output& output) { | 484 const ChromeViewHostMsg_GetPluginInfo_Output& output) { |
| 490 const ChromeViewHostMsg_GetPluginInfo_Status& status = output.status; | 485 const ChromeViewHostMsg_GetPluginInfo_Status& status = output.status; |
| 491 const WebPluginInfo& plugin = output.plugin; | 486 const WebPluginInfo& plugin = output.plugin; |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 if (CommandLine::ForCurrentProcess()->HasSwitch( | 1274 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 1280 switches::kEnablePepperTesting)) { | 1275 switches::kEnablePepperTesting)) { |
| 1281 return true; | 1276 return true; |
| 1282 } | 1277 } |
| 1283 #endif // !defined(OS_ANDROID) | 1278 #endif // !defined(OS_ANDROID) |
| 1284 return false; | 1279 return false; |
| 1285 } | 1280 } |
| 1286 | 1281 |
| 1287 | 1282 |
| 1288 } // namespace chrome | 1283 } // namespace chrome |
| OLD | NEW |