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

Unified Diff: chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc

Issue 1626733002: Don't try to use new OTR theming for non-browser-window windows on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« chrome/browser/ui/aura/DEPS ('K') | « chrome/browser/ui/aura/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc
diff --git a/chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc b/chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc
index 7c836e3ff561f88e39151672e8e822b559625a06..a42ea33ac29cb6c305287d467cc21aaf599ba760 100644
--- a/chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc
+++ b/chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc
@@ -23,6 +23,7 @@
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
#include "base/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/common/pref_names.h"
#include "ui/aura/window.h"
#include "ui/base/ime/input_method_initializer.h"
@@ -51,6 +52,8 @@ ui::NativeTheme* GetNativeThemeForWindow(aura::Window* window) {
return nullptr;
Profile* profile = nullptr;
+ // Window types not listed here (such as tooltips) will never use Chrome
+ // theming.
if (window->type() == ui::wm::WINDOW_TYPE_NORMAL ||
window->type() == ui::wm::WINDOW_TYPE_POPUP ||
window->type() == ui::wm::WINDOW_TYPE_CONTROL) {
@@ -59,8 +62,16 @@ ui::NativeTheme* GetNativeThemeForWindow(aura::Window* window) {
}
if (profile && !profile->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme)) {
- return profile->IsOffTheRecord() ? ui::NativeThemeDarkAura::instance()
- : ui::NativeThemeAura::instance();
+ // Only toplevel browser windows and CONTROL type windows (such as the find
+ // in page bar) should use special theming for off the record mode.
+ // WINDOW_TYPE_NORMAL is not enough to distinguish browser windows because
+ // it also encompasses dialogs.
+ bool eligible_for_otr = window->type() == ui::wm::WINDOW_TYPE_CONTROL ||
+ BrowserView::GetBrowserViewForNativeWindow(window);
+ if (eligible_for_otr && profile->IsOffTheRecord())
+ return ui::NativeThemeDarkAura::instance();
+
+ return ui::NativeThemeAura::instance();
}
return nullptr;
« chrome/browser/ui/aura/DEPS ('K') | « chrome/browser/ui/aura/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698