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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 243633003: use the right NativeTheme on bubbles + dialogs on Aura Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: good enough for now Created 6 years, 8 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
Index: chrome/browser/ui/libgtk2ui/gtk2_ui.cc
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
index 1feebbc86c7c69b95fa71ae125d64188257d3619..e62044056d9dd6469c28945e6266b4814530b572 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
@@ -12,6 +12,7 @@
#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/nix/mime_util_xdg.h"
+#include "base/prefs/pref_service.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/themes/theme_properties.h"
@@ -29,6 +30,8 @@
#include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h"
#include "chrome/browser/ui/libgtk2ui/unity_service.h"
#include "chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
+#include "chrome/common/pref_names.h"
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
#include "printing/printing_context_linux.h"
@@ -43,6 +46,7 @@
#include "ui/gfx/size.h"
#include "ui/gfx/skbitmap_operations.h"
#include "ui/gfx/skia_util.h"
+#include "ui/native_theme/native_theme_aura.h"
#include "ui/views/linux_ui/window_button_order_observer.h"
#if defined(USE_GCONF)
@@ -449,8 +453,18 @@ double Gtk2UI::GetCursorBlinkInterval() const {
return cursor_blink ? (cursor_blink_time / kGtkCursorBlinkCycleFactor) : 0.0;
}
-ui::NativeTheme* Gtk2UI::GetNativeTheme() const {
- return NativeThemeGtk2::instance();
+ui::NativeTheme* Gtk2UI::GetNativeTheme(aura::Window* window) const {
+ Profile* profile = NULL;
+ if (window->type() == ui::wm::WINDOW_TYPE_NORMAL ||
+ window->type() == ui::wm::WINDOW_TYPE_POPUP) {
+ profile = reinterpret_cast<Profile*>(
+ window->GetNativeWindowProperty(Profile::kProfileKey));
Elliot Glaysher 2014/04/21 22:43:20 I sort of worry about destruction order issues her
Evan Stade 2014/04/22 18:33:22 I believe this to be correct.
+ }
+
+ if (profile && !profile->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme))
+ return ui::NativeThemeAura::instance();
+ else
+ return NativeThemeGtk2::instance();
}
bool Gtk2UI::GetDefaultUsesSystemTheme() const {

Powered by Google App Engine
This is Rietveld 408576698