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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_view.mm

Issue 1354873002: Mac: Prevent mouse events reaching subviews while a window has an attached Sheet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TabView menu check now obsolete Created 4 years, 6 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
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_view.mm ('k') | 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 (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/tabs/tab_view.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_view.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/mac/sdk_forward_declarations.h" 9 #include "base/mac/sdk_forward_declarations.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 [super dealloc]; 193 [super dealloc];
194 } 194 }
195 195
196 // Called to obtain the context menu for when the user hits the right mouse 196 // Called to obtain the context menu for when the user hits the right mouse
197 // button (or control-clicks). (Note that -rightMouseDown: is *not* called for 197 // button (or control-clicks). (Note that -rightMouseDown: is *not* called for
198 // control-click.) 198 // control-click.)
199 - (NSMenu*)menu { 199 - (NSMenu*)menu {
200 if ([self isClosing]) 200 if ([self isClosing])
201 return nil; 201 return nil;
202 202
203 // Sheets, being window-modal, should block contextual menus. For some reason
204 // they do not. Disallow them ourselves.
205 if ([[self window] attachedSheet])
206 return nil;
207
208 return [controller_ menu]; 203 return [controller_ menu];
209 } 204 }
210 205
211 - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize { 206 - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
212 [super resizeSubviewsWithOldSize:oldBoundsSize]; 207 [super resizeSubviewsWithOldSize:oldBoundsSize];
213 // Called when our view is resized. If it gets too small, start by hiding 208 // Called when our view is resized. If it gets too small, start by hiding
214 // the close button and only show it if tab is selected. Eventually, hide the 209 // the close button and only show it if tab is selected. Eventually, hide the
215 // icon as well. 210 // icon as well.
216 [controller_ updateVisibility]; 211 [controller_ updateVisibility];
217 } 212 }
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 NSAffineTransform* transform = [NSAffineTransform transform]; 940 NSAffineTransform* transform = [NSAffineTransform transform];
946 [transform scaleXBy:-1 yBy:1]; 941 [transform scaleXBy:-1 yBy:1];
947 [transform translateXBy:-17.5 yBy:-0.25]; 942 [transform translateXBy:-17.5 yBy:-0.25];
948 [bezierPath transformUsingAffineTransform:transform]; 943 [bezierPath transformUsingAffineTransform:transform];
949 944
950 [[NSColor whiteColor] set]; 945 [[NSColor whiteColor] set];
951 [bezierPath fill]; 946 [bezierPath fill];
952 } 947 }
953 948
954 @end // @implementation TabView(MaterialDesign) 949 @end // @implementation TabView(MaterialDesign)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698