| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/location_bar/autocomplete_text_field_cell.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // Matches the clipping radius of |GradientButtonCell|. | 30 // Matches the clipping radius of |GradientButtonCell|. |
| 31 const CGFloat kCornerRadius = 3.0; | 31 const CGFloat kCornerRadius = 3.0; |
| 32 | 32 |
| 33 // How far to inset the left- and right-hand decorations from the field's | 33 // How far to inset the left- and right-hand decorations from the field's |
| 34 // bounds. | 34 // bounds. |
| 35 const CGFloat kRightDecorationXOffset = 2.0; | 35 const CGFloat kRightDecorationXOffset = 2.0; |
| 36 const CGFloat kLeftDecorationXOffset = 1.0; | 36 const CGFloat kLeftDecorationXOffset = 1.0; |
| 37 | 37 |
| 38 // How much the text frame needs to overlap the rightmost left decoration. | 38 // How much the text frame needs to overlap the rightmost left decoration. |
| 39 const CGFloat kTextFrameDecorationOverlap = 4.0; | 39 const CGFloat kTextFrameDecorationOverlap = 5.0; |
| 40 | 40 |
| 41 // How long to wait for mouse-up on the location icon before assuming | 41 // How long to wait for mouse-up on the location icon before assuming |
| 42 // that the user wants to drag. | 42 // that the user wants to drag. |
| 43 const NSTimeInterval kLocationIconDragTimeout = 0.25; | 43 const NSTimeInterval kLocationIconDragTimeout = 0.25; |
| 44 | 44 |
| 45 // Calculate the positions for a set of decorations. |frame| is the | 45 // Calculate the positions for a set of decorations. |frame| is the |
| 46 // overall frame to do layout in, |remaining_frame| will get the | 46 // overall frame to do layout in, |remaining_frame| will get the |
| 47 // left-over space. |all_decorations| is the set of decorations to | 47 // left-over space. |all_decorations| is the set of decorations to |
| 48 // lay out, |decorations| will be set to the decorations which are | 48 // lay out, |decorations| will be set to the decorations which are |
| 49 // visible and which fit, in the same order as |all_decorations|, | 49 // visible and which fit, in the same order as |all_decorations|, |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 | 694 |
| 695 @end | 695 @end |
| 696 | 696 |
| 697 @implementation AutocompleteTextFieldCell (TestingAPI) | 697 @implementation AutocompleteTextFieldCell (TestingAPI) |
| 698 | 698 |
| 699 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations { | 699 - (const std::vector<LocationBarDecoration*>&)mouseTrackingDecorations { |
| 700 return mouseTrackingDecorations_; | 700 return mouseTrackingDecorations_; |
| 701 } | 701 } |
| 702 | 702 |
| 703 @end | 703 @end |
| OLD | NEW |