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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h

Issue 5694001: Rework how bookmark bar folder menus and submenus are layed out when scrollin... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 12 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698