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

Side by Side Diff: ui/views/cocoa/views_scrollbar_bridge.mm

Issue 1671313002: MacViews: Overlay Scrollbars with Show/Hide Animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments and fixed nits Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ui/views/cocoa/views_scrollbar_bridge.h"
6
7 #include "base/mac/sdk_forward_declarations.h"
8
9 @implementation ViewsScrollbarBridge
10
11 - (id)initWithDelegate:(ViewsScrollbarBridgeDelegate*)delegate {
12 DCHECK(delegate);
13 if ((self = [super init])) {
14 delegate_ = delegate;
15 [[NSNotificationCenter defaultCenter]
16 addObserver:self
tapted 2016/02/08 00:31:15 usually `dealloc` should remove this, but since th
spqchan 2016/02/09 21:21:25 Done.
17 selector:@selector(onScrollerStyleChanged:)
18 name:NSPreferredScrollerStyleDidChangeNotification
19 object:nil];
20 }
21 return self;
22 }
23
24 - (void)onScrollerStyleChanged:(NSNotification*)notification {
25 delegate_->OnScrollerStyleChanged();
26 }
27
28 - (NSScrollerStyle)getPreferredScrollerStyle {
29 if (![NSScroller respondsToSelector:@selector(preferredScrollerStyle)])
tapted 2016/02/08 00:31:15 this shouldn't be needed much longer, since it is
spqchan 2016/02/09 21:21:25 Done.
30 return NSScrollerStyleLegacy;
31 return [NSScroller preferredScrollerStyle];
32 }
33
34 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698