Chromium Code Reviews| Index: ui/views/cocoa/views_scrollbar_bridge.h |
| diff --git a/ui/views/cocoa/views_scrollbar_bridge.h b/ui/views/cocoa/views_scrollbar_bridge.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..01eee4eb9447ba02a962ad4672e0887a058045a9 |
| --- /dev/null |
| +++ b/ui/views/cocoa/views_scrollbar_bridge.h |
| @@ -0,0 +1,38 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef UI_VIEWS_COCOA_VIEWS_SCROLLBAR_BRIDGE_DELEGATE_H_ |
| +#define UI_VIEWS_COCOA_VIEWS_SCROLLBAR_BRIDGE_DELEGATE_H_ |
| + |
| +#import <Cocoa/Cocoa.h> |
| + |
| +#import "base/mac/scoped_nsobject.h" |
| +#include "ui/views/views_export.h" |
| + |
| +// The delegate set to ViewsScrollbarBridge. |
| +class ViewsScrollbarBridgeDelegate { |
| + public: |
| + virtual void OnScrollerStyleChanged() = 0; |
| +}; |
| + |
| +// A bridge to NSScroller managed by NativeCocoaScrollbar. Serves as a helper |
| +// class to bridge NSScroller notifications and functions to |
| +// NativeCocoaScrollbar. |
| +@interface ViewsScrollbarBridge : NSObject { |
| + @private |
| + ViewsScrollbarBridgeDelegate* delegate_; // Weak. Owns this. |
| +} |
| + |
| +// Initialize with the given |delegate|. |
| +- (id)initWithDelegate:(ViewsScrollbarBridgeDelegate*)delegate; |
| + |
| +// Called when we receive a NSPreferredScrollerStyleDidChangeNotification. |
| +- (void)onScrollerStyleChanged:(NSNotification*)notification; |
|
tapted
2016/02/08 00:31:15
nit: move to private `@interface ViewsScrollbarBri
spqchan
2016/02/09 21:21:25
Done.
|
| + |
| +// Returns the style of scrollers that OSX is using. |
| +- (NSScrollerStyle)getPreferredScrollerStyle; |
| + |
| +@end |
| + |
| +#endif |