Commit dc4d8688 authored by halliwell's avatar halliwell Committed by Commit bot

Create gfx::Screen at startup for cast_shell

Seems like it's incorrect to defer this creation the way we do
currently.

BUG=468362

Review URL: https://codereview.chromium.org/1021483005

Cr-Commit-Position: refs/heads/master@{#322301}
parent 95fcfc05
......@@ -42,6 +42,11 @@
#include "net/android/network_change_notifier_factory_android.h"
#endif
#if defined(USE_AURA)
#include "ui/aura/test/test_screen.h"
#include "ui/gfx/screen.h"
#endif
namespace {
#if !defined(OS_ANDROID)
......@@ -239,6 +244,16 @@ int CastBrowserMainParts::PreCreateThreads() {
if (!base::CreateDirectory(home_dir))
return 1;
#endif
#if defined(USE_AURA)
// Screen can (and should) exist even with no displays connected. Its presence
// is assumed as an interface to access display information, e.g. from metrics
// code. See CastContentWindow::CreateWindowTree for update when resolution
// is available.
DCHECK(!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE));
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE,
aura::TestScreen::Create(gfx::Size(0, 0)));
#endif
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment