diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 04:45:07 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 04:45:07 +0000 |
commit | 152494e06591140bbf5003bba82cafa6f34962ec (patch) | |
tree | f55043335e4caed020668c25423bb0ec586b2802 /chrome/browser/cocoa/toolbar_controller.mm | |
parent | 1b9af295f86b846582f96277bdba05d98bc3d2f4 (diff) | |
download | chromium_src-152494e06591140bbf5003bba82cafa6f34962ec.zip chromium_src-152494e06591140bbf5003bba82cafa6f34962ec.tar.gz chromium_src-152494e06591140bbf5003bba82cafa6f34962ec.tar.bz2 |
- Fix janklist issue #1: "there is a pixel line below the main
toolbar. The main toolbar should blend in with the bookmark bar when
it's open"
- Fix janklist issue #2: "It's way too tall - the distance from the
bottom of the bar to a bookmark button bottom edge should be the
same as the distance from the omnibox to the bookmark button top
edge (this will probably mean that the bar has to overlap the
toolbar)."
- Fix janklist issue #4 (first part): "the bookmark bar bookmark buttons
have a frame around them ... "
- Fix janklist issue #9: "the show/hide animation is very janky... I see
a dark gray area behind". Even with animators the grey is gone, but
animators are disabled for now due to races.
- Fix unlisted jank related to 9: don't use animator when opening bar on
launch.
- Also chipped away on unit tests.
TEST=Launch with bookmark bar both open and closed. Make sure OK on launch.
In each case open and close a few times fast.
Repeat with multiple windows open.
Sanity check jank descriptions listed above are fixed.
BUG=crbug.com/14139, crbug.com/8381, crbug.com/14724
Review URL: http://codereview.chromium.org/149308
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20244 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/toolbar_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/toolbar_controller.mm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm index 27466c4..eba4d89 100644 --- a/chrome/browser/cocoa/toolbar_controller.mm +++ b/chrome/browser/cocoa/toolbar_controller.mm @@ -74,13 +74,17 @@ class PrefObserverBridge : public NotificationObserver { - (id)initWithModel:(ToolbarModel*)model commands:(CommandUpdater*)commands - profile:(Profile*)profile { + profile:(Profile*)profile + webContentView:(NSView*)webContentView + bookmarkDelegate:(id<BookmarkURLOpener>)delegate { DCHECK(model && commands && profile); if ((self = [super initWithNibName:@"Toolbar" bundle:mac_util::MainAppBundle()])) { toolbarModel_ = model; commands_ = commands; profile_ = profile; + bookmarkBarDelegate_ = delegate; + webContentView_ = webContentView; // Register for notifications about state changes for the toolbar buttons commandObserver_.reset(new CommandObserverBridge(self, commands)); @@ -111,6 +115,13 @@ class PrefObserverBridge : public NotificationObserver { prefObserver_.get()); [self showOptionalHomeButton]; [self showOptionalPageWrenchButtons]; + + // Create a sub-controller for the bookmark bar. + bookmarkBarController_.reset([[BookmarkBarController alloc] + initWithProfile:profile_ + view:bookmarkBarView_ + webContentView:webContentView_ + delegate:bookmarkBarDelegate_]); } - (LocationBar*)locationBar { @@ -178,6 +189,10 @@ class PrefObserverBridge : public NotificationObserver { [goButton_ setTag:tag]; } +- (BookmarkBarController*)bookmarkBarController { + return bookmarkBarController_.get(); +} + - (id)customFieldEditorForObject:(id)obj { if (obj == locationBar_) { // Lazilly construct Field editor, Cocoa UI code always runs on the @@ -199,7 +214,7 @@ class PrefObserverBridge : public NotificationObserver { - (NSArray*)toolbarViews { return [NSArray arrayWithObjects:backButton_, forwardButton_, reloadButton_, homeButton_, starButton_, goButton_, pageButton_, wrenchButton_, - locationBar_, nil]; + locationBar_, bookmarkBarView_, nil]; } // Moves |rect| to the right by |delta|, keeping the right side fixed by |