Chromium Code Reviews| Index: chrome/browser/login_prompt_mac.mm |
| =================================================================== |
| --- chrome/browser/login_prompt_mac.mm (revision 26109) |
| +++ chrome/browser/login_prompt_mac.mm (working copy) |
| @@ -19,6 +19,7 @@ |
| #include "chrome/common/notification_service.h" |
| #include "grit/generated_resources.h" |
| #include "net/url_request/url_request.h" |
| +#include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
| using webkit_glue::PasswordForm; |
| @@ -89,6 +90,8 @@ |
| SetModel(manager); |
| + [sheet_controller_ setExplanation:base::SysWideToNSString(explanation)]; |
| + |
| // Scary thread safety note: This can potentially be called *after* SetAuth |
| // or CancelAuth (say, if the request was cancelled before the UI thread got |
| // control). However, that's OK since any UI interaction in those functions |
| @@ -312,8 +315,11 @@ |
| @implementation LoginHandlerSheet |
| - (id)initWithLoginHandler:(LoginHandlerMac*)handler { |
| - if ((self = [super initWithWindowNibName:@"HttpAuthLoginSheet" |
| - owner:self])) { |
| + NSString* nibPath = |
| + [mac_util::MainAppBundle() pathForResource:@"HttpAuthLoginSheet" |
| + ofType:@"nib"]; |
| + if ((self = [super initWithWindowNibPath:nibPath |
| + owner:self])) { |
| handler_ = handler; |
| } |
| return self; |
| @@ -346,4 +352,22 @@ |
| } |
| } |
| +- (void)setExplanation:(NSString*)explanation { |
| + // Put in the text |
|
pink (ping after 24hrs)
2009/09/14 19:08:12
period after sentence. applies to 2 comments below
|
| + [explanationField_ setStringValue:explanation]; |
| + |
| + // Resize the TextField |
| + CGFloat explanationShift = |
| + [GTMUILocalizerAndLayoutTweaker |
| + sizeToFitFixedWidthTextField:explanationField_]; |
| + |
| + // Resize the window (no shifting needed due to window layout) |
| + NSWindow* window = [self window]; |
| + [[window contentView] setAutoresizesSubviews:NO]; |
| + NSRect rect = [window frame]; |
| + rect.size.height = rect.size.height + explanationShift; |
|
Nico
2009/09/14 19:34:56
+=
|
| + [window setFrame:rect display:NO]; |
| + [[window contentView] setAutoresizesSubviews:YES]; |
| +} |
| + |
| @end |
| Property changes on: chrome/browser/login_prompt_mac.mm |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |