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