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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/signin_promo_view_controller.mm

Issue 2117183003: Fix left padding in the signin promo in the password bubble on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "chrome/browser/ui/cocoa/passwords/signin_promo_view_controller.h" 5 #import "chrome/browser/ui/cocoa/passwords/signin_promo_view_controller.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "chrome/browser/ui/chrome_style.h" 8 #include "chrome/browser/ui/chrome_style.h"
9 #import "chrome/browser/ui/cocoa/hover_close_button.h" 9 #import "chrome/browser/ui/cocoa/hover_close_button.h"
10 #include "chrome/browser/ui/cocoa/passwords/passwords_bubble_utils.h" 10 #include "chrome/browser/ui/cocoa/passwords/passwords_bubble_utils.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 [view addSubview:_closeButton]; 53 [view addSubview:_closeButton];
54 // Title. 54 // Title.
55 HyperlinkTextView* titleView = TitleBubbleLabelWithLink( 55 HyperlinkTextView* titleView = TitleBubbleLabelWithLink(
56 [self.delegate model]->title(), gfx::Range(), nil); 56 [self.delegate model]->title(), gfx::Range(), nil);
57 // Force the text to wrap to fit in the bubble size. 57 // Force the text to wrap to fit in the bubble size.
58 int titleRightPadding = 58 int titleRightPadding =
59 2 * chrome_style::kCloseButtonPadding + NSWidth([_closeButton frame]); 59 2 * chrome_style::kCloseButtonPadding + NSWidth([_closeButton frame]);
60 int titleWidth = kDesiredBubbleWidth - kFramePadding - titleRightPadding; 60 int titleWidth = kDesiredBubbleWidth - kFramePadding - titleRightPadding;
61 [titleView setVerticallyResizable:YES]; 61 [titleView setVerticallyResizable:YES];
62 [titleView setFrameSize:NSMakeSize(titleWidth, MAXFLOAT)]; 62 [titleView setFrameSize:NSMakeSize(titleWidth, MAXFLOAT)];
63 // Set the same text inset as in the pending password bubble.
64 [[titleView textContainer] setLineFragmentPadding:kTitleTextInset];
63 [titleView sizeToFit]; 65 [titleView sizeToFit];
64 [view addSubview:titleView]; 66 [view addSubview:titleView];
65 67
66 NSString* signInText = 68 NSString* signInText =
67 l10n_util::GetNSString(IDS_PASSWORD_MANAGER_SIGNIN_PROMO_SIGN_IN); 69 l10n_util::GetNSString(IDS_PASSWORD_MANAGER_SIGNIN_PROMO_SIGN_IN);
68 _signInButton.reset([[self addButton:signInText 70 _signInButton.reset([[self addButton:signInText
69 toView:view 71 toView:view
70 target:self 72 target:self
71 action:@selector(onSignInClicked:)] retain]); 73 action:@selector(onSignInClicked:)] retain]);
72 NSString* noText = 74 NSString* noText =
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 129
128 - (NSButton*)noButton { 130 - (NSButton*)noButton {
129 return _noButton.get(); 131 return _noButton.get();
130 } 132 }
131 133
132 - (NSButton*)closeButton { 134 - (NSButton*)closeButton {
133 return _closeButton.get(); 135 return _closeButton.get();
134 } 136 }
135 137
136 @end 138 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698