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

Unified Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 2251123002: macviews: honor system control tint setting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use luminance Created 4 years, 4 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 | « ui/views/cocoa/bridged_native_widget.h ('k') | ui/views/cocoa/views_nswindow_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_native_widget.mm
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm
index 16af930118c3a8fdb3e9b673893bcc1a3b7512ef..22798be75c2d58141218fbf1d490b764e5b0de31 100644
--- a/ui/views/cocoa/bridged_native_widget.mm
+++ b/ui/views/cocoa/bridged_native_widget.mm
@@ -23,6 +23,7 @@
#include "ui/gfx/geometry/dip_util.h"
#import "ui/gfx/mac/coordinate_conversion.h"
#import "ui/gfx/mac/nswindow_frame_controls.h"
+#import "ui/native_theme/native_theme_mac.h"
#import "ui/views/cocoa/bridged_content_view.h"
#import "ui/views/cocoa/drag_drop_client_mac.h"
#import "ui/views/cocoa/cocoa_mouse_capture.h"
@@ -399,6 +400,12 @@ void BridgedNativeWidget::Init(base::scoped_nsobject<NSWindow> window,
name:NSApplicationDidHideNotification
object:nil];
+ [[NSNotificationCenter defaultCenter]
+ addObserver:window_delegate_
+ selector:@selector(onSystemControlTintChanged:)
+ name:NSControlTintDidChangeNotification
+ object:nil];
+
// Validate the window's initial state, otherwise the bridge's initial
// tracking state will be incorrect.
DCHECK(![window_ isVisible]);
@@ -833,6 +840,10 @@ void BridgedNativeWidget::OnVisibilityChanged() {
[window_ setAutodisplay:window_visible_];
}
+void BridgedNativeWidget::OnSystemControlTintChanged() {
+ ui::NativeThemeMac::instance()->NotifyObservers();
+}
+
void BridgedNativeWidget::OnBackingPropertiesChanged() {
if (layer())
UpdateLayerProperties();
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.h ('k') | ui/views/cocoa/views_nswindow_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698