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

Side by Side Diff: chrome/browser/ui/cocoa/framed_browser_window.mm

Issue 2468373003: [Mac] Take Sierra RTL into account when laying out window buttons (Closed)
Patch Set: Add expectation that close button is left of miniaturize button in original test Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/framed_browser_window_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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #import "chrome/browser/ui/cocoa/framed_browser_window.h" 5 #import "chrome/browser/ui/cocoa/framed_browser_window.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <objc/runtime.h> 8 #include <objc/runtime.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 [self setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge]; 128 [self setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
129 [self setContentBorderThickness:kWindowGradientHeight forEdge:NSMaxYEdge]; 129 [self setContentBorderThickness:kWindowGradientHeight forEdge:NSMaxYEdge];
130 130
131 hasTabStrip_ = hasTabStrip; 131 hasTabStrip_ = hasTabStrip;
132 closeButton_ = [self standardWindowButton:NSWindowCloseButton]; 132 closeButton_ = [self standardWindowButton:NSWindowCloseButton];
133 miniaturizeButton_ = [self standardWindowButton:NSWindowMiniaturizeButton]; 133 miniaturizeButton_ = [self standardWindowButton:NSWindowMiniaturizeButton];
134 zoomButton_ = [self standardWindowButton:NSWindowZoomButton]; 134 zoomButton_ = [self standardWindowButton:NSWindowZoomButton];
135 135
136 windowButtonsInterButtonSpacing_ = 136 windowButtonsInterButtonSpacing_ =
137 NSMinX([miniaturizeButton_ frame]) - NSMaxX([closeButton_ frame]); 137 NSMinX([miniaturizeButton_ frame]) - NSMaxX([closeButton_ frame]);
138 if (windowButtonsInterButtonSpacing_ < 0)
139 // Sierra RTL
140 windowButtonsInterButtonSpacing_ =
141 NSMinX([miniaturizeButton_ frame]) - NSMaxX([zoomButton_ frame]);
138 142
139 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; 143 NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
140 if (shouldUseFullSizeContentView) { 144 if (shouldUseFullSizeContentView) {
141 // If Chrome uses full sized content view then window buttons are placed 145 // If Chrome uses full sized content view then window buttons are placed
142 // inside titlebar (which height is 22 points). In order to move window 146 // inside titlebar (which height is 22 points). In order to move window
143 // buttons down the whole toolbar should be moved down. 147 // buttons down the whole toolbar should be moved down.
144 DCHECK(closeButton_); 148 DCHECK(closeButton_);
145 NSView* titlebarContainer = [[closeButton_ superview] superview]; 149 NSView* titlebarContainer = [[closeButton_ superview] superview];
146 [self adjustTitlebarContainer:titlebarContainer]; 150 [self adjustTitlebarContainer:titlebarContainer];
147 [center addObserver:self 151 [center addObserver:self
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 [self childWindowsDidChange]; 525 [self childWindowsDidChange];
522 } 526 }
523 527
524 - (void)childWindowsDidChange { 528 - (void)childWindowsDidChange {
525 id delegate = [self delegate]; 529 id delegate = [self delegate];
526 if ([delegate respondsToSelector:@selector(childWindowsDidChange)]) 530 if ([delegate respondsToSelector:@selector(childWindowsDidChange)])
527 [delegate childWindowsDidChange]; 531 [delegate childWindowsDidChange];
528 } 532 }
529 533
530 @end 534 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/framed_browser_window_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698