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

Side by Side Diff: chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc

Issue 2693783005: Revert of Linux Aura: Use Aura theme on all windows when 'Use Classic theme' is used (Closed)
Patch Set: Created 3 years, 10 months 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 | chrome/browser/ui/views/chrome_views_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/views/chrome_browser_main_extra_parts_views_linux.h" 5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "chrome/browser/chrome_browser_main.h" 8 #include "chrome/browser/chrome_browser_main.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/themes/theme_service.h" 10 #include "chrome/browser/themes/theme_service.h"
(...skipping 12 matching lines...) Expand all
23 #include "ui/native_theme/native_theme_aura.h" 23 #include "ui/native_theme/native_theme_aura.h"
24 #include "ui/native_theme/native_theme_dark_aura.h" 24 #include "ui/native_theme/native_theme_dark_aura.h"
25 #include "ui/views/linux_ui/linux_ui.h" 25 #include "ui/views/linux_ui/linux_ui.h"
26 #include "ui/views/widget/desktop_aura/desktop_screen.h" 26 #include "ui/views/widget/desktop_aura/desktop_screen.h"
27 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" 27 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
28 #include "ui/views/widget/native_widget_aura.h" 28 #include "ui/views/widget/native_widget_aura.h"
29 29
30 namespace { 30 namespace {
31 31
32 ui::NativeTheme* GetNativeThemeForWindow(aura::Window* window) { 32 ui::NativeTheme* GetNativeThemeForWindow(aura::Window* window) {
33 if (!window)
34 return nullptr;
35
33 Profile* profile = nullptr; 36 Profile* profile = nullptr;
34 if (window) { 37 // Window types not listed here (such as tooltips) will never use Chrome
38 // theming.
39 if (window->type() == ui::wm::WINDOW_TYPE_NORMAL ||
40 window->type() == ui::wm::WINDOW_TYPE_POPUP) {
35 profile = reinterpret_cast<Profile*>( 41 profile = reinterpret_cast<Profile*>(
36 window->GetNativeWindowProperty(Profile::kProfileKey)); 42 window->GetNativeWindowProperty(Profile::kProfileKey));
37 } 43 }
38 44
39 // If using the system (GTK) theme, don't use an Aura NativeTheme at all. 45 // If using the system (GTK) theme, don't use an Aura NativeTheme at all.
40 // NB: ThemeService::UsingSystemTheme() might lag behind this pref. See 46 // NB: ThemeService::UsingSystemTheme() might lag behind this pref. See
41 // http://crbug.com/585522 47 // http://crbug.com/585522
42 if (!profile || profile->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme)) 48 if (!profile || profile->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme))
43 return nullptr; 49 return nullptr;
44 50
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // because its display::Screen instance depends on it. 86 // because its display::Screen instance depends on it.
81 views::LinuxUI::instance()->UpdateDeviceScaleFactor(); 87 views::LinuxUI::instance()->UpdateDeviceScaleFactor();
82 ChromeBrowserMainExtraPartsViews::PreCreateThreads(); 88 ChromeBrowserMainExtraPartsViews::PreCreateThreads();
83 views::X11DesktopHandler::get()->AddObserver(this); 89 views::X11DesktopHandler::get()->AddObserver(this);
84 } 90 }
85 91
86 void ChromeBrowserMainExtraPartsViewsLinux::OnWorkspaceChanged( 92 void ChromeBrowserMainExtraPartsViewsLinux::OnWorkspaceChanged(
87 const std::string& new_workspace) { 93 const std::string& new_workspace) {
88 BrowserList::MoveBrowsersInWorkspaceToFront(new_workspace); 94 BrowserList::MoveBrowsersInWorkspaceToFront(new_workspace);
89 } 95 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/chrome_views_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698