OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/location_bar/autocomplete_text_field_cell.h" | 5 #import "chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "chrome/browser/cocoa/image_utils.h" | 8 #import "chrome/browser/cocoa/image_utils.h" |
9 #import "chrome/browser/cocoa/location_bar/location_bar_decoration.h" | 9 #import "chrome/browser/cocoa/location_bar/location_bar_decoration.h" |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // decorations need to be trimmed. | 45 // decorations need to be trimmed. |
46 const CGFloat kEditorHorizontalInset = 3.0; | 46 const CGFloat kEditorHorizontalInset = 3.0; |
47 | 47 |
48 // How far to inset the left-hand decorations from the field's bounds. | 48 // How far to inset the left-hand decorations from the field's bounds. |
49 const CGFloat kLeftDecorationXOffset = 3.0; | 49 const CGFloat kLeftDecorationXOffset = 3.0; |
50 | 50 |
51 // How far to inset the right-hand decorations from the field's bounds. | 51 // How far to inset the right-hand decorations from the field's bounds. |
52 // TODO(shess): Why is this different from |kLeftDecorationXOffset|? | 52 // TODO(shess): Why is this different from |kLeftDecorationXOffset|? |
53 const CGFloat kRightDecorationXOffset = 4.0; | 53 const CGFloat kRightDecorationXOffset = 4.0; |
54 | 54 |
55 // The amount of padding on either side reserved for drawing decorations. | 55 // The amount of padding on either side reserved for drawing |
56 const CGFloat kDecorationHorizontalPad = 3; | 56 // decorations. [Views has |kItemPadding| == 3.] |
| 57 const CGFloat kDecorationHorizontalPad = 3.0; |
57 | 58 |
58 // How long to wait for mouse-up on the location icon before assuming | 59 // How long to wait for mouse-up on the location icon before assuming |
59 // that the user wants to drag. | 60 // that the user wants to drag. |
60 const NSTimeInterval kLocationIconDragTimeout = 0.25; | 61 const NSTimeInterval kLocationIconDragTimeout = 0.25; |
61 | 62 |
62 // Conveniences to centralize width+offset calculations. | 63 // Conveniences to centralize width+offset calculations. |
63 CGFloat WidthForHint(NSAttributedString* hintString) { | 64 CGFloat WidthForHint(NSAttributedString* hintString) { |
64 return kRightDecorationXOffset + ceil([hintString size].width); | 65 return kRightDecorationXOffset + ceil([hintString size].width); |
65 } | 66 } |
66 | 67 |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 } | 720 } |
720 | 721 |
721 return YES; | 722 return YES; |
722 } | 723 } |
723 | 724 |
724 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { | 725 - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { |
725 return NSDragOperationCopy; | 726 return NSDragOperationCopy; |
726 } | 727 } |
727 | 728 |
728 @end | 729 @end |
OLD | NEW |