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

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

Issue 2944017: Putting the findbar into a child window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/background_gradient_view.mm ('k') | chrome/browser/cocoa/find_bar_cocoa_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 52179)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -1251,9 +1251,14 @@
// Create a controller for the findbar.
findBarCocoaController_.reset([findBarCocoaController retain]);
NSView *contentView = [[self window] contentView];
- [contentView addSubview:[findBarCocoaController_ view]
- positioned:NSWindowAbove
- relativeTo:[toolbarController_ view]];
+// [contentView addSubview:[findBarCocoaController_ view]
+// positioned:NSWindowAbove
+// relativeTo:[toolbarController_ view]];
+ // Trigger a nib load.
+ //[findBarCocoaController_ view];
+ [[self window] addChildWindow:[findBarCocoaController_ window]
+ ordered:NSWindowAbove];
+ LOG(ERROR) << "Adding child window";
// Place the find bar immediately below the toolbar/attached bookmark bar. In
// fullscreen mode, it hangs off the top of the screen when the bar is hidden.
@@ -1531,6 +1536,13 @@
statusBubble_->UpdateSizeAndPosition();
}
+ CGFloat maxY = [self placeBookmarkBarBelowInfoBar] ?
+ NSMinY([[toolbarController_ view] frame]) :
+ NSMinY([[bookmarkBarController_ view] frame]);
+ CGFloat maxWidth = NSWidth([[[self window] contentView] frame]);
+ [findBarCocoaController_ positionFindBarViewAtMaxY:maxY maxWidth:maxWidth];
+
+
// Let the selected RenderWidgetHostView know, so that it can tell plugins.
if (TabContents* contents = browser_->GetSelectedTabContents()) {
if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView())
« no previous file with comments | « chrome/browser/cocoa/background_gradient_view.mm ('k') | chrome/browser/cocoa/find_bar_cocoa_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698