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

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

Issue 239093007: Update Windows UI on system color changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore change from bad rebase. 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
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_border.h ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/gtk2_border.cc
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_border.cc b/chrome/browser/ui/libgtk2ui/gtk2_border.cc
index c98888addbda716270c10a392f30d73347e92126..31a239690e7c9f6c04fe7136c186d124c1f6f77a 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_border.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_border.cc
@@ -7,6 +7,7 @@
#include <gtk/gtk.h>
#include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
+#include "chrome/browser/ui/libgtk2ui/native_theme_gtk2.h"
#include "third_party/skia/include/effects/SkLerpXfermode.h"
#include "ui/base/theme_provider.h"
#include "ui/gfx/animation/animation.h"
@@ -73,12 +74,12 @@ class ButtonImageSkiaSource : public gfx::ImageSkiaSource {
Gtk2Border::Gtk2Border(Gtk2UI* gtk2_ui,
views::LabelButton* owning_button)
: gtk2_ui_(gtk2_ui),
- owning_button_(owning_button) {
- gtk2_ui_->AddNativeThemeChangeObserver(this);
+ owning_button_(owning_button),
+ observer_manager_(this) {
+ observer_manager_.Add(NativeThemeGtk2::instance());
}
Gtk2Border::~Gtk2Border() {
- gtk2_ui_->RemoveNativeThemeChangeObserver(this);
}
void Gtk2Border::Paint(const views::View& view, gfx::Canvas* canvas) {
@@ -122,7 +123,8 @@ gfx::Size Gtk2Border::GetMinimumSize() const {
return gfx::Size(insets.width(), insets.height());
}
-void Gtk2Border::OnNativeThemeChanged() {
+void Gtk2Border::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) {
+ DCHECK_EQ(observed_theme, NativeThemeGtk2::instance());
for (int i = 0; i < kNumberOfFocusedStates; ++i) {
for (int j = 0; j < views::Button::STATE_COUNT; ++j) {
button_images_[i][j] = gfx::ImageSkia();
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_border.h ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698