summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_controller.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_controller.h')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_controller.h35
1 files changed, 15 insertions, 20 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller.h b/chrome/browser/cocoa/bookmark_bar_controller.h
index c035fc2..23b211c 100644
--- a/chrome/browser/cocoa/bookmark_bar_controller.h
+++ b/chrome/browser/cocoa/bookmark_bar_controller.h
@@ -20,6 +20,7 @@ class BookmarkNode;
class GURL;
class Profile;
class PrefService;
+@protocol ViewResizer;
// The interface for an object which can open URLs for a bookmark.
@protocol BookmarkURLOpener
@@ -36,12 +37,8 @@ class PrefService;
BookmarkModel* bookmarkModel_; // weak; part of the profile owned by the
// top-level Browser object.
- // Currently these two are always the same when not in fullscreen
- // mode, but they mean slightly different things.
- // contentAreaHasOffset_ is an implementation detail of bookmark bar
- // show state.
- BOOL contentViewHasOffset_;
- BOOL barShouldBeShown_;
+ // Our initial view width, which is applied in awakeFromNib.
+ float initialWidth_;
// BookmarkNodes have a 64bit id. NSMenuItems have a 32bit tag used
// to represent the bookmark node they refer to. This map provides
@@ -57,16 +54,18 @@ class PrefService;
// Set when using fullscreen mode.
BOOL barIsEnabled_;
- NSView* parentView_; // weak; our parent view
- NSView* webContentView_; // weak; where the web goes
- NSView* infoBarsView_; // weak; where the infobars go
+ // Set to YES when the user elects to always show the bookmark bar.
+ BOOL barShouldBeShown_;
// Bridge from Chrome-style C++ notifications (e.g. derived from
// BookmarkModelObserver)
scoped_ptr<BookmarkBarBridge> bridge_;
- // Delegate which can open URLs for us.
- id<BookmarkURLOpener> delegate_; // weak
+ // Delegate that can resize us.
+ id<ViewResizer> resizeDelegate_; // weak
+
+ // Delegate that can open URLs for us.
+ id<BookmarkURLOpener> urlDelegate_; // weak
IBOutlet NSView* buttonView_;
IBOutlet NSButton* offTheSideButton_;
@@ -74,15 +73,11 @@ class PrefService;
}
// Initializes the bookmark bar controller with the given browser
-// profile, parent view (the toolbar), web content view, and delegate.
-// |delegate| is used for opening URLs.
-// TODO(rohitrao, jrg): The bookmark bar shouldn't know about the
-// infoBarsView or the webContentView.
+// profile and delegates.
- (id)initWithProfile:(Profile*)profile
- parentView:(NSView*)parentView
- webContentView:(NSView*)webContentView
- infoBarsView:(NSView*)infoBarsView
- delegate:(id<BookmarkURLOpener>)delegate;
+ initialWidth:(float)initialWidth
+ resizeDelegate:(id<ViewResizer>)resizeDelegate
+ urlDelegate:(id<BookmarkURLOpener>)urlDelegate;
// Returns whether or not the bookmark bar is visible.
- (BOOL)isBookmarkBarVisible;
@@ -138,7 +133,7 @@ class PrefService;
// These APIs should only be used by unit tests (or used internally).
@interface BookmarkBarController(InternalOrTestingAPI)
// Set the delegate for a unit test.
-- (void)setDelegate:(id<BookmarkURLOpener>)delegate;
+- (void)setUrlDelegate:(id<BookmarkURLOpener>)urlDelegate;
- (void)clearBookmarkBar;
- (NSView*)buttonView;
- (NSArray*)buttons;