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

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

Issue 2152823004: [Material][Mac] Animation for Omnibox Verbose State Chips (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaning up Created 4 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 22 matching lines...) Expand all
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, 37 void DrawWithBackgroundInFrame(NSRect background_frame,
38 NSRect frame, 38 NSRect frame,
39 NSView* control_view) override; 39 NSView* control_view) override;
40 NSFont* GetFont() const override; 40 NSFont* GetFont() const override;
41 41
42 protected: 42 protected:
43 CGFloat DividerPadding() const;
44
43 // Helper returning bubble width for the given |image| and |label| 45 // Helper returning bubble width for the given |image| and |label|
44 // assuming |font_| (for sizing text). Arguments can be nil. 46 // assuming |font_| (for sizing text). Arguments can be nil.
45 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label); 47 CGFloat GetWidthForImageAndLabel(NSImage* image, NSString* label);
46 48
47 // Helper to return where the image is drawn, for subclasses to drag 49 // Helper to return where the image is drawn, for subclasses to drag
48 // from. |frame| is the decoration's frame in the containing cell. 50 // from. |frame| is the decoration's frame in the containing cell.
49 NSRect GetImageRectInFrame(NSRect frame); 51 NSRect GetImageRectInFrame(NSRect frame);
50 52
51 private:
52 friend class SelectedKeywordDecorationTest;
53 FRIEND_TEST_ALL_PREFIXES(SelectedKeywordDecorationTest,
54 UsesPartialKeywordIfNarrow);
55
56 // Image drawn in the left side of the bubble. 53 // Image drawn in the left side of the bubble.
57 base::scoped_nsobject<NSImage> image_; 54 base::scoped_nsobject<NSImage> image_;
58 55
59 // Label to draw to right of image. Can be |nil|. 56 // Label to draw to right of image. Can be |nil|.
60 base::scoped_nsobject<NSString> label_; 57 base::scoped_nsobject<NSString> label_;
61 58
62 // Contains attribute for drawing |label_|. 59 // Contains attribute for drawing |label_|.
63 base::scoped_nsobject<NSMutableDictionary> attributes_; 60 base::scoped_nsobject<NSMutableDictionary> attributes_;
64 61
62 private:
63 friend class SelectedKeywordDecorationTest;
64 FRIEND_TEST_ALL_PREFIXES(SelectedKeywordDecorationTest,
65 UsesPartialKeywordIfNarrow);
66
65 // Contains any Retina-only baseline adjustment for |label_|. 67 // Contains any Retina-only baseline adjustment for |label_|.
66 CGFloat retina_baseline_offset_; 68 CGFloat retina_baseline_offset_;
67 69
68 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration); 70 DISALLOW_COPY_AND_ASSIGN(BubbleDecoration);
69 }; 71 };
70 72
71 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_ 73 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_BUBBLE_DECORATION_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698