OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/browser/cast_browser_main_parts.h" | 5 #include "chromecast/browser/cast_browser_main_parts.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 // Set GL strings so GPU config code can make correct feature blacklisting/ | 361 // Set GL strings so GPU config code can make correct feature blacklisting/ |
362 // whitelisting decisions. | 362 // whitelisting decisions. |
363 // Note: SetGLStrings can be called before GpuDataManager::Initialize. | 363 // Note: SetGLStrings can be called before GpuDataManager::Initialize. |
364 std::unique_ptr<CastSysInfo> sys_info = CreateSysInfo(); | 364 std::unique_ptr<CastSysInfo> sys_info = CreateSysInfo(); |
365 content::GpuDataManager::GetInstance()->SetGLStrings( | 365 content::GpuDataManager::GetInstance()->SetGLStrings( |
366 sys_info->GetGlVendor(), sys_info->GetGlRenderer(), | 366 sys_info->GetGlVendor(), sys_info->GetGlRenderer(), |
367 sys_info->GetGlVersion()); | 367 sys_info->GetGlVersion()); |
368 #endif | 368 #endif |
369 | 369 |
370 #if defined(USE_AURA) | 370 #if defined(USE_AURA) |
371 // Screen can (and should) exist even with no displays connected. Its presence | 371 cast_browser_process_->SetCastScreen(base::WrapUnique(new CastScreen())); |
372 // is assumed as an interface to access display information, e.g. from metrics | |
373 // code. See CastContentWindow::CreateWindowTree for update when resolution | |
374 // is available. | |
375 cast_browser_process_->SetCastScreen(base::WrapUnique(new CastScreen)); | |
376 DCHECK(!display::Screen::GetScreen()); | 372 DCHECK(!display::Screen::GetScreen()); |
377 display::Screen::SetScreenInstance(cast_browser_process_->cast_screen()); | 373 display::Screen::SetScreenInstance(cast_browser_process_->cast_screen()); |
378 #endif | 374 #endif |
379 | 375 |
380 content::ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | 376 content::ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
381 kChromeResourceScheme); | 377 kChromeResourceScheme); |
382 return 0; | 378 return 0; |
383 } | 379 } |
384 | 380 |
385 void CastBrowserMainParts::PreMainMessageLoopRun() { | 381 void CastBrowserMainParts::PreMainMessageLoopRun() { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; | 413 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; |
418 | 414 |
419 cast_browser_process_->SetRemoteDebuggingServer(base::WrapUnique( | 415 cast_browser_process_->SetRemoteDebuggingServer(base::WrapUnique( |
420 new RemoteDebuggingServer(cast_browser_process_->browser_client() | 416 new RemoteDebuggingServer(cast_browser_process_->browser_client() |
421 ->EnableRemoteDebuggingImmediately()))); | 417 ->EnableRemoteDebuggingImmediately()))); |
422 | 418 |
423 #if defined(USE_AURA) && !BUILDFLAG(DISABLE_DISPLAY) | 419 #if defined(USE_AURA) && !BUILDFLAG(DISABLE_DISPLAY) |
424 // TODO(halliwell) move audio builds to use ozone_platform_cast, then can | 420 // TODO(halliwell) move audio builds to use ozone_platform_cast, then can |
425 // simplify this by removing DISABLE_DISPLAY condition. Should then also | 421 // simplify this by removing DISABLE_DISPLAY condition. Should then also |
426 // assert(ozone_platform_cast) in BUILD.gn where it depends on //ui/ozone. | 422 // assert(ozone_platform_cast) in BUILD.gn where it depends on //ui/ozone. |
427 video_plane_controller_.reset( | 423 gfx::Size display_size = |
428 new media::VideoPlaneController(GetMediaTaskRunner())); | 424 display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); |
429 cast_browser_process_->cast_screen()->SetDisplayResizeCallback( | 425 video_plane_controller_.reset(new media::VideoPlaneController( |
430 base::Bind(&media::VideoPlaneController::SetGraphicsPlaneResolution, | 426 Size(display_size.width(), display_size.height()), GetMediaTaskRunner())); |
431 base::Unretained(video_plane_controller_.get()))); | |
432 ui::OverlayManagerCast::SetOverlayCompositedCallback( | 427 ui::OverlayManagerCast::SetOverlayCompositedCallback( |
433 base::Bind(&media::VideoPlaneController::SetGeometry, | 428 base::Bind(&media::VideoPlaneController::SetGeometry, |
434 base::Unretained(video_plane_controller_.get()))); | 429 base::Unretained(video_plane_controller_.get()))); |
435 #endif | 430 #endif |
436 | 431 |
437 cast_browser_process_->SetCastService( | 432 cast_browser_process_->SetCastService( |
438 cast_browser_process_->browser_client()->CreateCastService( | 433 cast_browser_process_->browser_client()->CreateCastService( |
439 cast_browser_process_->browser_context(), | 434 cast_browser_process_->browser_context(), |
440 cast_browser_process_->pref_service(), | 435 cast_browser_process_->pref_service(), |
441 url_request_context_factory_->GetSystemGetter(), | 436 url_request_context_factory_->GetSystemGetter(), |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 void CastBrowserMainParts::PostDestroyThreads() { | 498 void CastBrowserMainParts::PostDestroyThreads() { |
504 #if !defined(OS_ANDROID) | 499 #if !defined(OS_ANDROID) |
505 media_resource_tracker_->FinalizeAndDestroy(); | 500 media_resource_tracker_->FinalizeAndDestroy(); |
506 media_resource_tracker_ = nullptr; | 501 media_resource_tracker_ = nullptr; |
507 media_pipeline_backend_manager_.reset(); | 502 media_pipeline_backend_manager_.reset(); |
508 #endif | 503 #endif |
509 } | 504 } |
510 | 505 |
511 } // namespace shell | 506 } // namespace shell |
512 } // namespace chromecast | 507 } // namespace chromecast |
OLD | NEW |