| 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 | 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 16 matching lines...) Expand all Loading... |
| 27 void SetImage(NSImage* image); | 27 void SetImage(NSImage* image); |
| 28 void SetLabel(NSString* label); | 28 void SetLabel(NSString* label); |
| 29 void SetTextColor(NSColor* text_color); | 29 void SetTextColor(NSColor* text_color); |
| 30 void SetFont(NSFont* font); | 30 void SetFont(NSFont* font); |
| 31 void SetRetinaBaselineOffset(CGFloat offset); | 31 void SetRetinaBaselineOffset(CGFloat offset); |
| 32 virtual ui::NinePartImageIds GetBubbleImageIds() = 0; | 32 virtual ui::NinePartImageIds GetBubbleImageIds() = 0; |
| 33 | 33 |
| 34 // Implement |LocationBarDecoration|. | 34 // Implement |LocationBarDecoration|. |
| 35 CGFloat GetWidthForSpace(CGFloat width) override; | 35 CGFloat GetWidthForSpace(CGFloat width) override; |
| 36 void DrawInFrame(NSRect frame, NSView* control_view) override; | 36 void DrawInFrame(NSRect frame, NSView* control_view) override; |
| 37 void DrawWithBackgroundInFrame(NSRect background_frame, | |
| 38 NSRect frame, | |
| 39 NSView* control_view) override; | |
| 40 NSFont* GetFont() const override; | 37 NSFont* GetFont() const override; |
| 41 | 38 |
| 42 protected: | 39 protected: |
| 43 // Returns the amount of padding between the divider and the omnibox text. | 40 // Returns the amount of padding between the divider and the omnibox text. |
| 44 // Returns 0 in non-MD since there's no divider. | 41 // Returns 0 in non-MD since there's no divider. |
| 45 CGFloat DividerPadding() const; | 42 CGFloat DividerPadding() const; |
| 46 | 43 |
| 47 // Helper returning bubble width for the given |image| and |label| | 44 // Helper returning bubble width for the given |image| and |label| |
| 48 // assuming |font_| (for sizing text). Arguments can be nil. | 45 // assuming |font_| (for sizing text). Arguments can be nil. |
| 49 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label); | 46 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 69 FRIEND_TEST_ALL_PREFIXES(SelectedKeywordDecorationTest, | 66 FRIEND_TEST_ALL_PREFIXES(SelectedKeywordDecorationTest, |
| 70 UsesPartialKeywordIfNarrow); | 67 UsesPartialKeywordIfNarrow); |
| 71 | 68 |
| 72 // Contains any Retina-only baseline adjustment for |label_|. | 69 // Contains any Retina-only baseline adjustment for |label_|. |
| 73 CGFloat retina_baseline_offset_; | 70 CGFloat retina_baseline_offset_; |
| 74 | 71 |
| 75 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration); | 72 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration); |
| 76 }; | 73 }; |
| 77 | 74 |
| 78 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_ | 75 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_ |
| OLD | NEW |