summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authorkeishi@google.com <keishi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 12:22:31 +0000
committerkeishi@google.com <keishi@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 12:22:31 +0000
commitf4d42445ab3e72eaad1b2539b1b99f7b099d6b0e (patch)
tree539c65a9f257fb5d508d4690a5c5fd5e0b13ffa4 /chrome/browser/ui
parent7f6b60b45eee92072b5fad615e1ad760462d19bb (diff)
downloadchromium_src-f4d42445ab3e72eaad1b2539b1b99f7b099d6b0e.zip
chromium_src-f4d42445ab3e72eaad1b2539b1b99f7b099d6b0e.tar.gz
chromium_src-f4d42445ab3e72eaad1b2539b1b99f7b099d6b0e.tar.bz2
Resize install dialog to fit extension title
Changes to ExtensionInstallPromptNoWarnings.xib: Shrunk the width of title label because it was overflowing the window. And added right margin struts to title label so it auto resizes. BUG=87945 TEST=manually. Install https://chrome.google.com/webstore/detail/apboafhkiegglekeafbckfjldecefkhn and see if you can see the entire title. Review URL: http://codereview.chromium.org/7282025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
index 94cef94..1c8306a 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
@@ -136,6 +136,16 @@ void OffsetControlVertically(NSControl* control, CGFloat amount) {
NSImage* image = gfx::SkBitmapToNSImage(icon_);
[iconView_ setImage:image];
+ // Reisze |titleField_| to fit title
+ CGFloat originalTitleWidth = [titleField_ frame].size.width;
+ [titleField_ sizeToFit];
+ CGFloat newTitleWidth = [titleField_ frame].size.width;
+ if (newTitleWidth > originalTitleWidth) {
+ NSRect frame = [[self window] frame];
+ frame.size.width += newTitleWidth - originalTitleWidth;
+ [[self window] setFrame:frame display:NO];
+ }
+
// Make sure we're the window's delegate as set in the nib.
DCHECK_EQ(self, static_cast<ExtensionInstallDialogController*>(
[[self window] delegate]));