| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/scoped_nsobject.h" | 7 #include "base/scoped_nsobject.h" |
| 8 #import "chrome/browser/cocoa/bookmark_button.h" | 8 #import "chrome/browser/cocoa/bookmark_button.h" |
| 9 | 9 |
| 10 @class BookmarkBarController; | 10 @class BookmarkBarController; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Our buttons. We do not have buttons for nested folders. | 57 // Our buttons. We do not have buttons for nested folders. |
| 58 scoped_nsobject<NSMutableArray> buttons_; | 58 scoped_nsobject<NSMutableArray> buttons_; |
| 59 | 59 |
| 60 // The scroll view that contains our main button view (below). | 60 // The scroll view that contains our main button view (below). |
| 61 IBOutlet NSScrollView* scrollView_; | 61 IBOutlet NSScrollView* scrollView_; |
| 62 | 62 |
| 63 // Are we scrollable? If no, the full contents of the folder are | 63 // Are we scrollable? If no, the full contents of the folder are |
| 64 // always visible. | 64 // always visible. |
| 65 BOOL scrollable_; | 65 BOOL scrollable_; |
| 66 | 66 |
| 67 BOOL scrollUpArrowShown_; |
| 68 BOOL scrollDownArrowShown_; |
| 69 |
| 67 // The main view of this window (where the buttons go). | 70 // The main view of this window (where the buttons go). |
| 68 IBOutlet BookmarkBarFolderView* mainView_; | 71 IBOutlet BookmarkBarFolderView* mainView_; |
| 69 | 72 |
| 70 // Weak; we keep track to work around a | 73 // Weak; we keep track to work around a |
| 71 // setShowsBorderOnlyWhileMouseInside bug. | 74 // setShowsBorderOnlyWhileMouseInside bug. |
| 72 BookmarkButton* buttonThatMouseIsIn_; | 75 BookmarkButton* buttonThatMouseIsIn_; |
| 73 | 76 |
| 74 // The context menu for a bookmark button which represents an URL. | 77 // The context menu for a bookmark button which represents an URL. |
| 75 IBOutlet NSMenu* buttonMenu_; | 78 IBOutlet NSMenu* buttonMenu_; |
| 76 | 79 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 93 | 96 |
| 94 // Implement basic menu scrolling through this tracking area. | 97 // Implement basic menu scrolling through this tracking area. |
| 95 scoped_nsobject<NSTrackingArea> scrollTrackingArea_; | 98 scoped_nsobject<NSTrackingArea> scrollTrackingArea_; |
| 96 | 99 |
| 97 // Timer to continue scrolling as needed. We own the timer but | 100 // Timer to continue scrolling as needed. We own the timer but |
| 98 // don't release it when done (we invalidate it). | 101 // don't release it when done (we invalidate it). |
| 99 NSTimer* scrollTimer_; | 102 NSTimer* scrollTimer_; |
| 100 | 103 |
| 101 // Amount to scroll by on each timer fire. Can be + or -. | 104 // Amount to scroll by on each timer fire. Can be + or -. |
| 102 CGFloat verticalScrollDelta_; | 105 CGFloat verticalScrollDelta_; |
| 106 |
| 107 // We need to know the size of the vertical scrolling arrows so we |
| 108 // can obscure/unobscure them. |
| 109 CGFloat verticalScrollArrowHeight_; |
| 103 } | 110 } |
| 104 | 111 |
| 105 // Designated initializer. | 112 // Designated initializer. |
| 106 - (id)initWithParentButton:(BookmarkButton*)button | 113 - (id)initWithParentButton:(BookmarkButton*)button |
| 107 parentController:(BookmarkBarFolderController*)parentController | 114 parentController:(BookmarkBarFolderController*)parentController |
| 108 barController:(BookmarkBarController*)barController; | 115 barController:(BookmarkBarController*)barController; |
| 109 | 116 |
| 110 // Return the parent button that owns the bookmark folder we represent. | 117 // Return the parent button that owns the bookmark folder we represent. |
| 111 - (BookmarkButton*)parentButton; | 118 - (BookmarkButton*)parentButton; |
| 112 | 119 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 143 @end | 150 @end |
| 144 | 151 |
| 145 @interface BookmarkBarFolderController(TestingAPI) | 152 @interface BookmarkBarFolderController(TestingAPI) |
| 146 - (NSView*)mainView; | 153 - (NSView*)mainView; |
| 147 - (NSPoint)windowTopLeft; | 154 - (NSPoint)windowTopLeft; |
| 148 - (NSArray*)buttons; | 155 - (NSArray*)buttons; |
| 149 - (BookmarkBarFolderController*)folderController; | 156 - (BookmarkBarFolderController*)folderController; |
| 150 - (id)folderTarget; | 157 - (id)folderTarget; |
| 151 - (void)configureWindowLevel; | 158 - (void)configureWindowLevel; |
| 152 - (void)performOneScroll:(CGFloat)delta; | 159 - (void)performOneScroll:(CGFloat)delta; |
| 160 |
| 161 // Return YES if we can scroll up or down. |
| 162 - (BOOL)canScrollUp; |
| 163 - (BOOL)canScrollDown; |
| 164 |
| 153 @end | 165 @end |
| 154 | 166 |
| OLD | NEW |