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" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #endif | 68 #endif |
69 } | 69 } |
70 | 70 |
71 void CastContentWindow::CreateWindowTree( | 71 void CastContentWindow::CreateWindowTree( |
72 const gfx::Size& initial_size, | 72 const gfx::Size& initial_size, |
73 content::WebContents* web_contents) { | 73 content::WebContents* web_contents) { |
74 #if defined(USE_AURA) | 74 #if defined(USE_AURA) |
75 // Aura initialization | 75 // Aura initialization |
76 CastScreen* cast_screen = | 76 CastScreen* cast_screen = |
77 shell::CastBrowserProcess::GetInstance()->cast_screen(); | 77 shell::CastBrowserProcess::GetInstance()->cast_screen(); |
78 if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)) | 78 if (!gfx::Screen::GetScreen()) |
79 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, cast_screen); | 79 gfx::Screen::SetScreenInstance(cast_screen); |
80 if (cast_screen->GetPrimaryDisplay().size() != initial_size) | 80 if (cast_screen->GetPrimaryDisplay().size() != initial_size) |
81 cast_screen->UpdateDisplaySize(initial_size); | 81 cast_screen->UpdateDisplaySize(initial_size); |
82 media::VideoPlaneController::GetInstance()->SetGraphicsPlaneResolution( | 82 media::VideoPlaneController::GetInstance()->SetGraphicsPlaneResolution( |
83 Size(initial_size.width(), initial_size.height())); | 83 Size(initial_size.width(), initial_size.height())); |
84 | 84 |
85 CHECK(aura::Env::GetInstance()); | 85 CHECK(aura::Env::GetInstance()); |
86 window_tree_host_.reset( | 86 window_tree_host_.reset( |
87 aura::WindowTreeHost::Create(gfx::Rect(initial_size))); | 87 aura::WindowTreeHost::Create(gfx::Rect(initial_size))); |
88 window_tree_host_->InitHost(); | 88 window_tree_host_->InitHost(); |
89 window_tree_host_->window()->SetLayoutManager( | 89 window_tree_host_->window()->SetLayoutManager( |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 content::RenderViewHost* render_view_host) { | 135 content::RenderViewHost* render_view_host) { |
136 content::RenderWidgetHostView* view = | 136 content::RenderWidgetHostView* view = |
137 render_view_host->GetWidget()->GetView(); | 137 render_view_host->GetWidget()->GetView(); |
138 if (view) | 138 if (view) |
139 view->SetBackgroundColor(transparent_ ? SK_ColorTRANSPARENT | 139 view->SetBackgroundColor(transparent_ ? SK_ColorTRANSPARENT |
140 : SK_ColorBLACK); | 140 : SK_ColorBLACK); |
141 } | 141 } |
142 | 142 |
143 } // namespace shell | 143 } // namespace shell |
144 } // namespace chromecast | 144 } // namespace chromecast |
OLD | NEW |