| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 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/tab_contents/overlay_drop_shadow_view.h" | |
| 6 | |
| 7 #include "grit/theme_resources.h" | |
| 8 #include "ui/base/resource/resource_bundle.h" | |
| 9 | |
| 10 @implementation OverlayDropShadowView | |
| 11 | |
| 12 + (CGFloat)preferredHeight { | |
| 13 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | |
| 14 NSImage* shadowImage = | |
| 15 rb.GetNativeImageNamed(IDR_OVERLAY_DROP_SHADOW).ToNSImage(); | |
| 16 return [shadowImage size].height; | |
| 17 } | |
| 18 | |
| 19 - (void)drawRect:(NSRect)rect { | |
| 20 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | |
| 21 NSRect bounds = [self bounds]; | |
| 22 | |
| 23 // Draw the shadow. | |
| 24 NSImage* shadowImage = | |
| 25 rb.GetNativeImageNamed(IDR_OVERLAY_DROP_SHADOW).ToNSImage(); | |
| 26 [shadowImage drawInRect:bounds | |
| 27 fromRect:NSZeroRect | |
| 28 operation:NSCompositeSourceOver | |
| 29 fraction:1.0]; | |
| 30 } | |
| 31 | |
| 32 @end | |
| OLD | NEW |