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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
index 626d742e101675067ae37c08e24de353f009093a..d380384d8778ccfec5f89e8513b72c61afc6de5f 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -144,6 +144,14 @@ CGFloat FlipXInView(NSView* view, CGFloat width, CGFloat x) {
} // namespace
+@interface NSView (PrivateAPI)
+// Called by AppKit to check if dragging this view should move the window.
+// NSButton overrides this method in the same way so dragging window buttons
+// has no effect. NSView implementation returns NSZeroRect so the whole view
+// area can be dragged.
+- (NSRect)_opaqueRectForWindowMoveWhenInTitlebar;
+@end
+
@interface TabStripController (Private)
- (void)addSubviewToPermanentList:(NSView*)aView;
- (void)regenerateSubviewList;
@@ -229,6 +237,10 @@ CGFloat FlipXInView(NSView* view, CGFloat width, CGFloat x) {
return NO;
}
+- (NSRect)_opaqueRectForWindowMoveWhenInTitlebar {
+ return [self bounds];
+}
+
- (id)initWithFrame:(NSRect)frameRect
controller:(TabStripController*)controller {
if ((self = [super initWithFrame:frameRect])) {

Powered by Google App Engine
This is Rietveld 408576698