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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm

Issue 2435593008: Cocoa: Fix a constraint violation when navigating away from a detached bookmark bar. (Closed)
Patch Set: redundant Created 4 years, 2 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/bookmarks/bookmark_bar_controller.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index a38b2a660729d81749d63ae72f435946c135349a..c0dff05c60fca998e21a2bd703e55e5c1a72f051 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -165,6 +165,9 @@ void RecordAppLaunch(Profile* profile, GURL url) {
@interface BookmarkBarController ()
+// Updates the sizes and positions of the subviews.
+- (void)layoutSubviews;
+
// Moves to the given next state (from the current state), possibly animating.
// If |animate| is NO, it will stop any running animation and jump to the given
// state. If YES, it may either (depending on implementation) jump to the end of
@@ -558,6 +561,14 @@ void RecordAppLaunch(Profile* profile, GURL url) {
[self closeFolderAndStopTrackingMenus];
}
+- (void)layoutToFrame:(NSRect)frame {
+ // The view should be pinned to the top of the window with a flexible width.
+ DCHECK_EQ(NSViewWidthSizable | NSViewMinYMargin,
+ [[self view] autoresizingMask]);
+ [[self view] setFrame:frame];
+ [self layoutSubviews];
+}
+
// Change the layout of the bookmark bar's subviews in response to a visibility
// change (e.g., show or hide the bar) or style change (attached or floating).
- (void)layoutSubviews {

Powered by Google App Engine
This is Rietveld 408576698