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

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

Issue 2351183003: [Mac] Avoid "adding unknown subview" warning. (Closed)
Patch Set: Address feedback. Created 4 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
« no previous file with comments | « chrome/browser/ui/cocoa/framed_browser_window.h ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/full_size_content_window.mm
diff --git a/chrome/browser/ui/cocoa/full_size_content_window.mm b/chrome/browser/ui/cocoa/full_size_content_window.mm
index eddf7f4da1d0e43fc21445e9e28ce0015f547f29..42753be1b62a195397150edc15f2801bab3d18e2 100644
--- a/chrome/browser/ui/cocoa/full_size_content_window.mm
+++ b/chrome/browser/ui/cocoa/full_size_content_window.mm
@@ -9,6 +9,7 @@
#include "base/auto_reset.h"
#include "base/logging.h"
#include "base/mac/foundation_util.h"
+#include "base/mac/mac_util.h"
#include "base/mac/scoped_objc_class_swizzler.h"
@interface FullSizeContentWindow ()
@@ -139,20 +140,22 @@ static IMP g_original_callstacksymbols_implementation;
[self setContentView:chromeWindowView_];
[chromeWindowView_ setFrame:[[chromeWindowView_ superview] bounds]];
- // Our content view overlaps the window control buttons, so we must ensure
- // it is positioned below the buttons.
- NSView* superview = [chromeWindowView_ superview];
- [chromeWindowView_ removeFromSuperview];
+ if (base::mac::IsAtMostOS10_10()) {
+ // Our content view overlaps the window control buttons, so we must
+ // ensure it is positioned below the buttons.
+ NSView* superview = [chromeWindowView_ superview];
+ [chromeWindowView_ removeFromSuperview];
- // Prevent the AppKit from generating a backtrace to include in it's
- // complaint about our upcoming call to addSubview:positioned:relativeTo:.
- // See +load for more info.
- base::AutoReset<bool> disable_symbolication(&g_disable_callstacksymbols,
- true);
+ // Prevent the AppKit from generating a backtrace to include in it's
+ // complaint about our upcoming call to
+ // addSubview:positioned:relativeTo:. See +load for more info.
+ base::AutoReset<bool> disable_symbolication(&g_disable_callstacksymbols,
+ true);
- [superview addSubview:chromeWindowView_
- positioned:NSWindowBelow
+ [superview addSubview:chromeWindowView_
+ positioned:NSWindowBelow
relativeTo:nil];
+ }
}
}
return self;
« no previous file with comments | « chrome/browser/ui/cocoa/framed_browser_window.h ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698