summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/location_bar_cell.mm
blob: 2f8698da12e4548c0552842226bf7d90407f8d6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "chrome/browser/cocoa/location_bar_cell.h"

const NSInteger kBaselineOffset = 1;

@implementation LocationBarCell

- (void)drawInteriorWithFrame:(NSRect)cellFrame
                       inView:(NSView *)controlView {
  [super drawInteriorWithFrame:NSInsetRect(cellFrame, 0, kBaselineOffset)
                        inView:controlView];
}

// Override these methods so that the field editor shows up in the right place
- (void)editWithFrame:(NSRect)cellFrame
               inView:(NSView *)controlView
               editor:(NSText *)textObj
             delegate:(id)anObject
                event:(NSEvent *)theEvent {
  [super editWithFrame:NSInsetRect(cellFrame, 0, kBaselineOffset)
                inView:controlView
                editor:textObj
              delegate:anObject
                 event:theEvent];
}


// Override these methods so that the field editor shows up in the right place
- (void)selectWithFrame:(NSRect)cellFrame
                 inView:(NSView *)controlView
                 editor:(NSText *)textObj
               delegate:(id)anObject
                  start:(NSInteger)selStart
                 length:(NSInteger)selLength {
  [super selectWithFrame:NSInsetRect(cellFrame, 0, kBaselineOffset)
                  inView:controlView editor:textObj
                delegate:anObject
                   start:selStart
                  length:selLength];
}

@end