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

Side by Side Diff: chrome/browser/ui/cocoa/constrained_window/cw_window.mm

Issue 10870094: Constrained window sheet controller (test patch) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #import "chrome/browser/ui/cocoa/constrained_window/cw_window.h"
6
7 #import "base/memory/scoped_nsobject.h"
8 #import "chrome/browser/ui/constrained_window.h"
9 #include "skia/ext/skia_utils_mac.h"
10
11 @interface CustomAlertView : NSView
12 @end
13
14 @implementation CWWindow
15
16 - (id)initWithContentRect:(NSRect)contentRect {
17 self = [super initWithContentRect:contentRect
18 styleMask:NSBorderlessWindowMask
19 backing:NSBackingStoreBuffered
20 defer:NO];
21 if (!self)
22 return nil;
23
24 [self setHasShadow:YES];
25 [self setBackgroundColor:[NSColor clearColor]];
26 [self setOpaque:NO];
27 scoped_nsobject<NSView> content_view(
28 [[CustomAlertView alloc] initWithFrame:NSZeroRect]);
29 [self setContentView:content_view];
30 return self;
31 }
32
33 - (BOOL)canBecomeKeyWindow {
34 return YES;
35 }
36
37 @end
38
39 @implementation CustomAlertView
40
41 - (void)drawRect:(NSRect)rect {
42 NSBezierPath* path = [NSBezierPath
43 bezierPathWithRoundedRect:[self bounds]
44 xRadius:ConstrainedWindow::kBorderRadius
45 yRadius:ConstrainedWindow::kBorderRadius];
46 [gfx::SkColorToCalibratedNSColor(ConstrainedWindow::kBackgroundColor) set];
47 [path fill];
48 }
49
50 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698