| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/login_prompt.h" | 5 #include "chrome/browser/login_prompt.h" |
| 6 #import "chrome/browser/login_prompt_mac.h" | 6 #import "chrome/browser/login_prompt_mac.h" |
| 7 | 7 |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/mac_util.h" | 9 #include "base/mac_util.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 - (void)setExplanation:(NSString*)explanation { | 355 - (void)setExplanation:(NSString*)explanation { |
| 356 // Put in the text. | 356 // Put in the text. |
| 357 [explanationField_ setStringValue:explanation]; | 357 [explanationField_ setStringValue:explanation]; |
| 358 | 358 |
| 359 // Resize the TextField. | 359 // Resize the TextField. |
| 360 CGFloat explanationShift = | 360 CGFloat explanationShift = |
| 361 [GTMUILocalizerAndLayoutTweaker | 361 [GTMUILocalizerAndLayoutTweaker |
| 362 sizeToFitFixedWidthTextField:explanationField_]; | 362 sizeToFitFixedWidthTextField:explanationField_]; |
| 363 | 363 |
| 364 // Resize the window (no shifting needed due to window layout). | 364 // Resize the window (no shifting needed due to window layout). |
| 365 NSWindow* window = [self window]; | 365 NSSize windowDelta = NSMakeSize(0, explanationShift); |
| 366 [[window contentView] setAutoresizesSubviews:NO]; | 366 [GTMUILocalizerAndLayoutTweaker |
| 367 NSRect rect = [window frame]; | 367 resizeWindowWithoutAutoResizingSubViews:[self window] |
| 368 rect.size.height = rect.size.height + explanationShift; | 368 delta:windowDelta]; |
| 369 [window setFrame:rect display:NO]; | |
| 370 [[window contentView] setAutoresizesSubviews:YES]; | |
| 371 } | 369 } |
| 372 | 370 |
| 373 @end | 371 @end |
| OLD | NEW |