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

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: update separator color 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..2ba8852c27ab457958c62f27fc98d84f134fd679 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h
@@ -10,6 +10,7 @@
#import "base/basictypes.h"
class ButtonDecoration;
+class SeparatorDecoration;
// Base class for decorations at the left and right of the location
// bar. For instance, the location icon.
@@ -34,8 +35,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 widget of
+ // the omnibox text.
+ 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 +88,18 @@ class LocationBarDecoration {
// inherits from that class (i.e. if it needs to act as a button).
virtual ButtonDecoration* AsButtonDecoration();
+ // Returns the current |LocationBarDecoration| as a |SeparatorDecoration|, if
+ // it inherits from that class (i.e. if it needs to act as a button).
+ virtual SeparatorDecoration* AsSeparatorDecoration();
+
// 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