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

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

Issue 2601513003: Fix the title alignment for the password bubble on Mac. (Closed)
Patch Set: Created 4 years 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 | « chrome/browser/ui/cocoa/passwords/confirmation_password_saved_view_controller.mm ('k') | 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/manage_passwords_view_controller.h" 5 #import "chrome/browser/ui/cocoa/passwords/manage_passwords_view_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "chrome/browser/ui/cocoa/chrome_style.h" 10 #include "chrome/browser/ui/cocoa/chrome_style.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 contentView = noPasswordsView_.get(); 77 contentView = noPasswordsView_.get();
78 } else { 78 } else {
79 passwordsListController_.reset([[PasswordsListViewController alloc] 79 passwordsListController_.reset([[PasswordsListViewController alloc]
80 initWithModelAndForms:self.model 80 initWithModelAndForms:self.model
81 forms:&self.model->local_credentials()]); 81 forms:&self.model->local_credentials()]);
82 contentView = [passwordsListController_ view]; 82 contentView = [passwordsListController_ view];
83 } 83 }
84 [view addSubview:contentView]; 84 [view addSubview:contentView];
85 85
86 // Wrap the title if necessary to match the width of the content view. 86 // Wrap the title if necessary to match the width of the content view.
87 if (NSWidth([titleLabel frame]) > NSWidth([contentView frame])) { 87 [titleLabel setFrameSize:NSMakeSize(NSWidth([contentView frame]), 0)];
88 [titleLabel setFrameSize:NSMakeSize(NSWidth([contentView frame]), 0)]; 88 [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:titleLabel];
89 [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:titleLabel];
90 }
91 89
92 // Done button. 90 // Done button.
93 doneButton_.reset([[self addButton:l10n_util::GetNSString(IDS_DONE) 91 doneButton_.reset([[self addButton:l10n_util::GetNSString(IDS_DONE)
94 toView:view 92 toView:view
95 target:self 93 target:self
96 action:@selector(onDoneClicked:)] retain]); 94 action:@selector(onDoneClicked:)] retain]);
97 95
98 // Manage button. 96 // Manage button.
99 manageButton_.reset([[NSButton alloc] initWithFrame:NSZeroRect]); 97 manageButton_.reset([[NSButton alloc] initWithFrame:NSZeroRect]);
100 base::scoped_nsobject<HyperlinkButtonCell> cell([[HyperlinkButtonCell alloc] 98 base::scoped_nsobject<HyperlinkButtonCell> cell([[HyperlinkButtonCell alloc]
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 172
175 - (NoPasswordsView*)noPasswordsView { 173 - (NoPasswordsView*)noPasswordsView {
176 return noPasswordsView_.get(); 174 return noPasswordsView_.get();
177 } 175 }
178 176
179 - (PasswordsListViewController*)passwordsListController { 177 - (PasswordsListViewController*)passwordsListController {
180 return passwordsListController_.get(); 178 return passwordsListController_.get();
181 } 179 }
182 180
183 @end 181 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/passwords/confirmation_password_saved_view_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698