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 void ChromeContentRendererClient::DeferMediaLoad( |
467 ChromeContentRendererClient::OverrideCreateWebMediaPlayer( | |
468 content::RenderView* render_view, | 467 content::RenderView* render_view, |
469 WebKit::WebFrame* frame, | 468 const base::Closure& closure) { |
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 closure.Run(); |
| 472 return; |
476 #else | 473 #else |
477 if (!prerender::PrerenderHelper::IsPrerendering(render_view)) | 474 if (!prerender::PrerenderHelper::IsPrerendering(render_view)) { |
478 return NULL; | 475 closure.Run(); |
| 476 return; |
| 477 } |
479 | 478 |
480 return new prerender::PrerenderWebMediaPlayer( | 479 // Lifetime is tied to |render_view| via content::RenderViewObserver. |
481 render_view, frame, client, delegate, params); | 480 new prerender::PrerenderWebMediaPlayer(render_view, closure); |
482 #endif | 481 #endif |
483 } | 482 } |
484 | 483 |
485 WebPlugin* ChromeContentRendererClient::CreatePlugin( | 484 WebPlugin* ChromeContentRendererClient::CreatePlugin( |
486 content::RenderView* render_view, | 485 content::RenderView* render_view, |
487 WebFrame* frame, | 486 WebFrame* frame, |
488 const WebPluginParams& original_params, | 487 const WebPluginParams& original_params, |
489 const ChromeViewHostMsg_GetPluginInfo_Output& output) { | 488 const ChromeViewHostMsg_GetPluginInfo_Output& output) { |
490 const ChromeViewHostMsg_GetPluginInfo_Status& status = output.status; | 489 const ChromeViewHostMsg_GetPluginInfo_Status& status = output.status; |
491 const WebPluginInfo& plugin = output.plugin; | 490 const WebPluginInfo& plugin = output.plugin; |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 if (CommandLine::ForCurrentProcess()->HasSwitch( | 1278 if (CommandLine::ForCurrentProcess()->HasSwitch( |
1280 switches::kEnablePepperTesting)) { | 1279 switches::kEnablePepperTesting)) { |
1281 return true; | 1280 return true; |
1282 } | 1281 } |
1283 #endif // !defined(OS_ANDROID) | 1282 #endif // !defined(OS_ANDROID) |
1284 return false; | 1283 return false; |
1285 } | 1284 } |
1286 | 1285 |
1287 | 1286 |
1288 } // namespace chrome | 1287 } // namespace chrome |
OLD | NEW |