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

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

Issue 2404783002: [Mac] Avoid "adding unknown subview" warning. (Closed)
Patch Set: Merged with head 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 unified diff | Download patch
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() {
21 // Prior to macOS 10.11 Chrome has added a subview above the window's content
22 // view, which the Appkit warns about at runtime. This was done to make sure
23 // that window buttons are always displayed above the content. Presumably,
24 // doing so may break in a future macOS release. Using
25 // NSFullSizeContentViewWindowMask makes window buttons displayed inside
26 // the titlebar, so they are not covered by the content view.
27 return base::mac::IsAtLeastOS10_11();
28 }
29
20 } // namespace chrome 30 } // namespace chrome
21 31
22 namespace { 32 namespace {
23 33
24 // Insets for the location bar, used when the full toolbar is hidden. 34 // Insets for the location bar, used when the full toolbar is hidden.
25 // TODO(viettrungluu): We can argue about the "correct" insetting; I like the 35 // TODO(viettrungluu): We can argue about the "correct" insetting; I like the
26 // following best, though arguably 0 inset is better/more correct. 36 // following best, though arguably 0 inset is better/more correct.
27 const CGFloat kLocBarLeftRightInset = 1; 37 const CGFloat kLocBarLeftRightInset = 1;
28 const CGFloat kLocBarTopInset = 0; 38 const CGFloat kLocBarTopInset = 0;
29 const CGFloat kLocBarBottomInset = 1; 39 const CGFloat kLocBarBottomInset = 1;
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 404
395 @end 405 @end
396 406
397 @implementation BrowserWindowLayout (ExposedForTesting) 407 @implementation BrowserWindowLayout (ExposedForTesting)
398 408
399 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater { 409 - (void)setOSYosemiteOrLater:(BOOL)osYosemiteOrLater {
400 parameters_.isOSYosemiteOrLater = osYosemiteOrLater; 410 parameters_.isOSYosemiteOrLater = osYosemiteOrLater;
401 } 411 }
402 412
403 @end 413 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698