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

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm

Issue 15553008: Instant Extended: Reduce clipping in omnibox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
index 8ee242e323b85ba5d8459730c45a8a173a6fd557..566e02a2a1c9d0190498c0bf7b63849099527f66 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/mac/foundation_util.h"
#include "base/mac/mac_logging.h"
+#include "chrome/browser/search/search.h"
#import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
#import "chrome/browser/ui/cocoa/location_bar/button_decoration.h"
#import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h"
@@ -19,8 +20,6 @@ using extensions::FeatureSwitch;
namespace {
-const CGFloat kBaselineAdjust = 3.0;
-
// Matches the clipping radius of |GradientButtonCell|.
const CGFloat kCornerRadius = 3.0;
@@ -216,8 +215,14 @@ size_t CalculatePositionsInFrame(
@implementation AutocompleteTextFieldCell
-- (CGFloat)baselineAdjust {
- return kBaselineAdjust;
+- (CGFloat)topTextFrameOffset {
+ if (chrome::IsInstantExtendedAPIEnabled())
+ return 2.0;
+ return 3.0;
+}
+
+- (CGFloat)bottomTextFrameOffset {
+ return 3.0;
}
- (CGFloat)cornerRadius {
@@ -233,6 +238,12 @@ size_t CalculatePositionsInFrame(
return YES;
}
+- (CGFloat)lineHeight {
+ if (chrome::IsInstantExtendedAPIEnabled())
+ return 19;
+ return 16;
+}
+
- (void)clearDecorations {
leftDecorations_.clear();
rightDecorations_.clear();

Powered by Google App Engine
This is Rietveld 408576698