| 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/memory/scoped_nsobject.h" | 7 #import "base/memory/scoped_nsobject.h" |
| 8 #import "chrome/browser/ui/constrained_window.h" | 8 #import "chrome/browser/ui/constrained_window.h" |
| 9 #import "chrome/browser/ui/constrained_window_constants.h" |
| 9 #include "skia/ext/skia_utils_mac.h" | 10 #include "skia/ext/skia_utils_mac.h" |
| 10 | 11 |
| 11 // The content view for the custom window. | 12 // The content view for the custom window. |
| 12 @interface ConstrainedWindowCustomWindowContentView : NSView | 13 @interface ConstrainedWindowCustomWindowContentView : NSView |
| 13 @end | 14 @end |
| 14 | 15 |
| 15 @implementation ConstrainedWindowCustomWindow | 16 @implementation ConstrainedWindowCustomWindow |
| 16 | 17 |
| 17 - (id)initWithContentRect:(NSRect)contentRect { | 18 - (id)initWithContentRect:(NSRect)contentRect { |
| 18 if ((self = [super initWithContentRect:contentRect | 19 if ((self = [super initWithContentRect:contentRect |
| (...skipping 15 matching lines...) Expand all Loading... |
| 34 return YES; | 35 return YES; |
| 35 } | 36 } |
| 36 | 37 |
| 37 @end | 38 @end |
| 38 | 39 |
| 39 @implementation ConstrainedWindowCustomWindowContentView | 40 @implementation ConstrainedWindowCustomWindowContentView |
| 40 | 41 |
| 41 - (void)drawRect:(NSRect)rect { | 42 - (void)drawRect:(NSRect)rect { |
| 42 NSBezierPath* path = [NSBezierPath | 43 NSBezierPath* path = [NSBezierPath |
| 43 bezierPathWithRoundedRect:[self bounds] | 44 bezierPathWithRoundedRect:[self bounds] |
| 44 xRadius:ConstrainedWindow::kBorderRadius | 45 xRadius:ConstrainedWindowConstants::kBorderRadius |
| 45 yRadius:ConstrainedWindow::kBorderRadius]; | 46 yRadius:ConstrainedWindowConstants::kBorderRadius]; |
| 46 [gfx::SkColorToCalibratedNSColor( | 47 [gfx::SkColorToCalibratedNSColor( |
| 47 ConstrainedWindow::GetBackgroundColor()) set]; | 48 ConstrainedWindow::GetBackgroundColor()) set]; |
| 48 [path fill]; | 49 [path fill]; |
| 49 | 50 |
| 50 [[self window] invalidateShadow]; | 51 [[self window] invalidateShadow]; |
| 51 } | 52 } |
| 52 | 53 |
| 53 @end | 54 @end |
| OLD | NEW |