| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 + (void)appearancePrefsChanged:(NSNotification*)notification { | 66 + (void)appearancePrefsChanged:(NSNotification*)notification { |
| 67 [self notifyPrefsChangedWithRedraw:YES]; | 67 [self notifyPrefsChangedWithRedraw:YES]; |
| 68 } | 68 } |
| 69 | 69 |
| 70 + (void)behaviorPrefsChanged:(NSNotification*)notification { | 70 + (void)behaviorPrefsChanged:(NSNotification*)notification { |
| 71 [self notifyPrefsChangedWithRedraw:NO]; | 71 [self notifyPrefsChangedWithRedraw:NO]; |
| 72 } | 72 } |
| 73 | 73 |
| 74 + (void)notifyPrefsChangedWithRedraw:(BOOL)redraw { | 74 + (void)notifyPrefsChangedWithRedraw:(BOOL)redraw { |
| 75 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 75 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 76 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | 76 NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; |
| 77 [defaults synchronize]; | 77 [defaults synchronize]; |
| 78 | 78 |
| 79 content::ThemeHelperMac::SendThemeChangeToAllRenderers( | 79 content::ThemeHelperMac::SendThemeChangeToAllRenderers( |
| 80 [defaults floatForKey:@"NSScrollerButtonDelay"], | 80 [defaults floatForKey:@"NSScrollerButtonDelay"], |
| 81 [defaults floatForKey:@"NSScrollerButtonPeriod"], | 81 [defaults floatForKey:@"NSScrollerButtonPeriod"], |
| 82 [defaults boolForKey:@"AppleScrollerPagingBehavior"], | 82 [defaults boolForKey:@"AppleScrollerPagingBehavior"], |
| 83 content::ThemeHelperMac::GetPreferredScrollerStyle(), | 83 content::ThemeHelperMac::GetPreferredScrollerStyle(), |
| 84 redraw); | 84 redraw); |
| 85 } | 85 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); | 142 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); |
| 143 rph->Send(new ViewMsg_UpdateScrollbarTheme( | 143 rph->Send(new ViewMsg_UpdateScrollbarTheme( |
| 144 [defaults floatForKey:@"NSScrollerButtonDelay"], | 144 [defaults floatForKey:@"NSScrollerButtonDelay"], |
| 145 [defaults floatForKey:@"NSScrollerButtonPeriod"], | 145 [defaults floatForKey:@"NSScrollerButtonPeriod"], |
| 146 [defaults boolForKey:@"AppleScrollerPagingBehavior"], | 146 [defaults boolForKey:@"AppleScrollerPagingBehavior"], |
| 147 GetPreferredScrollerStyle(), | 147 GetPreferredScrollerStyle(), |
| 148 false)); | 148 false)); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace content | 151 } // namespace content |
| OLD | NEW |