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

Unified Diff: chrome/browser/cocoa/find_bar_cocoa_controller.mm

Issue 159776: Rewrites the Mac view resizing logic to have the BrowserWindowController... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 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/cocoa/find_bar_cocoa_controller.mm
===================================================================
--- chrome/browser/cocoa/find_bar_cocoa_controller.mm (revision 22499)
+++ chrome/browser/cocoa/find_bar_cocoa_controller.mm (working copy)
@@ -52,21 +52,23 @@
true, false);
}
-// Positions the find bar view in the correct location based on the
-// current state of the window. Currently only the visibility of the
-// bookmark bar can affect the find bar's position.
-- (void)positionFindBarView:(NSView*)contentArea {
+// Positions the find bar view in the correct location based on the current
+// state of the window. The findbar is always positioned one pixel above the
+// infobar container. Note that we are using the infobar container location as
+// a proxy for the toolbar location, but we cannot position based on the toolbar
+// because the toolbar is not always present (for example in fullscreen
+// windows).
+- (void)positionFindBarView:(NSView*)infoBarContainerView {
static const int kRightEdgeOffset = 25;
NSView* findBarView = [self view];
int findBarHeight = NSHeight([findBarView frame]);
int findBarWidth = NSWidth([findBarView frame]);
- // Start by computing the upper right corner of the tab content
- // area, then move left by a constant offset and up one pixel. This
- // gives us the upper right corner of our bounding box. We move up
- // one pixel to overlap with the toolbar area, which allows us to
- // cover up the toolbar's border.
- NSRect windowRect = [contentArea frame];
+ // Start by computing the upper right corner of the infobar container, then
+ // move left by a constant offset and up one pixel. This gives us the upper
+ // right corner of our bounding box. We move up one pixel to overlap with the
+ // toolbar area, which allows us to cover up the toolbar's border, if present.
+ NSRect windowRect = [infoBarContainerView frame];
int max_x = NSMaxX(windowRect) - kRightEdgeOffset;
int max_y = NSMaxY(windowRect) + 1;
« no previous file with comments | « chrome/browser/cocoa/find_bar_cocoa_controller.h ('k') | chrome/browser/cocoa/infobar_container_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698