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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/bubble_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, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_ 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 12 matching lines...) Expand all
23 // Setup the drawing parameters. 23 // Setup the drawing parameters.
24 NSImage* GetImage(); 24 NSImage* GetImage();
25 void SetImage(NSImage* image); 25 void SetImage(NSImage* image);
26 void SetLabel(NSString* label); 26 void SetLabel(NSString* label);
27 void SetColors(NSColor* border_color, 27 void SetColors(NSColor* border_color,
28 NSColor* background_color, 28 NSColor* background_color,
29 NSColor* text_color); 29 NSColor* text_color);
30 30
31 // Implement |LocationBarDecoration|. 31 // Implement |LocationBarDecoration|.
32 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; 32 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE;
33 virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE; 33 virtual CGFloat GetWidthForSpace(CGFloat width, CGFloat text_width) OVERRIDE;
34 34
35 protected: 35 protected:
36 // Helper returning bubble width for the given |image| and |label| 36 // Helper returning bubble width for the given |image| and |label|
37 // assuming |font_| (for sizing text). Arguments can be nil. 37 // assuming |font_| (for sizing text). Arguments can be nil.
38 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label); 38 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label);
39 39
40 // Helper to return where the image is drawn, for subclasses to drag 40 // Helper to return where the image is drawn, for subclasses to drag
41 // from. |frame| is the decoration's frame in the containing cell. 41 // from. |frame| is the decoration's frame in the containing cell.
42 NSRect GetImageRectInFrame(NSRect frame); 42 NSRect GetImageRectInFrame(NSRect frame);
43 43
(...skipping 13 matching lines...) Expand all
57 57
58 // Colors used to draw the bubble, should be set by the subclass 58 // Colors used to draw the bubble, should be set by the subclass
59 // constructor. 59 // constructor.
60 scoped_nsobject<NSColor> background_color_; 60 scoped_nsobject<NSColor> background_color_;
61 scoped_nsobject<NSColor> border_color_; 61 scoped_nsobject<NSColor> border_color_;
62 62
63 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration); 63 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration);
64 }; 64 };
65 65
66 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_ 66 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698