1dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Use of this source code is governed by a BSD-style license that can be
3c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// found in the LICENSE file.
4c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
572a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_FOLDER_CONTROLLER_H_
672a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_FOLDER_CONTROLLER_H_
772a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#pragma once
872a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen
9c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#import <Cocoa/Cocoa.h>
10c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
11ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen#include "base/memory/scoped_nsobject.h"
1221d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen#import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
13dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen#import "chrome/browser/ui/cocoa/tracking_area.h"
14c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
15c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@class BookmarkBarController;
16c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@class BookmarkBarFolderView;
17c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@class BookmarkFolderTarget;
18c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@class BookmarkBarFolderHoverState;
1972a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen@class BookmarkBarFolderWindow;
2072a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen@class BookmarkBarFolderWindowContentView;
21c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
22c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// A controller for the pop-up windows from bookmark folder buttons
23c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// which look sort of like menus.
24c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@interface BookmarkBarFolderController :
25c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    NSWindowController<BookmarkButtonDelegate,
26ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen                       BookmarkButtonControllerProtocol,
27ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen                       NSUserInterfaceValidations> {
28c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch @private
29c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // The button whose click opened us.
30c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  scoped_nsobject<BookmarkButton> parentButton_;
31c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
32c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Bookmark bar folder controller chains are torn down in two ways:
33c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // 1. Clicking "outside" the folder (see use of
34c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // CrApplicationEventHookProtocol in the bookmark bar controller).
35c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // 2. Engaging a different folder (via hover over or explicit click).
36c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  //
37c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // In either case, the BookmarkButtonControllerProtocol method
38c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // closeAllBookmarkFolders gets called.  For bookmark bar folder
39c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // controllers, this is passed up the chain so we begin with a top
40c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // level "close".
41c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // When any bookmark folder window closes, it necessarily tells
42c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // subcontroller windows to close (down the chain), and autoreleases
43c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // the controller.  (Must autorelease since the controller can still
44c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // get delegate events such as windowDidClose).
45c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  //
46c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Bookmark bar folder controllers own their buttons.  When doing
47c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // drag and drop of a button from one sub-sub-folder to a different
48c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // sub-sub-folder, we need to make sure the button's pointers stay
49c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // valid until we've dropped (or cancelled).  Note that such a drag
50c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // causes the source sub-sub-folder (previous parent window) to go
51c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // away (windows close, controllers autoreleased) since you're
52c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // hovering over a different folder chain for dropping.  To keep
53c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // things valid (like the button's target, its delegate, the parent
54c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // cotroller that we have a pointer to below [below], etc), we heep
55c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // strong pointers to our owning controller, so the entire chain
56c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // stays owned.
57c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
58c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Our parent controller, if we are a nested folder, otherwise nil.
59c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Strong to insure the object lives as long as we need it.
60c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  scoped_nsobject<BookmarkBarFolderController> parentController_;
61c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
62c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // The main bar controller from whence we or a parent sprang.
63c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  BookmarkBarController* barController_;  // WEAK: It owns us.
64c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
65c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Our buttons.  We do not have buttons for nested folders.
66c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  scoped_nsobject<NSMutableArray> buttons_;
67c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
68c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // The scroll view that contains our main button view (below).
69c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  IBOutlet NSScrollView* scrollView_;
70c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
7172a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // The view defining the visible area in which we draw our content.
7272a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  IBOutlet BookmarkBarFolderWindowContentView* visibleView_;
7372a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen
7472a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // The main view of this window (where the buttons go) within the scroller.
7572a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  IBOutlet BookmarkBarFolderView* folderView_;
7672a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen
7772a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // A window used to show the shadow behind the main window when it is
7872a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // scrollable. (A 'shadow' window is needed because the main window, when
7972a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // scrollable in either or both directions, will reach completely to the
8072a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // top and/or bottom edge of the screen in order to support mouse tracking
8172a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // during scrolling operations. In that case, though, the 'visible'
8272a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // window must be inset a bit from the edge of the screen for aesthetics;
8372a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // it will also be inset much more from the bottom of the screen when the
8472a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // Dock is showing. When scrollable, the main window would show a shadow
8572a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // incorrectly positioned, hence the 'shadow' window.)
8672a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  IBOutlet BookmarkBarFolderWindow* shadowWindow_;
8772a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen
8872a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // The up and down scroll arrow views. These arrows are hidden and shown
8972a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // as necessary (when scrolling is possible) and are contained in the nib
9072a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // as siblings to the scroll view.
9172a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  IBOutlet NSView* scrollDownArrowView_;  // Positioned at the top.
9272a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  IBOutlet NSView* scrollUpArrowView_;  // Positioned at the bottom.
93c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
94c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // YES if subfolders should grow to the right (the default).
95c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Direction switches if we'd grow off the screen.
96c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  BOOL subFolderGrowthToRight_;
97c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
98c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Weak; we keep track to work around a
99c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // setShowsBorderOnlyWhileMouseInside bug.
100c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  BookmarkButton* buttonThatMouseIsIn_;
101c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
102c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // The context menu for a bookmark button which represents an URL.
103c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  IBOutlet NSMenu* buttonMenu_;
104c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
105c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // The context menu for a bookmark button which represents a folder.
106c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  IBOutlet NSMenu* folderMenu_;
107c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
108c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // We model hover state as a state machine with specific allowable
109c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // transitions.  |hoverState_| is the state of this machine at any
110c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // given time.
111c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  scoped_nsobject<BookmarkBarFolderHoverState> hoverState_;
112c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
113c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Logic for dealing with a click on a bookmark folder button.
114c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  scoped_nsobject<BookmarkFolderTarget> folderTarget_;
115c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
116c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // A controller for a pop-up bookmark folder window (custom menu).
117c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // We (self) are the parentController_ for our folderController_.
118c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // This is not a scoped_nsobject because it owns itself (when its
119c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // window closes the controller gets autoreleased).
120c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  BookmarkBarFolderController* folderController_;
121c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
122c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Implement basic menu scrolling through this tracking area.
123dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  ScopedCrTrackingArea scrollTrackingArea_;
124c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
125c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Timer to continue scrolling as needed.  We own the timer but
126c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // don't release it when done (we invalidate it).
127c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  NSTimer* scrollTimer_;
128c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
12972a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // Precalculated sum of left and right edge padding of buttons in a
13072a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // folder menu window. This is calculated from the widths of the main
13172a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  // folder menu window and the scroll view within.
13272a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  CGFloat padding_;
13372a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen
134c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Amount to scroll by on each timer fire.  Can be + or -.
135c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  CGFloat verticalScrollDelta_;
136c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
137c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // We need to know the size of the vertical scrolling arrows so we
138c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // can obscure/unobscure them.
139c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  CGFloat verticalScrollArrowHeight_;
140c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
141c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // Set to YES to prevent any node animations. Useful for unit testing so that
142c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  // incomplete animations do not cause valgrind complaints.
143c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  BOOL ignoreAnimations_;
144ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
145ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  int selectedIndex_;
146ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  NSString* typedPrefix_;
147c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch}
148c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
149c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Designated initializer.
150c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (id)initWithParentButton:(BookmarkButton*)button
151c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch          parentController:(BookmarkBarFolderController*)parentController
152c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch             barController:(BookmarkBarController*)barController;
153c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
154c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Return the parent button that owns the bookmark folder we represent.
155c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (BookmarkButton*)parentButton;
156c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
157ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen// Text typed by user, for type-select and arrow key support.
158ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen// Returns YES if the menu should be closed now.
159ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen- (BOOL)handleInputText:(NSString*)newText;
160ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
161ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen// If you wanted to clear the type-select buffer. Currently only used
162ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen// internally.
163ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen- (void)clearInputText;
164ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
165ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen// Gets notified when a fav icon asynchronously loads, so we can now use the
166ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen// real icon instead of a generic placeholder.
167ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen- (void)faviconLoadedForNode:(const BookmarkNode*)node;
168ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
169ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen- (void)setSelectedButtonByIndex:(int)index;
170ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
171c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Offset our folder menu window. This is usually needed in response to a
172c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// parent folder menu window or the bookmark bar changing position due to
173c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// the dragging of a bookmark node from the parent into this folder menu.
174c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (void)offsetFolderMenuWindow:(NSSize)offset;
175c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
176c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Re-layout the window menu in case some buttons were added or removed,
177c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// specifically as a result of the bookmark bar changing configuration
178c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// and altering the contents of the off-the-side folder.
179c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (void)reconfigureMenu;
180c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
181c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Actions from a context menu over a button or folder.
182c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)cutBookmark:(id)sender;
183c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)copyBookmark:(id)sender;
184c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)pasteBookmark:(id)sender;
185c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)deleteBookmark:(id)sender;
186c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
187c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Passed up by a child view to tell us of a desire to scroll.
188c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (void)scrollWheel:(NSEvent *)theEvent;
189c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
190ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen- (void)mouseDragged:(NSEvent*)theEvent;
191ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
192ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
193c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Forwarded to the associated BookmarkBarController.
194c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)addFolder:(id)sender;
195c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)addPage:(id)sender;
196c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)editBookmark:(id)sender;
197c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)openBookmark:(id)sender;
198c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)openAllBookmarks:(id)sender;
199c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)openAllBookmarksIncognitoWindow:(id)sender;
200c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)openAllBookmarksNewWindow:(id)sender;
201c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)openBookmarkInIncognitoWindow:(id)sender;
202c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)openBookmarkInNewForegroundTab:(id)sender;
203c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (IBAction)openBookmarkInNewWindow:(id)sender;
204c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
20572a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen@property(assign, nonatomic) BOOL subFolderGrowthToRight;
206c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
207c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@end
208c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
209c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@interface BookmarkBarFolderController(TestingAPI)
210dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen- (NSPoint)windowTopLeftForWidth:(int)windowWidth
211dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen                          height:(int)windowHeight;
212c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (NSArray*)buttons;
213c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (BookmarkBarFolderController*)folderController;
214c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (id)folderTarget;
215c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (void)configureWindowLevel;
216c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (void)performOneScroll:(CGFloat)delta;
2173345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick- (BookmarkButton*)buttonThatMouseIsIn;
218c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch// Set to YES in order to prevent animations.
219c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (void)setIgnoreAnimations:(BOOL)ignore;
220c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
22172a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen// Return YES if the scroll-up or scroll-down arrows are showing.
222c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (BOOL)canScrollUp;
223c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (BOOL)canScrollDown;
22472a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen- (CGFloat)verticalScrollArrowHeight;
22572a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen- (NSView*)visibleView;
22672a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen- (NSScrollView*)scrollView;
22772a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen- (NSView*)folderView;
228c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
229c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch- (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point;
230c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch@end
23172a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen
23272a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen#endif  // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_FOLDER_CONTROLLER_H_
233