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
3 // found in the LICENSE file.
5 #include "content/shell/browser/shell_browser_context.h"
6 #include "ui/aura/env.h"
7 #include "ui/gfx/screen.h"
8 #include "ui/views/widget/desktop_aura/desktop_screen.h"
9 #include "ui/views_content_client/views_content_client.h"
10 #include "ui/views_content_client/views_content_client_main_parts_aura.h"
16 class ViewsContentClientMainPartsDesktopAura
17 : public ViewsContentClientMainPartsAura
{
19 ViewsContentClientMainPartsDesktopAura(
20 const content::MainFunctionParams
& content_params
,
21 ViewsContentClient
* views_content_client
);
22 ~ViewsContentClientMainPartsDesktopAura() override
{}
24 // content::BrowserMainParts:
25 void PreMainMessageLoopRun() override
;
28 DISALLOW_COPY_AND_ASSIGN(ViewsContentClientMainPartsDesktopAura
);
31 ViewsContentClientMainPartsDesktopAura::ViewsContentClientMainPartsDesktopAura(
32 const content::MainFunctionParams
& content_params
,
33 ViewsContentClient
* views_content_client
)
34 : ViewsContentClientMainPartsAura(content_params
, views_content_client
) {
37 void ViewsContentClientMainPartsDesktopAura::PreMainMessageLoopRun() {
38 ViewsContentClientMainPartsAura::PreMainMessageLoopRun();
40 aura::Env::CreateInstance(true);
41 gfx::Screen::SetScreenInstance(
42 gfx::SCREEN_TYPE_NATIVE
, views::CreateDesktopScreen());
44 views_content_client()->task().Run(browser_context(), NULL
);
50 ViewsContentClientMainParts
* ViewsContentClientMainParts::Create(
51 const content::MainFunctionParams
& content_params
,
52 ViewsContentClient
* views_content_client
) {
53 return new ViewsContentClientMainPartsDesktopAura(
54 content_params
, views_content_client
);