Home | History | Annotate | Download | only in cocoa
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef UI_APP_LIST_COCOA_SCROLL_VIEW_WITH_NO_SCROLLBARS_H_
      6 #define UI_APP_LIST_COCOA_SCROLL_VIEW_WITH_NO_SCROLLBARS_H_
      7 
      8 #include <Cocoa/Cocoa.h>
      9 
     10 // Delegate to notify when a user interaction to scroll completes.
     11 @protocol GestureScrollDelegate
     12 
     13 // Called when a scroll gesture is observed, or when it completes.
     14 - (void)userScrolling:(BOOL)isScrolling;
     15 
     16 @end
     17 
     18 // NSScrollView has a quirk when created programatically that causes gesture
     19 // scrolling to fail if it does not have a scroll bar. This provides a scroll
     20 // view using custom scrollers that are not visible.
     21 @interface ScrollViewWithNoScrollbars : NSScrollView {
     22  @private
     23   id<GestureScrollDelegate> delegate_;
     24 }
     25 
     26 @property(assign, nonatomic) id<GestureScrollDelegate> delegate;
     27 
     28 @end
     29 
     30 #endif  // UI_APP_LIST_COCOA_SCROLL_VIEW_WITH_NO_SCROLLBARS_H_
     31