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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/passwords_bubble_utils.h

Issue 2773733002: Fix Password bubble title misalignment. (Closed)
Patch Set: mac fix Created 3 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_PASSWORDS_PASSWORDS_BUBBLE_UTILS_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_PASSWORDS_PASSWORDS_BUBBLE_UTILS_H_
6 #define CHROME_BROWSER_UI_COCOA_PASSWORDS_PASSWORDS_BUBBLE_UTILS_H_ 6 #define CHROME_BROWSER_UI_COCOA_PASSWORDS_PASSWORDS_BUBBLE_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #import <Cocoa/Cocoa.h> 10 #import <Cocoa/Cocoa.h>
11 11
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "third_party/skia/include/core/SkColor.h" 13 #include "third_party/skia/include/core/SkColor.h"
14 #include "ui/gfx/range/range.h" 14 #include "ui/gfx/range/range.h"
15 15
16 @class HyperlinkTextView; 16 @class HyperlinkTextView;
17 17
18 constexpr CGFloat kDesiredBubbleWidth = 370; 18 constexpr CGFloat kDesiredBubbleWidth = 370;
19 constexpr CGFloat kFramePadding = 16; 19 constexpr CGFloat kFramePadding = 16;
20 constexpr CGFloat kDesiredRowWidth = kDesiredBubbleWidth - 2 * kFramePadding; 20 constexpr CGFloat kDesiredRowWidth = kDesiredBubbleWidth - 2 * kFramePadding;
21 constexpr CGFloat kItemLabelSpacing = 10; 21 constexpr CGFloat kItemLabelSpacing = 10;
22 constexpr CGFloat kMinUsernameSize = 50; 22 constexpr CGFloat kMinUsernameSize = 50;
23 constexpr CGFloat kRelatedControlHorizontalPadding = 2; 23 constexpr CGFloat kRelatedControlHorizontalPadding = 2;
24 constexpr CGFloat kRelatedControlVerticalSpacing = 8; 24 constexpr CGFloat kRelatedControlVerticalSpacing = 8;
25 constexpr CGFloat kTitleTextInset = 2; 25 constexpr CGFloat kTitleTextInset = 2;
26 constexpr CGFloat kUnrelatedControlVerticalPadding = 15; 26 constexpr CGFloat kUnrelatedControlVerticalPadding = 15;
27 constexpr CGFloat kVerticalAvatarMargin = 8; 27 constexpr CGFloat kVerticalAvatarMargin = 8;
28 constexpr CGFloat kConfirmationBubbleContentInset = 2;
28 29
29 // Returns a font for password bubbles. 30 // Returns a font for password bubbles.
30 NSFont* LabelFont(); 31 NSFont* LabelFont();
31 32
32 // Returns a size of a text that is defined by |resourceID| with a font 33 // Returns a size of a text that is defined by |resourceID| with a font
33 // returned by LabelFont(). 34 // returned by LabelFont().
34 NSSize LabelSize(int resourceID); 35 NSSize LabelSize(int resourceID);
35 36
36 // Initialize |textField| with |text| and default style parameters. 37 // Initialize |textField| with |text| and default style parameters.
37 void InitLabel(NSTextField* textField, const base::string16& text); 38 void InitLabel(NSTextField* textField, const base::string16& text);
(...skipping 28 matching lines...) Expand all
66 id<NSTextViewDelegate> delegate); 67 id<NSTextViewDelegate> delegate);
67 68
68 // Returns a label with |text| and small font. Nonempty |range| may specify a 69 // Returns a label with |text| and small font. Nonempty |range| may specify a
69 // link range. 70 // link range.
70 HyperlinkTextView* LabelWithLink(const base::string16& text, 71 HyperlinkTextView* LabelWithLink(const base::string16& text,
71 SkColor color, 72 SkColor color,
72 gfx::Range range, 73 gfx::Range range,
73 id<NSTextViewDelegate> delegate); 74 id<NSTextViewDelegate> delegate);
74 75
75 #endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_PASSWORDS_BUBBLE_UTILS_H_ 76 #endif // CHROME_BROWSER_UI_COCOA_PASSWORDS_PASSWORDS_BUBBLE_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698