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

Side by Side Diff: chrome/browser/ui/cocoa/tab_contents/preview_drop_shadow_view.mm

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 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/preview_drop_shadow_view.h"
6
7 #include "grit/theme_resources.h"
8 #include "ui/base/resource/resource_bundle.h"
9
10 @implementation PreviewDropShadowView
11
12 + (CGFloat)preferredHeight {
13 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
14 NSImage* shadowImage =
15 rb.GetNativeImageNamed(IDR_PREVIEW_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_PREVIEW_DROP_SHADOW).ToNSImage();
26 [shadowImage drawInRect:bounds
27 fromRect:NSZeroRect
28 operation:NSCompositeSourceOver
29 fraction:1.0];
30 }
31
32 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698