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" |
11 #include "chrome/browser/ui/host_desktop.h" | 11 #include "chrome/browser/ui/host_desktop.h" |
12 #include "chrome/browser/ui/simple_message_box.h" | 12 #include "chrome/browser/ui/simple_message_box.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/grit/chromium_strings.h" | 14 #include "chrome/grit/chromium_strings.h" |
15 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
16 #include "ui/aura/env.h" | 16 #include "ui/aura/env.h" |
17 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
18 #include "ui/base/ui_base_switches.h" | 18 #include "ui/base/ui_base_switches.h" |
| 19 #include "ui/gfx/dpi.h" |
19 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
20 #include "ui/views/widget/native_widget_aura.h" | 21 #include "ui/views/widget/native_widget_aura.h" |
21 | 22 |
22 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 23 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
23 #include "base/prefs/pref_service.h" | 24 #include "base/prefs/pref_service.h" |
24 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" | 26 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" |
26 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
27 #include "ui/aura/window.h" | 28 #include "ui/aura/window.h" |
28 #include "ui/base/ime/input_method_initializer.h" | 29 #include "ui/base/ime/input_method_initializer.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 ChromeBrowserMainExtraPartsAura::~ChromeBrowserMainExtraPartsAura() { | 87 ChromeBrowserMainExtraPartsAura::~ChromeBrowserMainExtraPartsAura() { |
87 } | 88 } |
88 | 89 |
89 void ChromeBrowserMainExtraPartsAura::PreEarlyInitialization() { | 90 void ChromeBrowserMainExtraPartsAura::PreEarlyInitialization() { |
90 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 91 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
91 if (GetInitialDesktop() != chrome::HOST_DESKTOP_TYPE_ASH) { | 92 if (GetInitialDesktop() != chrome::HOST_DESKTOP_TYPE_ASH) { |
92 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. | 93 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. |
93 views::LinuxUI* gtk2_ui = BuildGtk2UI(); | 94 views::LinuxUI* gtk2_ui = BuildGtk2UI(); |
94 gtk2_ui->SetNativeThemeOverride(base::Bind(&GetNativeThemeForWindow)); | 95 gtk2_ui->SetNativeThemeOverride(base::Bind(&GetNativeThemeForWindow)); |
95 views::LinuxUI::SetInstance(gtk2_ui); | 96 views::LinuxUI::SetInstance(gtk2_ui); |
| 97 gfx::InitDeviceScaleFactor(gfx::GetDPIScale()); |
96 } else { | 98 } else { |
97 // TODO(erg): Eventually, we'll need to somehow support IMEs in ash on | 99 // TODO(erg): Eventually, we'll need to somehow support IMEs in ash on |
98 // Linux. | 100 // Linux. |
99 ui::InitializeInputMethodForTesting(); | 101 ui::InitializeInputMethodForTesting(); |
100 } | 102 } |
101 #endif | 103 #endif |
102 } | 104 } |
103 | 105 |
104 void ChromeBrowserMainExtraPartsAura::ToolkitInitialized() { | 106 void ChromeBrowserMainExtraPartsAura::ToolkitInitialized() { |
105 #if !defined(OS_CHROMEOS) | 107 #if !defined(OS_CHROMEOS) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 chrome::MESSAGE_BOX_TYPE_WARNING); | 164 chrome::MESSAGE_BOX_TYPE_WARNING); |
163 | 165 |
164 // Avoids gpu_process_transport_factory.cc(153)] Check failed: | 166 // Avoids gpu_process_transport_factory.cc(153)] Check failed: |
165 // per_compositor_data_.empty() when quit is chosen. | 167 // per_compositor_data_.empty() when quit is chosen. |
166 base::RunLoop().RunUntilIdle(); | 168 base::RunLoop().RunUntilIdle(); |
167 | 169 |
168 exit(EXIT_FAILURE); | 170 exit(EXIT_FAILURE); |
169 } | 171 } |
170 } | 172 } |
171 #endif | 173 #endif |
OLD | NEW |