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

Unified Diff: ui/views/widget/root_view.cc

Issue 239093007: Update Windows UI on system color changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and 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
« ui/native_theme/native_theme.cc ('K') | « ui/views/widget/root_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/root_view.cc
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index b103943cd13e3bd81f2f5af4ac652c1a13e47c4e..1638fe24162a25c492afe7225c05079bbb7b29ff 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -15,6 +15,7 @@
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
+#include "ui/native_theme/native_theme.h"
#include "ui/views/focus/view_storage.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view_targeter.h"
@@ -119,9 +120,11 @@ RootView::RootView(Widget* widget)
old_dispatch_target_(NULL) {
AddPreTargetHandler(pre_dispatch_handler_.get());
SetEventTargeter(scoped_ptr<ui::EventTargeter>(new ViewTargeter()));
+ GetNativeTheme()->AddObserver(this);
Evan Stade 2014/04/22 17:43:44 ScopedObserver?
msw 2014/04/22 19:48:58 Eh, it doesn't seem worthwhile to add a class memb
Evan Stade 2014/04/22 21:09:18 I always prefer scoping variables over doing stuff
msw 2014/04/23 00:34:04 Done (in Widget).
}
RootView::~RootView() {
+ GetNativeTheme()->RemoveObserver(this);
// If we have children remove them explicitly so to make sure a remove
// notification is sent for each one of them.
if (has_children())
@@ -502,6 +505,10 @@ void RootView::UpdateParentLayer() {
ReparentLayer(gfx::Vector2d(GetMirroredX(), y()), widget_->GetLayer());
}
+void RootView::OnNativeThemeChange() {
+ PropagateNativeThemeChanged(GetNativeTheme());
+}
+
////////////////////////////////////////////////////////////////////////////////
// RootView, protected:
« ui/native_theme/native_theme.cc ('K') | « ui/views/widget/root_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698