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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chrome/browser/chrome_browser_main.h" | 9 #include "chrome/browser/chrome_browser_main.h" |
10 #include "chrome/browser/ui/aura/active_desktop_monitor.h" | 10 #include "chrome/browser/ui/aura/active_desktop_monitor.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 #endif | 103 #endif |
104 } | 104 } |
105 | 105 |
106 void ChromeBrowserMainExtraPartsAura::ToolkitInitialized() { | 106 void ChromeBrowserMainExtraPartsAura::ToolkitInitialized() { |
107 #if !defined(OS_CHROMEOS) | 107 #if !defined(OS_CHROMEOS) |
108 #if defined(USE_ASH) | 108 #if defined(USE_ASH) |
109 CHECK(aura::Env::GetInstance()); | 109 CHECK(aura::Env::GetInstance()); |
110 active_desktop_monitor_.reset(new ActiveDesktopMonitor(GetInitialDesktop())); | 110 active_desktop_monitor_.reset(new ActiveDesktopMonitor(GetInitialDesktop())); |
111 #endif | 111 #endif |
112 #endif | 112 #endif |
113 | 113 |
oshima
2015/03/18 21:50:46
is it possible to move the gfx::screen creation he
stapelberg
2015/03/19 07:54:52
No. If I do that, Chromium will segfault with the
| |
114 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 114 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
115 if (GetInitialDesktop() != chrome::HOST_DESKTOP_TYPE_ASH) | 115 if (GetInitialDesktop() != chrome::HOST_DESKTOP_TYPE_ASH) |
116 views::LinuxUI::instance()->Initialize(); | 116 views::LinuxUI::instance()->Initialize(); |
117 #endif | 117 #endif |
118 } | 118 } |
119 | 119 |
120 void ChromeBrowserMainExtraPartsAura::PreCreateThreads() { | 120 void ChromeBrowserMainExtraPartsAura::PreCreateThreads() { |
121 #if !defined(OS_CHROMEOS) | 121 #if !defined(OS_CHROMEOS) |
122 #if defined(USE_ASH) | 122 #if defined(USE_ASH) |
123 if (!chrome::ShouldOpenAshOnStartup()) | 123 if (!chrome::ShouldOpenAshOnStartup()) |
124 #endif | 124 #endif |
125 { | 125 { |
126 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, | 126 gfx::Screen* screen = views::CreateDesktopScreen(); |
127 views::CreateDesktopScreen()); | 127 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen); |
128 #if defined(USE_X11) | |
129 views::LinuxUI::instance()->UpdateDeviceScaleFactor( | |
130 screen->GetPrimaryDisplay().device_scale_factor()); | |
131 #endif | |
128 } | 132 } |
129 #endif | 133 #endif |
130 } | 134 } |
131 | 135 |
132 void ChromeBrowserMainExtraPartsAura::PreProfileInit() { | 136 void ChromeBrowserMainExtraPartsAura::PreProfileInit() { |
133 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 137 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
134 // Now that we have some minimal ui initialized, check to see if we're | 138 // Now that we have some minimal ui initialized, check to see if we're |
135 // running as root and bail if we are. | 139 // running as root and bail if we are. |
136 DetectRunningAsRoot(); | 140 DetectRunningAsRoot(); |
137 #endif | 141 #endif |
(...skipping 27 matching lines...) Expand all Loading... | |
165 chrome::MESSAGE_BOX_TYPE_WARNING); | 169 chrome::MESSAGE_BOX_TYPE_WARNING); |
166 | 170 |
167 // Avoids gpu_process_transport_factory.cc(153)] Check failed: | 171 // Avoids gpu_process_transport_factory.cc(153)] Check failed: |
168 // per_compositor_data_.empty() when quit is chosen. | 172 // per_compositor_data_.empty() when quit is chosen. |
169 base::RunLoop().RunUntilIdle(); | 173 base::RunLoop().RunUntilIdle(); |
170 | 174 |
171 exit(EXIT_FAILURE); | 175 exit(EXIT_FAILURE); |
172 } | 176 } |
173 } | 177 } |
174 #endif | 178 #endif |
OLD | NEW |