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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/bubble_decoration.h

Issue 2861283002: [Mac] Refactor decoration divider code. (Closed)
Patch Set: Created 3 years, 7 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
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 18 matching lines...) Expand all
29 void SetFont(NSFont* font); 29 void SetFont(NSFont* font);
30 void SetRetinaBaselineOffset(CGFloat offset); 30 void SetRetinaBaselineOffset(CGFloat offset);
31 31
32 // Implement |LocationBarDecoration|. 32 // Implement |LocationBarDecoration|.
33 CGFloat GetWidthForSpace(CGFloat width) override; 33 CGFloat GetWidthForSpace(CGFloat width) override;
34 NSRect GetBackgroundFrame(NSRect frame) override; 34 NSRect GetBackgroundFrame(NSRect frame) override;
35 void DrawInFrame(NSRect frame, NSView* control_view) override; 35 void DrawInFrame(NSRect frame, NSView* control_view) override;
36 NSFont* GetFont() const override; 36 NSFont* GetFont() const override;
37 37
38 protected: 38 protected:
39 // Returns the amount of padding between the divider and the omnibox text.
40 // Returns 0 in non-MD since there's no divider.
41 CGFloat DividerPadding() const;
42
43 // Helper returning bubble width for the given |image| and |label| 39 // Helper returning bubble width for the given |image| and |label|
44 // assuming |font_| (for sizing text). Arguments can be nil. 40 // assuming |font_| (for sizing text). Arguments can be nil.
45 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label); 41 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label);
46 42
47 // Helper to return where the image is drawn, for subclasses to drag 43 // Helper to return where the image is drawn, for subclasses to drag
48 // from. |frame| is the decoration's frame in the containing cell. 44 // from. |frame| is the decoration's frame in the containing cell.
49 NSRect GetImageRectInFrame(NSRect frame); 45 NSRect GetImageRectInFrame(NSRect frame);
50 46
51 // Returns the text color when the theme is dark. 47 // Returns the text color when the theme is dark.
52 virtual NSColor* GetDarkModeTextColor(); 48 virtual NSColor* GetDarkModeTextColor();
(...skipping 12 matching lines...) Expand all
65 FRIEND_TEST_ALL_PREFIXES(SelectedKeywordDecorationTest, 61 FRIEND_TEST_ALL_PREFIXES(SelectedKeywordDecorationTest,
66 UsesPartialKeywordIfNarrow); 62 UsesPartialKeywordIfNarrow);
67 63
68 // Contains any Retina-only baseline adjustment for |label_|. 64 // Contains any Retina-only baseline adjustment for |label_|.
69 CGFloat retina_baseline_offset_; 65 CGFloat retina_baseline_offset_;
70 66
71 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration); 67 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration);
72 }; 68 };
73 69
74 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_ 70 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698