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

Side by Side Diff: chrome/browser/ui/cocoa/fast_resize_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 | « no previous file | chrome/browser/ui/cocoa/tabs/tab_strip_view.mm » ('j') | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/fast_resize_view.h" 5 #import "chrome/browser/ui/cocoa/fast_resize_view.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
11 #include "ui/base/cocoa/animation_utils.h" 11 #include "ui/base/cocoa/animation_utils.h"
12 12
13 @implementation FastResizeView 13 @implementation FastResizeView
14 14
15 - (id)initWithFrame:(NSRect)frameRect { 15 - (id)initWithFrame:(NSRect)frameRect {
16 if ((self = [super initWithFrame:frameRect])) { 16 if ((self = [super initWithFrame:frameRect])) {
17 ScopedCAActionDisabler disabler; 17 ScopedCAActionDisabler disabler;
18 base::scoped_nsobject<CALayer> layer([[CALayer alloc] init]); 18 base::scoped_nsobject<CALayer> layer([[CALayer alloc] init]);
19 [layer setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; 19 [layer setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)];
20 [self setLayer:layer]; 20 [self setLayer:layer];
21 [self setWantsLayer:YES]; 21 [self setWantsLayer:YES];
22 } 22 }
23 return self; 23 return self;
24 } 24 }
25 25
26 - (BOOL)isOpaque { 26 - (BOOL)isOpaque {
27 return YES; 27 return YES;
28 } 28 }
29 29
30 // Override -[NSView hitTest:] to prevent mouse events reaching subviews while
31 // the window is displaying a modal sheet. Without this, context menus can be
32 // shown on a right-click and trigger all kinds of things (e.g. Print).
33 - (NSView*)hitTest:(NSPoint)aPoint {
34 if ([[self window] attachedSheet])
35 return self;
36 return [super hitTest:aPoint];
37 }
38
30 @end 39 @end
31 40
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/tab_strip_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698