Chromium Code Reviews| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 { |
|
Daniel Erat
2015/03/16 13:57:53
the code that creates LinuxUI in chrome/browser/ui
stapelberg
2015/03/17 08:36:33
Done.
| |
| 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 views::LinuxUI *gtk2_ui = views::LinuxUI::instance(); | |
|
Daniel Erat
2015/03/16 13:57:53
nit: '*' goes to left of space
stapelberg
2015/03/17 08:36:33
Done.
| |
| 129 CHECK(gtk2_ui); | |
|
Daniel Erat
2015/03/16 13:57:53
i'd just inline the views::LinuxUI::instance() whe
stapelberg
2015/03/17 08:36:33
Done.
| |
| 130 gfx::Display display = screen->GetPrimaryDisplay(); | |
| 131 CHECK(display.is_valid()); | |
|
Daniel Erat
2015/03/16 13:57:53
i don't see how it can ever be invalid.
stapelberg
2015/03/17 08:36:33
Done.
| |
| 132 gtk2_ui->UpdateDeviceScaleFactor(display.device_scale_factor()); | |
| 128 } | 133 } |
| 129 #endif | 134 #endif |
| 130 } | 135 } |
| 131 | 136 |
| 132 void ChromeBrowserMainExtraPartsAura::PreProfileInit() { | 137 void ChromeBrowserMainExtraPartsAura::PreProfileInit() { |
| 133 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 138 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 134 // Now that we have some minimal ui initialized, check to see if we're | 139 // Now that we have some minimal ui initialized, check to see if we're |
| 135 // running as root and bail if we are. | 140 // running as root and bail if we are. |
| 136 DetectRunningAsRoot(); | 141 DetectRunningAsRoot(); |
| 137 #endif | 142 #endif |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 165 chrome::MESSAGE_BOX_TYPE_WARNING); | 170 chrome::MESSAGE_BOX_TYPE_WARNING); |
| 166 | 171 |
| 167 // Avoids gpu_process_transport_factory.cc(153)] Check failed: | 172 // Avoids gpu_process_transport_factory.cc(153)] Check failed: |
| 168 // per_compositor_data_.empty() when quit is chosen. | 173 // per_compositor_data_.empty() when quit is chosen. |
| 169 base::RunLoop().RunUntilIdle(); | 174 base::RunLoop().RunUntilIdle(); |
| 170 | 175 |
| 171 exit(EXIT_FAILURE); | 176 exit(EXIT_FAILURE); |
| 172 } | 177 } |
| 173 } | 178 } |
| 174 #endif | 179 #endif |
| OLD | NEW |