Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h |
=================================================================== |
--- chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h (revision 70424) |
+++ chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h (working copy) |
@@ -2,6 +2,10 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_FOLDER_CONTROLLER_H_ |
+#define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_FOLDER_CONTROLLER_H_ |
+#pragma once |
+ |
#import <Cocoa/Cocoa.h> |
#include "base/scoped_nsobject.h" |
@@ -11,6 +15,8 @@ |
@class BookmarkBarFolderView; |
@class BookmarkFolderTarget; |
@class BookmarkBarFolderHoverState; |
+@class BookmarkBarFolderWindow; |
+@class BookmarkBarFolderWindowContentView; |
// A controller for the pop-up windows from bookmark folder buttons |
// which look sort of like menus. |
@@ -60,20 +66,24 @@ |
// The scroll view that contains our main button view (below). |
IBOutlet NSScrollView* scrollView_; |
- // Are we scrollable? If no, the full contents of the folder are |
- // always visible. |
- BOOL scrollable_; |
+ // The view defining the visible area in which we draw our content. |
+ IBOutlet BookmarkBarFolderWindowContentView* visibleView_; |
- BOOL scrollUpArrowShown_; |
- BOOL scrollDownArrowShown_; |
+ // The main view of this window (where the buttons go) within the scroller. |
+ IBOutlet BookmarkBarFolderView* folderView_; |
+ // A window used to show the shadow behind the main window when it is |
+ // scrollable. |
+ IBOutlet BookmarkBarFolderWindow* shadowWindow_; |
John Grabowski
2011/01/06 23:30:18
Why are you faking a shadow yourself instead of us
mrossetti
2011/01/08 01:45:38
Added commentary to explain.
|
+ |
+ // The up and down scroll arrow views. |
John Grabowski
2011/01/06 23:30:18
Be clear that these views are not inside the scrol
mrossetti
2011/01/08 01:45:38
Added commentary.
|
+ IBOutlet NSView* scrollDownArrowView_; // Positioned at the top. |
+ IBOutlet NSView* scrollUpArrowView_; // Positioned at the bottom. |
+ |
// YES if subfolders should grow to the right (the default). |
// Direction switches if we'd grow off the screen. |
BOOL subFolderGrowthToRight_; |
- // The main view of this window (where the buttons go). |
- IBOutlet BookmarkBarFolderView* mainView_; |
- |
// Weak; we keep track to work around a |
// setShowsBorderOnlyWhileMouseInside bug. |
BookmarkButton* buttonThatMouseIsIn_; |
@@ -105,6 +115,10 @@ |
// don't release it when done (we invalidate it). |
NSTimer* scrollTimer_; |
+ // Precalculated left and right edge padding of buttons in a folder menu. |
John Grabowski
2011/01/06 23:30:18
Reading this quickly I wonder why these aren't con
mrossetti
2011/01/08 01:45:38
These are calculated from the nib layout and are n
|
+ CGFloat leftPadding_; |
+ CGFloat rightPadding_; |
+ |
// Amount to scroll by on each timer fire. Can be + or -. |
CGFloat verticalScrollDelta_; |
@@ -161,7 +175,6 @@ |
@end |
@interface BookmarkBarFolderController(TestingAPI) |
-- (NSView*)mainView; |
- (NSPoint)windowTopLeftForWidth:(int)windowWidth; |
- (NSArray*)buttons; |
- (BookmarkBarFolderController*)folderController; |
@@ -172,11 +185,15 @@ |
// Set to YES in order to prevent animations. |
- (void)setIgnoreAnimations:(BOOL)ignore; |
-// Return YES if we can scroll up or down. |
+// Return YES if the scroll-up or scroll-down arrows are showing. |
- (BOOL)canScrollUp; |
- (BOOL)canScrollDown; |
-// Return YES if the scrollable_ flag has been set. |
-- (BOOL)scrollable; |
+- (CGFloat)verticalScrollArrowHeight; |
+- (NSView*)visibleView; |
+- (NSView*)scrollView; |
+- (NSView*)folderView; |
- (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point; |
@end |
+ |
+#endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_FOLDER_CONTROLLER_H_ |