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

Unified Diff: chrome/browser/login_prompt_mac.mm

Issue 196109: Load the http auth dialog from the main bundle.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/login_prompt_mac.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/login_prompt_mac.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698