| 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_content_window.h" | 5 #include "chromecast/browser/cast_content_window.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/threading/thread_restrictions.h" | 8 #include "base/threading/thread_restrictions.h" |
| 9 #include "chromecast/base/metrics/cast_metrics_helper.h" | 9 #include "chromecast/base/metrics/cast_metrics_helper.h" |
| 10 #include "chromecast/browser/cast_browser_process.h" | 10 #include "chromecast/browser/cast_browser_process.h" |
| 11 #include "chromecast/media/base/video_plane_controller.h" | |
| 12 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
| 13 #include "content/public/browser/render_widget_host.h" | 12 #include "content/public/browser/render_widget_host.h" |
| 14 #include "content/public/browser/render_widget_host_view.h" | 13 #include "content/public/browser/render_widget_host_view.h" |
| 15 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 16 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_message.h" |
| 17 | 16 |
| 18 #if defined(USE_AURA) | 17 #if defined(USE_AURA) |
| 19 #include "chromecast/graphics/cast_screen.h" | 18 #include "chromecast/graphics/cast_screen.h" |
| 20 #include "ui/aura/env.h" | 19 #include "ui/aura/env.h" |
| 21 #include "ui/aura/layout_manager.h" | 20 #include "ui/aura/layout_manager.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 const gfx::Size& initial_size, | 71 const gfx::Size& initial_size, |
| 73 content::WebContents* web_contents) { | 72 content::WebContents* web_contents) { |
| 74 #if defined(USE_AURA) | 73 #if defined(USE_AURA) |
| 75 // Aura initialization | 74 // Aura initialization |
| 76 CastScreen* cast_screen = | 75 CastScreen* cast_screen = |
| 77 shell::CastBrowserProcess::GetInstance()->cast_screen(); | 76 shell::CastBrowserProcess::GetInstance()->cast_screen(); |
| 78 if (!gfx::Screen::GetScreen()) | 77 if (!gfx::Screen::GetScreen()) |
| 79 gfx::Screen::SetScreenInstance(cast_screen); | 78 gfx::Screen::SetScreenInstance(cast_screen); |
| 80 if (cast_screen->GetPrimaryDisplay().size() != initial_size) | 79 if (cast_screen->GetPrimaryDisplay().size() != initial_size) |
| 81 cast_screen->UpdateDisplaySize(initial_size); | 80 cast_screen->UpdateDisplaySize(initial_size); |
| 82 media::VideoPlaneController::GetInstance()->SetGraphicsPlaneResolution( | |
| 83 Size(initial_size.width(), initial_size.height())); | |
| 84 | 81 |
| 85 CHECK(aura::Env::GetInstance()); | 82 CHECK(aura::Env::GetInstance()); |
| 86 window_tree_host_.reset( | 83 window_tree_host_.reset( |
| 87 aura::WindowTreeHost::Create(gfx::Rect(initial_size))); | 84 aura::WindowTreeHost::Create(gfx::Rect(initial_size))); |
| 88 window_tree_host_->InitHost(); | 85 window_tree_host_->InitHost(); |
| 89 window_tree_host_->window()->SetLayoutManager( | 86 window_tree_host_->window()->SetLayoutManager( |
| 90 new CastFillLayout(window_tree_host_->window())); | 87 new CastFillLayout(window_tree_host_->window())); |
| 91 | 88 |
| 92 if (transparent_) { | 89 if (transparent_) { |
| 93 window_tree_host_->compositor()->SetBackgroundColor(SK_ColorTRANSPARENT); | 90 window_tree_host_->compositor()->SetBackgroundColor(SK_ColorTRANSPARENT); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 content::RenderViewHost* render_view_host) { | 132 content::RenderViewHost* render_view_host) { |
| 136 content::RenderWidgetHostView* view = | 133 content::RenderWidgetHostView* view = |
| 137 render_view_host->GetWidget()->GetView(); | 134 render_view_host->GetWidget()->GetView(); |
| 138 if (view) | 135 if (view) |
| 139 view->SetBackgroundColor(transparent_ ? SK_ColorTRANSPARENT | 136 view->SetBackgroundColor(transparent_ ? SK_ColorTRANSPARENT |
| 140 : SK_ColorBLACK); | 137 : SK_ColorBLACK); |
| 141 } | 138 } |
| 142 | 139 |
| 143 } // namespace shell | 140 } // namespace shell |
| 144 } // namespace chromecast | 141 } // namespace chromecast |
| OLD | NEW |