OLD | NEW |
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/constrained_window/constrained_window_custom_wi
ndow.h" | 5 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_wi
ndow.h" |
6 | 6 |
7 #import "base/mac/scoped_nsobject.h" | 7 #import "base/mac/scoped_nsobject.h" |
8 #import "chrome/browser/ui/chrome_style.h" | 8 #import "chrome/browser/ui/chrome_style.h" |
9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" | 9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" |
10 #include "skia/ext/skia_utils_mac.h" | 10 #include "skia/ext/skia_utils_mac.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 - (id)initWithContentRect:(NSRect)contentRect | 34 - (id)initWithContentRect:(NSRect)contentRect |
35 styleMask:(NSUInteger)windowStyle | 35 styleMask:(NSUInteger)windowStyle |
36 backing:(NSBackingStoreType)bufferingType | 36 backing:(NSBackingStoreType)bufferingType |
37 defer:(BOOL)deferCreation { | 37 defer:(BOOL)deferCreation { |
38 if ((self = [super initWithContentRect:contentRect | 38 if ((self = [super initWithContentRect:contentRect |
39 styleMask:windowStyle | 39 styleMask:windowStyle |
40 backing:bufferingType | 40 backing:bufferingType |
41 defer:NO])) { | 41 defer:NO])) { |
42 [self setHasShadow:YES]; | 42 [self setHasShadow:YES]; |
43 [self setBackgroundColor:gfx::SkColorToCalibratedNSColor( | 43 [self setBackgroundColor:skia::SkColorToCalibratedNSColor( |
44 chrome_style::GetBackgroundColor())]; | 44 chrome_style::GetBackgroundColor())]; |
45 [self setOpaque:NO]; | 45 [self setOpaque:NO]; |
46 [self setReleasedWhenClosed:NO]; | 46 [self setReleasedWhenClosed:NO]; |
47 } | 47 } |
48 return self; | 48 return self; |
49 } | 49 } |
50 | 50 |
51 - (BOOL)canBecomeKeyWindow { | 51 - (BOOL)canBecomeKeyWindow { |
52 return YES; | 52 return YES; |
53 } | 53 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 [path setWindingRule:NSEvenOddWindingRule]; | 86 [path setWindingRule:NSEvenOddWindingRule]; |
87 [[NSGraphicsContext currentContext] setCompositingOperation: | 87 [[NSGraphicsContext currentContext] setCompositingOperation: |
88 NSCompositeCopy]; | 88 NSCompositeCopy]; |
89 [[NSColor clearColor] set]; | 89 [[NSColor clearColor] set]; |
90 [path fill]; | 90 [path fill]; |
91 | 91 |
92 [[self window] invalidateShadow]; | 92 [[self window] invalidateShadow]; |
93 } | 93 } |
94 | 94 |
95 @end | 95 @end |
OLD | NEW |