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

Side by Side Diff: chrome/browser/cocoa/location_bar/autocomplete_text_field_cell.mm

Issue 3046029: [Mac] First pass at final sizing of toolbar items. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Don't disable unit tests for realz, sorry. Created 10 years, 4 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 unified diff | Download patch
OLDNEW
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/autocomplete_text_field.h" 9 #import "chrome/browser/cocoa/location_bar/autocomplete_text_field.h"
10 #import "chrome/browser/cocoa/location_bar/location_bar_decoration.h" 10 #import "chrome/browser/cocoa/location_bar/location_bar_decoration.h"
11 11
12 namespace { 12 namespace {
13 13
14 const CGFloat kBaselineAdjust = 2.0; 14 const CGFloat kBaselineAdjust = 3.0;
15 15
16 // Matches the clipping radius of |GradientButtonCell|. 16 // Matches the clipping radius of |GradientButtonCell|.
17 const CGFloat kCornerRadius = 4.0; 17 const CGFloat kCornerRadius = 4.0;
18 18
19 // How far to inset the left-hand decorations from the field's bounds. 19 // How far to inset the left-hand decorations from the field's bounds.
20 const CGFloat kLeftDecorationXOffset = 3.0; 20 const CGFloat kLeftDecorationXOffset = 4.0;
21 21
22 // How far to inset the right-hand decorations from the field's bounds. 22 // How far to inset the right-hand decorations from the field's bounds.
23 // TODO(shess): Why is this different from |kLeftDecorationXOffset|? 23 // TODO(shess): Why is this different from |kLeftDecorationXOffset|?
24 const CGFloat kRightDecorationXOffset = 4.0; 24 const CGFloat kRightDecorationXOffset = 4.0;
25 25
26 // The amount of padding on either side reserved for drawing 26 // The amount of padding on either side reserved for drawing
27 // decorations. [Views has |kItemPadding| == 3.] 27 // decorations. [Views has |kItemPadding| == 3.]
28 const CGFloat kDecorationHorizontalPad = 3.0; 28 const CGFloat kDecorationHorizontalPad = 3.0;
29 29
30 // How long to wait for mouse-up on the location icon before assuming 30 // How long to wait for mouse-up on the location icon before assuming
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 &decorations, &decorationFrames, &textFrame); 392 &decorations, &decorationFrames, &textFrame);
393 393
394 for (size_t i = 0; i < decorations.size(); ++i) { 394 for (size_t i = 0; i < decorations.size(); ++i) {
395 NSString* tooltip = decorations[i]->GetToolTip(); 395 NSString* tooltip = decorations[i]->GetToolTip();
396 if ([tooltip length] > 0) 396 if ([tooltip length] > 0)
397 [controlView addToolTip:tooltip forRect:decorationFrames[i]]; 397 [controlView addToolTip:tooltip forRect:decorationFrames[i]];
398 } 398 }
399 } 399 }
400 400
401 @end 401 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698