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

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h

Issue 12042002: Alternate NTP: Add search token to omnibox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 7 years, 11 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/location_bar_decoration.h
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
index 75ce64d2711b57275e5b0693168bfdb599267c11..71ac9db4813d85278b5f0584c51c1b4a54320a2b 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
@@ -34,8 +34,9 @@ class LocationBarDecoration {
// Decorations can change their size to fit the available space.
// Returns the width the decoration will use in the space allotted,
- // or |kOmittedWidth| if it should be omitted.
- virtual CGFloat GetWidthForSpace(CGFloat width);
+ // or |kOmittedWidth| if it should be omitted. |text_width| is the width of
+ // the omnibox text, which which can be greater than |width|.
+ virtual CGFloat GetWidthForSpace(CGFloat width, CGFloat text_width);
// Draw the decoration in the frame provided. The frame will be
// generated from an earlier call to |GetWidthForSpace()|.
@@ -86,10 +87,17 @@ class LocationBarDecoration {
// inherits from that class (i.e. if it needs to act as a button).
virtual ButtonDecoration* AsButtonDecoration();
+ // Returns true if this is a separator.
+ virtual bool IsSeparator() const;
+
// Width returned by |GetWidthForSpace()| when the item should be
// omitted for this width;
static const CGFloat kOmittedWidth;
+ // How far to inset the text area from the top and bottom. This vertically
+ // centers the text.
+ static const CGFloat kTextYInset;
+
private:
bool visible_;

Powered by Google App Engine
This is Rietveld 408576698