OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.h" | 5 #include "chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.h" |
6 | 6 |
7 #include "chrome/browser/chrome_browser_main.h" | 7 #include "chrome/browser/chrome_browser_main.h" |
8 #include "chrome/browser/ui/aura/active_desktop_monitor.h" | 8 #include "chrome/browser/ui/aura/active_desktop_monitor.h" |
9 #include "chrome/browser/ui/host_desktop.h" | 9 #include "chrome/browser/ui/host_desktop.h" |
10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 ChromeBrowserMainExtraPartsAura::ChromeBrowserMainExtraPartsAura() { | 45 ChromeBrowserMainExtraPartsAura::ChromeBrowserMainExtraPartsAura() { |
46 } | 46 } |
47 | 47 |
48 ChromeBrowserMainExtraPartsAura::~ChromeBrowserMainExtraPartsAura() { | 48 ChromeBrowserMainExtraPartsAura::~ChromeBrowserMainExtraPartsAura() { |
49 } | 49 } |
50 | 50 |
51 void ChromeBrowserMainExtraPartsAura::ToolkitInitialized() { | 51 void ChromeBrowserMainExtraPartsAura::ToolkitInitialized() { |
52 #if !defined(OS_CHROMEOS) | 52 #if !defined(OS_CHROMEOS) |
53 #if defined(USE_ASH) | 53 #if defined(USE_ASH) |
| 54 aura::Env::CreateInstance(); |
54 active_desktop_monitor_.reset(new ActiveDesktopMonitor(GetInitialDesktop())); | 55 active_desktop_monitor_.reset(new ActiveDesktopMonitor(GetInitialDesktop())); |
55 if (!chrome::ShouldOpenAshOnStartup()) | 56 if (!chrome::ShouldOpenAshOnStartup()) |
56 #endif | 57 #endif |
57 { | 58 { |
58 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, | 59 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, |
59 views::CreateDesktopScreen()); | 60 views::CreateDesktopScreen()); |
60 } | 61 } |
61 #endif | 62 #endif |
62 | 63 |
63 #if !defined(USE_ASH) && defined(OS_LINUX) && defined(USE_X11) | 64 #if !defined(USE_ASH) && defined(OS_LINUX) && defined(USE_X11) |
64 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. | 65 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. |
65 views::LinuxUI::SetInstance(BuildGtk2UI()); | 66 views::LinuxUI::SetInstance(BuildGtk2UI()); |
66 #endif | 67 #endif |
67 } | 68 } |
68 | 69 |
69 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() { | 70 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() { |
70 active_desktop_monitor_.reset(); | 71 active_desktop_monitor_.reset(); |
71 | 72 |
72 // aura::Env instance is deleted in BrowserProcessImpl::StartTearDown | 73 // aura::Env instance is deleted in BrowserProcessImpl::StartTearDown |
73 // after the metrics service is deleted. | 74 // after the metrics service is deleted. |
74 } | 75 } |
OLD | NEW |