BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / omnibox / omnibox_popup_separator_view.mm
blob49f9a0df1fa639660a01f6adf533dd1ff55a50dd
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.
5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_separator_view.h"
7 #include "grit/theme_resources.h"
8 #import "ui/base/cocoa/nsview_additions.h"
9 #include "ui/base/resource/resource_bundle.h"
11 @implementation OmniboxPopupTopSeparatorView
13 + (CGFloat)preferredHeight {
14   return 1;
17 - (void)drawRect:(NSRect)rect {
18   NSRect separatorRect = [self bounds];
19   separatorRect.size.height = [self cr_lineWidth];
20   [[self strokeColor] set];
21   NSRectFillUsingOperation(separatorRect, NSCompositeSourceOver);
24 @end
26 @implementation OmniboxPopupBottomSeparatorView
28 + (CGFloat)preferredHeight {
29   ResourceBundle& rb = ResourceBundle::GetSharedInstance();
30   NSImage* shadowImage =
31       rb.GetNativeImageNamed(IDR_OVERLAY_DROP_SHADOW).ToNSImage();
32   return [shadowImage size].height;
35 - (void)drawRect:(NSRect)rect {
36   ResourceBundle& rb = ResourceBundle::GetSharedInstance();
37   NSRect bounds = [self bounds];
39   // Draw the shadow.
40   NSImage* shadowImage =
41       rb.GetNativeImageNamed(IDR_OVERLAY_DROP_SHADOW).ToNSImage();
42   [shadowImage drawInRect:bounds
43                  fromRect:NSZeroRect
44                 operation:NSCompositeSourceOver
45                  fraction:1.0];
48 @end