OLD | NEW |
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 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // Setup the drawing parameters. | 24 // Setup the drawing parameters. |
25 NSImage* GetImage(); | 25 NSImage* GetImage(); |
26 void SetImage(NSImage* image); | 26 void SetImage(NSImage* image); |
27 void SetLabel(NSString* label); | 27 void SetLabel(NSString* label); |
28 void SetColors(NSColor* border_color, | 28 void SetColors(NSColor* border_color, |
29 NSColor* background_color, | 29 NSColor* background_color, |
30 NSColor* text_color); | 30 NSColor* text_color); |
31 | 31 |
32 // Implement |LocationBarDecoration|. | 32 // Implement |LocationBarDecoration|. |
33 virtual void DrawInFrame(NSRect frame, NSView* control_view); | 33 virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE; |
34 virtual CGFloat GetWidthForSpace(CGFloat width); | 34 virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE; |
35 | 35 |
36 protected: | 36 protected: |
37 // Helper returning bubble width for the given |image| and |label| | 37 // Helper returning bubble width for the given |image| and |label| |
38 // assuming |font_| (for sizing text). Arguments can be nil. | 38 // assuming |font_| (for sizing text). Arguments can be nil. |
39 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label); | 39 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label); |
40 | 40 |
41 // Helper to return where the image is drawn, for subclasses to drag | 41 // Helper to return where the image is drawn, for subclasses to drag |
42 // from. |frame| is the decoration's frame in the containing cell. | 42 // from. |frame| is the decoration's frame in the containing cell. |
43 NSRect GetImageRectInFrame(NSRect frame); | 43 NSRect GetImageRectInFrame(NSRect frame); |
44 | 44 |
(...skipping 13 matching lines...) Expand all Loading... |
58 | 58 |
59 // Colors used to draw the bubble, should be set by the subclass | 59 // Colors used to draw the bubble, should be set by the subclass |
60 // constructor. | 60 // constructor. |
61 scoped_nsobject<NSColor> background_color_; | 61 scoped_nsobject<NSColor> background_color_; |
62 scoped_nsobject<NSColor> border_color_; | 62 scoped_nsobject<NSColor> border_color_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration); | 64 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration); |
65 }; | 65 }; |
66 | 66 |
67 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_ | 67 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_ |
OLD | NEW |