Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 #include "chromecast/base/cast_paths.h" | 25 #include "chromecast/base/cast_paths.h" |
| 26 #include "chromecast/base/cast_sys_info_util.h" | 26 #include "chromecast/base/cast_sys_info_util.h" |
| 27 #include "chromecast/base/chromecast_switches.h" | 27 #include "chromecast/base/chromecast_switches.h" |
| 28 #include "chromecast/base/metrics/cast_metrics_helper.h" | 28 #include "chromecast/base/metrics/cast_metrics_helper.h" |
| 29 #include "chromecast/base/metrics/grouped_histogram.h" | 29 #include "chromecast/base/metrics/grouped_histogram.h" |
| 30 #include "chromecast/browser/cast_browser_context.h" | 30 #include "chromecast/browser/cast_browser_context.h" |
| 31 #include "chromecast/browser/cast_browser_process.h" | 31 #include "chromecast/browser/cast_browser_process.h" |
| 32 #include "chromecast/browser/cast_content_browser_client.h" | 32 #include "chromecast/browser/cast_content_browser_client.h" |
| 33 #include "chromecast/browser/cast_memory_pressure_monitor.h" | 33 #include "chromecast/browser/cast_memory_pressure_monitor.h" |
| 34 #include "chromecast/browser/cast_net_log.h" | 34 #include "chromecast/browser/cast_net_log.h" |
| 35 #include "chromecast/browser/cast_window_manager.h" | |
| 35 #include "chromecast/browser/devtools/remote_debugging_server.h" | 36 #include "chromecast/browser/devtools/remote_debugging_server.h" |
| 36 #include "chromecast/browser/geolocation/cast_access_token_store.h" | 37 #include "chromecast/browser/geolocation/cast_access_token_store.h" |
| 37 #include "chromecast/browser/media/media_caps_impl.h" | 38 #include "chromecast/browser/media/media_caps_impl.h" |
| 38 #include "chromecast/browser/metrics/cast_metrics_prefs.h" | 39 #include "chromecast/browser/metrics/cast_metrics_prefs.h" |
| 39 #include "chromecast/browser/metrics/cast_metrics_service_client.h" | 40 #include "chromecast/browser/metrics/cast_metrics_service_client.h" |
| 40 #include "chromecast/browser/pref_service_helper.h" | 41 #include "chromecast/browser/pref_service_helper.h" |
| 41 #include "chromecast/browser/url_request_context_factory.h" | 42 #include "chromecast/browser/url_request_context_factory.h" |
| 42 #include "chromecast/chromecast_features.h" | 43 #include "chromecast/chromecast_features.h" |
| 43 #include "chromecast/common/platform_client_auth.h" | 44 #include "chromecast/common/platform_client_auth.h" |
| 44 #include "chromecast/media/base/key_systems_common.h" | 45 #include "chromecast/media/base/key_systems_common.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 75 #include "components/crash/content/browser/crash_dump_manager_android.h" | 76 #include "components/crash/content/browser/crash_dump_manager_android.h" |
| 76 #include "net/android/network_change_notifier_factory_android.h" | 77 #include "net/android/network_change_notifier_factory_android.h" |
| 77 #else | 78 #else |
| 78 #include "chromecast/net/network_change_notifier_factory_cast.h" | 79 #include "chromecast/net/network_change_notifier_factory_cast.h" |
| 79 #endif | 80 #endif |
| 80 | 81 |
| 81 #if defined(USE_AURA) | 82 #if defined(USE_AURA) |
| 82 // gn check ignored on OverlayManagerCast as it's not a public ozone | 83 // gn check ignored on OverlayManagerCast as it's not a public ozone |
| 83 // header, but is exported to allow injecting the overlay-composited | 84 // header, but is exported to allow injecting the overlay-composited |
| 84 // callback. | 85 // callback. |
| 86 #include "chromecast/browser/cast_window_manager_aura.h" | |
| 85 #include "chromecast/graphics/cast_screen.h" | 87 #include "chromecast/graphics/cast_screen.h" |
| 86 #include "ui/display/screen.h" | 88 #include "ui/display/screen.h" |
| 87 #include "ui/ozone/platform/cast/overlay_manager_cast.h" // nogncheck | 89 #include "ui/ozone/platform/cast/overlay_manager_cast.h" // nogncheck |
| 88 #endif | 90 #endif |
| 89 | 91 |
| 90 namespace { | 92 namespace { |
| 91 | 93 |
| 92 #if !defined(OS_ANDROID) | 94 #if !defined(OS_ANDROID) |
| 93 int kSignalsToRunClosure[] = { SIGTERM, SIGINT, }; | 95 int kSignalsToRunClosure[] = { SIGTERM, SIGINT, }; |
| 94 // Closure to run on SIGTERM and SIGINT. | 96 // Closure to run on SIGTERM and SIGINT. |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 446 GetURLRequestContext())); | 448 GetURLRequestContext())); |
| 447 | 449 |
| 448 if (!PlatformClientAuth::Initialize()) | 450 if (!PlatformClientAuth::Initialize()) |
| 449 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; | 451 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; |
| 450 | 452 |
| 451 cast_browser_process_->SetRemoteDebuggingServer( | 453 cast_browser_process_->SetRemoteDebuggingServer( |
| 452 base::MakeUnique<RemoteDebuggingServer>( | 454 base::MakeUnique<RemoteDebuggingServer>( |
| 453 cast_browser_process_->browser_client() | 455 cast_browser_process_->browser_client() |
| 454 ->EnableRemoteDebuggingImmediately())); | 456 ->EnableRemoteDebuggingImmediately())); |
| 455 | 457 |
| 458 #if defined(USE_AURA) | |
| 459 cast_window_manager_.reset(new CastWindowManagerAura()); | |
|
derekjchow1
2016/10/24 22:43:08
Any reason this can't be added in the contructor o
| |
| 460 #else | |
| 461 cast_window_manager_.reset(new CastWindowManager()); | |
| 462 #endif | |
| 463 | |
| 456 #if defined(USE_AURA) && !BUILDFLAG(IS_CAST_AUDIO_ONLY) | 464 #if defined(USE_AURA) && !BUILDFLAG(IS_CAST_AUDIO_ONLY) |
| 457 // TODO(halliwell) move audio builds to use ozone_platform_cast, then can | 465 // TODO(halliwell) move audio builds to use ozone_platform_cast, then can |
| 458 // simplify this by removing IS_CAST_AUDIO_ONLY condition. Should then also | 466 // simplify this by removing IS_CAST_AUDIO_ONLY condition. Should then also |
| 459 // assert(ozone_platform_cast) in BUILD.gn where it depends on //ui/ozone. | 467 // assert(ozone_platform_cast) in BUILD.gn where it depends on //ui/ozone. |
| 460 gfx::Size display_size = | 468 gfx::Size display_size = |
| 461 display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); | 469 display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); |
| 462 video_plane_controller_.reset(new media::VideoPlaneController( | 470 video_plane_controller_.reset(new media::VideoPlaneController( |
| 463 Size(display_size.width(), display_size.height()), GetMediaTaskRunner())); | 471 Size(display_size.width(), display_size.height()), GetMediaTaskRunner())); |
| 464 ui::OverlayManagerCast::SetOverlayCompositedCallback( | 472 ui::OverlayManagerCast::SetOverlayCompositedCallback( |
| 465 base::Bind(&media::VideoPlaneController::SetGeometry, | 473 base::Bind(&media::VideoPlaneController::SetGeometry, |
| 466 base::Unretained(video_plane_controller_.get()))); | 474 base::Unretained(video_plane_controller_.get()))); |
| 467 #endif | 475 #endif |
| 468 | 476 |
| 469 cast_browser_process_->SetCastService( | 477 cast_browser_process_->SetCastService( |
| 470 cast_browser_process_->browser_client()->CreateCastService( | 478 cast_browser_process_->browser_client()->CreateCastService( |
| 471 cast_browser_process_->browser_context(), | 479 cast_browser_process_->browser_context(), |
| 472 cast_browser_process_->pref_service(), | 480 cast_browser_process_->pref_service(), |
| 473 url_request_context_factory_->GetSystemGetter(), | 481 url_request_context_factory_->GetSystemGetter(), |
| 474 video_plane_controller_.get())); | 482 video_plane_controller_.get(), |
| 483 cast_window_manager_.get())); | |
| 475 cast_browser_process_->cast_service()->Initialize(); | 484 cast_browser_process_->cast_service()->Initialize(); |
| 476 | 485 |
| 477 #if !defined(OS_ANDROID) | 486 #if !defined(OS_ANDROID) |
| 478 media_resource_tracker()->InitializeMediaLib(); | 487 media_resource_tracker()->InitializeMediaLib(); |
| 479 #endif | 488 #endif |
| 480 ::media::InitializeMediaLibrary(); | 489 ::media::InitializeMediaLibrary(); |
| 481 | 490 |
| 482 device::GeolocationProvider::SetGeolocationDelegate( | 491 device::GeolocationProvider::SetGeolocationDelegate( |
| 483 new CastGeolocationDelegate(cast_browser_process_->browser_context())); | 492 new CastGeolocationDelegate(cast_browser_process_->browser_context())); |
| 484 | 493 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 537 | 546 |
| 538 void CastBrowserMainParts::PostDestroyThreads() { | 547 void CastBrowserMainParts::PostDestroyThreads() { |
| 539 #if !defined(OS_ANDROID) | 548 #if !defined(OS_ANDROID) |
| 540 media_resource_tracker_->FinalizeAndDestroy(); | 549 media_resource_tracker_->FinalizeAndDestroy(); |
| 541 media_resource_tracker_ = nullptr; | 550 media_resource_tracker_ = nullptr; |
| 542 #endif | 551 #endif |
| 543 } | 552 } |
| 544 | 553 |
| 545 } // namespace shell | 554 } // namespace shell |
| 546 } // namespace chromecast | 555 } // namespace chromecast |
| OLD | NEW |