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

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

Issue 2523323002: [merge-m56] [mac] Disable usage of full size content view. (Closed)
Patch Set: Created 4 years 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser_window_layout.h" 5 #import "chrome/browser/ui/cocoa/browser_window_layout.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/mac/mac_util.h" 11 #include "base/mac/mac_util.h"
12 #include "chrome/browser/ui/cocoa/l10n_util.h" 12 #include "chrome/browser/ui/cocoa/l10n_util.h"
13 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 13 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
14 14
15 namespace chrome { 15 namespace chrome {
16 16
17 // The height of the tab strip. 17 // The height of the tab strip.
18 const CGFloat kTabStripHeight = 37; 18 const CGFloat kTabStripHeight = 37;
19 19
20 bool ShouldUseFullSizeContentView() { 20 bool ShouldUseFullSizeContentView() {
21 // Prior to macOS 10.11 Chrome has added a subview above the window's content 21 // Chrome has added a subview above the window's content view, which the
22 // view, which the Appkit warns about at runtime. This was done to make sure 22 // Appkit warns about at runtime. This was done to make sure that window
23 // that window buttons are always displayed above the content. Presumably, 23 // buttons are always displayed above the content. Presumably, doing so may
24 // doing so may break in a future macOS release. Using 24 // break in a future macOS release. Using NSFullSizeContentViewWindowMask
25 // NSFullSizeContentViewWindowMask makes window buttons displayed inside 25 // makes window buttons displayed inside the titlebar, so they are not covered
26 // the titlebar, so they are not covered by the content view. 26 // by the content view.
27 return base::mac::IsAtLeastOS10_11(); 27 // TODO(crbug.com/666415): This should return base::mac::IsAtLeastOS10_11()
28 // once we are satisfied there are no regressions when doing this. The concern
29 // is that by making the browser view hierarchy a child view of NSThemeFrame
30 // rather than a sibling, the views are exposed to autolayout in new ways that
31 // may cause performance regressions and layout glitches.
32 return false;
28 } 33 }
29 34
30 } // namespace chrome 35 } // namespace chrome
31 36
32 namespace { 37 namespace {
33 38
34 // Insets for the location bar, used when the full toolbar is hidden. 39 // Insets for the location bar, used when the full toolbar is hidden.
35 // TODO(viettrungluu): We can argue about the "correct" insetting; I like the 40 // TODO(viettrungluu): We can argue about the "correct" insetting; I like the
36 // following best, though arguably 0 inset is better/more correct. 41 // following best, though arguably 0 inset is better/more correct.
37 const CGFloat kLocBarLeftRightInset = 1; 42 const CGFloat kLocBarLeftRightInset = 1;
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 412
408 @end 413 @end
409 414
410 @implementation BrowserWindowLayout (ExposedForTesting) 415 @implementation BrowserWindowLayout (ExposedForTesting)
411 416
412 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater { 417 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater {
413 parameters_.isOSYosemiteOrLater = osYosemiteOrLater; 418 parameters_.isOSYosemiteOrLater = osYosemiteOrLater;
414 } 419 }
415 420
416 @end 421 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698