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

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

Issue 555243002: mac: Refactor browser_window_controller layout logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fullscreen_layout
Patch Set: Ensure location bar in consistent state after initialization. Created 6 years, 3 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/ui/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 1c3a0aeee4ae89a9a74aac6f16b66e5af4a3a217..ca9e3b9d5731910b03a5c73914f93b473410f6b3 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -43,6 +43,7 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h"
#import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
#import "chrome/browser/ui/cocoa/browser_window_controller_private.h"
+#import "chrome/browser/ui/cocoa/browser_window_layout.h"
#import "chrome/browser/ui/cocoa/browser_window_utils.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.h"
#import "chrome/browser/ui/cocoa/dev_tools_controller.h"
@@ -972,6 +973,22 @@ using content::WebContents;
view == [downloadShelfController_ view] ||
view == [bookmarkBarController_ view]);
+ // The infobar has insufficient information to determine its new height. It
+ // knows the total height of all of the info bars (which is what it passes
+ // into this method), but knows nothing about the maximum arrow height, which
+ // is determined by this class.
+ if (view == [infoBarContainerController_ view]) {
+ base::scoped_nsobject<BrowserWindowLayout> layout(
+ [[BrowserWindowLayout alloc] init]);
+ [self updateLayoutParameters:layout];
+ // Use the new height for the info bar.
+ [layout setInfoBarHeight:height];
+
+ chrome::LayoutOutput output = [layout computeLayout];
+
+ height = NSHeight(output.infoBarFrame);
+ }
+
// Change the height of the view and call |-layoutSubViews|. We set the height
// here without regard to where the view is on the screen or whether it needs
// to "grow up" or "grow down." The below call to |-layoutSubviews| will
@@ -1558,12 +1575,15 @@ using content::WebContents;
[downloadShelfController_ isVisible];
}
-- (DownloadShelfController*)downloadShelf {
+- (void)createAndAddDownloadShelf {
if (!downloadShelfController_.get()) {
downloadShelfController_.reset([[DownloadShelfController alloc]
initWithBrowser:browser_.get() resizeDelegate:self]);
[[[self window] contentView] addSubview:[downloadShelfController_ view]];
}
+}
+
+- (DownloadShelfController*)downloadShelf {
return downloadShelfController_;
}
@@ -1574,7 +1594,7 @@ using content::WebContents;
// Create a controller for the findbar.
findBarCocoaController_.reset([findBarCocoaController retain]);
[self layoutSubviews];
- [self updateSubviewZOrder:[self isInFullscreenWithOmniboxSliding]];
+ [self updateSubviewZOrder];
}
- (NSWindow*)createFullscreenWindow {
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.h ('k') | chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698