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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 active_desktop_monitor_.reset(new ActiveDesktopMonitor(GetInitialDesktop())); | 54 active_desktop_monitor_.reset(new ActiveDesktopMonitor(GetInitialDesktop())); |
| 55 if (!chrome::ShouldOpenAshOnStartup()) |
55 #endif | 56 #endif |
| 57 { |
| 58 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, |
| 59 views::CreateDesktopScreen()); |
| 60 } |
56 #endif | 61 #endif |
57 | 62 |
58 #if !defined(USE_ASH) && defined(OS_LINUX) && defined(USE_X11) | 63 #if !defined(USE_ASH) && defined(OS_LINUX) && defined(USE_X11) |
59 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. | 64 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. |
60 views::LinuxUI::SetInstance(BuildGtk2UI()); | 65 views::LinuxUI::SetInstance(BuildGtk2UI()); |
61 #endif | 66 #endif |
62 } | 67 } |
63 | 68 |
64 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopStart() { | |
65 #if !defined(OS_CHROMEOS) | |
66 #if defined(USE_ASH) | |
67 if (!chrome::ShouldOpenAshOnStartup()) | |
68 #endif | |
69 { | |
70 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, | |
71 views::CreateDesktopScreen()); | |
72 } | |
73 #endif | |
74 } | |
75 | |
76 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() { | 69 void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() { |
77 active_desktop_monitor_.reset(); | 70 active_desktop_monitor_.reset(); |
78 | 71 |
79 // aura::Env instance is deleted in BrowserProcessImpl::StartTearDown | 72 // aura::Env instance is deleted in BrowserProcessImpl::StartTearDown |
80 // after the metrics service is deleted. | 73 // after the metrics service is deleted. |
81 } | 74 } |
OLD | NEW |