Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc

Issue 1427803004: GTK: Apply browser theme to TYPE_CONTROL windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: relative ps Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 28 matching lines...) Expand all
39 39
40 #if !defined(OS_CHROMEOS) 40 #if !defined(OS_CHROMEOS)
41 #include "ui/views/widget/desktop_aura/desktop_screen.h" 41 #include "ui/views/widget/desktop_aura/desktop_screen.h"
42 #endif 42 #endif
43 43
44 namespace { 44 namespace {
45 45
46 #if defined(USE_X11) && !defined(OS_CHROMEOS) 46 #if defined(USE_X11) && !defined(OS_CHROMEOS)
47 ui::NativeTheme* GetNativeThemeForWindow(aura::Window* window) { 47 ui::NativeTheme* GetNativeThemeForWindow(aura::Window* window) {
48 if (!window) 48 if (!window)
49 return NULL; 49 return nullptr;
50 50
51 Profile* profile = NULL; 51 Profile* profile = nullptr;
52 if (window->type() == ui::wm::WINDOW_TYPE_NORMAL || 52 if (window->type() == ui::wm::WINDOW_TYPE_NORMAL ||
53 window->type() == ui::wm::WINDOW_TYPE_POPUP) { 53 window->type() == ui::wm::WINDOW_TYPE_POPUP ||
54 window->type() == ui::wm::WINDOW_TYPE_CONTROL) {
54 profile = reinterpret_cast<Profile*>( 55 profile = reinterpret_cast<Profile*>(
55 window->GetNativeWindowProperty(Profile::kProfileKey)); 56 window->GetNativeWindowProperty(Profile::kProfileKey));
56 } 57 }
57 58
58 if (profile && !profile->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme)) 59 if (profile && !profile->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme))
59 return ui::NativeThemeAura::instance(); 60 return ui::NativeThemeAura::instance();
60 61
61 return NULL; 62 return nullptr;
62 } 63 }
63 #endif 64 #endif
64 65
65 #if !defined(OS_CHROMEOS) && defined(USE_ASH) 66 #if !defined(OS_CHROMEOS) && defined(USE_ASH)
66 // Returns the desktop this process was initially launched in. 67 // Returns the desktop this process was initially launched in.
67 chrome::HostDesktopType GetInitialDesktop() { 68 chrome::HostDesktopType GetInitialDesktop() {
68 #if defined(OS_WIN) && defined(USE_ASH) 69 #if defined(OS_WIN) && defined(USE_ASH)
69 const base::CommandLine* command_line = 70 const base::CommandLine* command_line =
70 base::CommandLine::ForCurrentProcess(); 71 base::CommandLine::ForCurrentProcess();
71 if (command_line->HasSwitch(switches::kViewerConnect) || 72 if (command_line->HasSwitch(switches::kViewerConnect) ||
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 117
117 #if defined(USE_X11) && !defined(OS_CHROMEOS) 118 #if defined(USE_X11) && !defined(OS_CHROMEOS)
118 if (GetInitialDesktop() != chrome::HOST_DESKTOP_TYPE_ASH) 119 if (GetInitialDesktop() != chrome::HOST_DESKTOP_TYPE_ASH)
119 views::LinuxUI::instance()->Initialize(); 120 views::LinuxUI::instance()->Initialize();
120 #endif 121 #endif
121 } 122 }
122 123
123 void ChromeBrowserMainExtraPartsAura::PreCreateThreads() { 124 void ChromeBrowserMainExtraPartsAura::PreCreateThreads() {
124 #if !defined(OS_CHROMEOS) 125 #if !defined(OS_CHROMEOS)
125 #if defined(USE_ASH) 126 #if defined(USE_ASH)
126 if (!chrome::ShouldOpenAshOnStartup()) 127 bool should_open_ash = chrome::ShouldOpenAshOnStartup();
128 #else
129 bool should_open_ash = false;
Evan Stade 2015/10/29 22:59:43 p.s. this change was just made to silence a presub
Elliot Glaysher 2015/10/29 23:04:51 Can't wait until ash is gone from chrome.
127 #endif 130 #endif
128 { 131 if (!should_open_ash) {
129 gfx::Screen* screen = views::CreateDesktopScreen(); 132 gfx::Screen* screen = views::CreateDesktopScreen();
130 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen); 133 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen);
131 #if defined(USE_X11) 134 #if defined(USE_X11)
132 views::LinuxUI::instance()->UpdateDeviceScaleFactor( 135 views::LinuxUI::instance()->UpdateDeviceScaleFactor(
133 screen->GetPrimaryDisplay().device_scale_factor()); 136 screen->GetPrimaryDisplay().device_scale_factor());
134 #endif 137 #endif
135 } 138 }
136 #endif 139 #endif
137 } 140 }
138 141
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 chrome::MESSAGE_BOX_TYPE_WARNING); 175 chrome::MESSAGE_BOX_TYPE_WARNING);
173 176
174 // Avoids gpu_process_transport_factory.cc(153)] Check failed: 177 // Avoids gpu_process_transport_factory.cc(153)] Check failed:
175 // per_compositor_data_.empty() when quit is chosen. 178 // per_compositor_data_.empty() when quit is chosen.
176 base::RunLoop().RunUntilIdle(); 179 base::RunLoop().RunUntilIdle();
177 180
178 exit(EXIT_FAILURE); 181 exit(EXIT_FAILURE);
179 } 182 }
180 } 183 }
181 #endif 184 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698