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

Side by Side Diff: chrome/browser/cocoa/bookmark_bar_controller.mm

Issue 155444: Mac pop-up window happier-ness.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/cocoa/bookmark_bar_controller_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/mac_util.h" 5 #include "base/mac_util.h"
6 #include "base/sys_string_conversions.h" 6 #include "base/sys_string_conversions.h"
7 #include "chrome/browser/bookmarks/bookmark_model.h" 7 #include "chrome/browser/bookmarks/bookmark_model.h"
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/browser_list.h" 9 #include "chrome/browser/browser_list.h"
10 #import "chrome/browser/cocoa/bookmark_bar_bridge.h" 10 #import "chrome/browser/cocoa/bookmark_bar_bridge.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // There is no offset to unconditionally apply. 115 // There is no offset to unconditionally apply.
116 return; 116 return;
117 } 117 }
118 118
119 // None of these locals are members of the Hall of Justice. 119 // None of these locals are members of the Hall of Justice.
120 NSRect superframe = [parentView_ frame]; 120 NSRect superframe = [parentView_ frame];
121 NSRect frame = [[self view] frame]; 121 NSRect frame = [[self view] frame];
122 NSRect webframe = [webContentView_ frame]; 122 NSRect webframe = [webContentView_ frame];
123 if (apply) { 123 if (apply) {
124 superframe.size.height += kBookmarkBarSuperviewHeightAdjustment; 124 superframe.size.height += kBookmarkBarSuperviewHeightAdjustment;
125 superframe.origin.y -= kBookmarkBarSuperviewHeightAdjustment; 125 // TODO(jrg): y=0 if we add the bookmark bar before the parent
126 // view (toolbar) is placed in the view hierarchy. A different
127 // CL, where the bookmark bar is extracted from the toolbar nib,
128 // may fix this awkwardness.
129 if (superframe.origin.y > 0) {
130 superframe.origin.y -= kBookmarkBarSuperviewHeightAdjustment;
131 webframe.size.height -= kBookmarkBarWebframeHeightAdjustment;
132 }
126 frame.size.height += kBookmarkBarHeight; 133 frame.size.height += kBookmarkBarHeight;
127 webframe.size.height -= kBookmarkBarWebframeHeightAdjustment;
128 } else { 134 } else {
129 superframe.size.height -= kBookmarkBarSuperviewHeightAdjustment; 135 superframe.size.height -= kBookmarkBarSuperviewHeightAdjustment;
130 superframe.origin.y += kBookmarkBarSuperviewHeightAdjustment; 136 superframe.origin.y += kBookmarkBarSuperviewHeightAdjustment;
131 frame.size.height -= kBookmarkBarHeight; 137 frame.size.height -= kBookmarkBarHeight;
132 webframe.size.height += kBookmarkBarWebframeHeightAdjustment; 138 webframe.size.height += kBookmarkBarWebframeHeightAdjustment;
133 } 139 }
134 140
135 // TODO(jrg): Animators can be a little fussy. Setting these three 141 // TODO(jrg): Animators can be a little fussy. Setting these three
136 // off can sometimes causes races where the finish isn't as 142 // off can sometimes causes races where the finish isn't as
137 // expected. Fix, or clean out the animators as an option. 143 // expected. Fix, or clean out the animators as an option.
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 - (void)nodeChildrenReordered:(BookmarkModel*)model 389 - (void)nodeChildrenReordered:(BookmarkModel*)model
384 node:(const BookmarkNode*)node { 390 node:(const BookmarkNode*)node {
385 [self loaded:model]; 391 [self loaded:model];
386 } 392 }
387 393
388 - (void)setDelegate:(id<BookmarkURLOpener>)delegate { 394 - (void)setDelegate:(id<BookmarkURLOpener>)delegate {
389 delegate_ = delegate; 395 delegate_ = delegate;
390 } 396 }
391 397
392 @end 398 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/bookmark_bar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698