OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/theme_helper_mac.h" | 5 #include "content/browser/theme_helper_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/mac/sdk_forward_declarations.h" | 10 #include "base/mac/sdk_forward_declarations.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 [[NSDistributedNotificationCenter defaultCenter] | 46 [[NSDistributedNotificationCenter defaultCenter] |
47 addObserver:self | 47 addObserver:self |
48 selector:@selector(behaviorPrefsChanged:) | 48 selector:@selector(behaviorPrefsChanged:) |
49 name:@"AppleNoRedisplayAppearancePreferenceChanged" | 49 name:@"AppleNoRedisplayAppearancePreferenceChanged" |
50 object:nil | 50 object:nil |
51 suspensionBehavior:NSNotificationSuspensionBehaviorCoalesce]; | 51 suspensionBehavior:NSNotificationSuspensionBehaviorCoalesce]; |
52 | 52 |
53 // In single-process mode, renderers will catch these notifications | 53 // In single-process mode, renderers will catch these notifications |
54 // themselves and listening for them here may trigger the DCHECK in Observe(). | 54 // themselves and listening for them here may trigger the DCHECK in Observe(). |
55 if ([NSScroller respondsToSelector:@selector(preferredScrollerStyle)] && | 55 if ([NSScroller respondsToSelector:@selector(preferredScrollerStyle)] && |
56 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess)) { | 56 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 57 switches::kSingleProcess)) { |
57 [[NSNotificationCenter defaultCenter] | 58 [[NSNotificationCenter defaultCenter] |
58 addObserver:self | 59 addObserver:self |
59 selector:@selector(behaviorPrefsChanged:) | 60 selector:@selector(behaviorPrefsChanged:) |
60 name:NSPreferredScrollerStyleDidChangeNotification | 61 name:NSPreferredScrollerStyleDidChangeNotification |
61 object:nil]; | 62 object:nil]; |
62 } | 63 } |
63 } | 64 } |
64 | 65 |
65 + (void)appearancePrefsChanged:(NSNotification*)notification { | 66 + (void)appearancePrefsChanged:(NSNotification*)notification { |
66 [self notifyPrefsChangedWithRedraw:YES]; | 67 [self notifyPrefsChangedWithRedraw:YES]; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); | 142 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); |
142 rph->Send(new ViewMsg_UpdateScrollbarTheme( | 143 rph->Send(new ViewMsg_UpdateScrollbarTheme( |
143 [defaults floatForKey:@"NSScrollerButtonDelay"], | 144 [defaults floatForKey:@"NSScrollerButtonDelay"], |
144 [defaults floatForKey:@"NSScrollerButtonPeriod"], | 145 [defaults floatForKey:@"NSScrollerButtonPeriod"], |
145 [defaults boolForKey:@"AppleScrollerPagingBehavior"], | 146 [defaults boolForKey:@"AppleScrollerPagingBehavior"], |
146 GetPreferredScrollerStyle(), | 147 GetPreferredScrollerStyle(), |
147 false)); | 148 false)); |
148 } | 149 } |
149 | 150 |
150 } // namespace content | 151 } // namespace content |
OLD | NEW |