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

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm

Issue 12258023: Fixes bug where chrome hangs in Mac when clicking on Permission link on Extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm
index 8969b4a8602adfc5cf8f270adc4ac3f6a09eddbf..5eb4bbc0a560ef09a4756745a5f4b9dc713adf62 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm
@@ -186,8 +186,15 @@ void DrawBulletInFrame(NSRect frame) {
- (void)awakeFromNib {
// Set control labels.
[titleField_ setStringValue:base::SysUTF16ToNSString(prompt_->GetHeading())];
- [okButton_ setTitle:base::SysUTF16ToNSString(
- prompt_->GetAcceptButtonLabel())];
+ NSRect okButtonRect;
+ if (prompt_->HasAcceptButtonLabel()) {
+ [okButton_ setTitle:base::SysUTF16ToNSString(
+ prompt_->GetAcceptButtonLabel())];
+ } else {
+ [okButton_ removeFromSuperview];
+ okButtonRect = [okButton_ frame];
+ okButton_ = nil;
+ }
[cancelButton_ setTitle:prompt_->HasAbortButtonLabel() ?
base::SysUTF16ToNSString(prompt_->GetAbortButtonLabel()) :
l10n_util::GetNSString(IDS_CANCEL)];
@@ -218,11 +225,19 @@ void DrawBulletInFrame(NSRect frame) {
// Resize |okButton_| and |cancelButton_| to fit the button labels, but keep
// them right-aligned.
- NSSize buttonDelta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:okButton_];
- if (buttonDelta.width) {
- [okButton_ setFrame:NSOffsetRect([okButton_ frame], -buttonDelta.width, 0)];
- [cancelButton_ setFrame:NSOffsetRect([cancelButton_ frame],
- -buttonDelta.width, 0)];
+ NSSize buttonDelta;
+ if (okButton_) {
+ buttonDelta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:okButton_];
+ if (buttonDelta.width) {
+ [okButton_ setFrame:NSOffsetRect([okButton_ frame],
+ -buttonDelta.width, 0)];
+ [cancelButton_ setFrame:NSOffsetRect([cancelButton_ frame],
+ -buttonDelta.width, 0)];
+ }
+ } else {
+ // To make |cancelButton_| right-aligned in the absence of |okButton_|,
+ // update |cancelButton_|'s rect with that of |okButton_|.
+ [cancelButton_ setFrame:okButtonRect];
sail 2013/02/13 23:56:37 I don't think this will work. For example, if the
Joe Thomas 2013/02/14 02:41:59 Done.
}
buttonDelta = [GTMUILocalizerAndLayoutTweaker sizeToFitView:cancelButton_];
if (buttonDelta.width) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698