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

Unified Diff: chrome/browser/ui/cocoa/global_error_bubble_controller.mm

Issue 8447014: Cocoa: Fix clipping issue in search engine protector (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove debug code Created 9 years, 1 month 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/ui/cocoa/global_error_bubble_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/global_error_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm
index 1691e7eaf29eb1acdf1119c0bac348f2a9fcd5e1..ba570d8e20e31b04629d1cedbffde775f131a1d1 100644
--- a/chrome/browser/ui/cocoa/global_error_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/global_error_bubble_controller.mm
@@ -16,6 +16,7 @@
#import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
#import "chrome/browser/ui/global_error.h"
#include "grit/generated_resources.h"
+#import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
@@ -66,13 +67,21 @@ const CGFloat kWrenchBubblePointOffsetY = 6;
else
[cancelButton_ setTitle:SysUTF16ToNSString(cancelLabel)];
- // Adapt window size to bottom buttons. Do this before all other layouting.
+ // First make sure that the window is wide enough to accomidate the buttons.
Robert Sesek 2011/11/04 15:35:27 I think you can do all this within the XIB.
sail 2011/11/04 20:16:59 I couldn't figure out a way to do this from the XI
+ NSRect frame = [[self window] frame];
+ [layoutTweaker_ tweakUI:buttonContainer_];
+ CGFloat delta = NSWidth([buttonContainer_ frame]) - NSWidth(frame);
+ if (delta > 0) {
+ frame.size.width += NSWidth([buttonContainer_ frame]) - NSWidth(frame);
Robert Sesek 2011/11/15 16:01:28 += delta
sail 2011/11/15 19:12:44 Done.
+ [[self window] setFrame:frame display:NO];
+ }
+
+ // Adapt window height to bottom buttons. Do this before all other layouting.
NSArray* views = [NSArray arrayWithObjects:
- title_, message_, [acceptButton_ superview], nil];
+ title_, message_, buttonContainer_, nil];
NSSize ds = NSMakeSize(0, cocoa_l10n_util::VerticallyReflowGroup(views));
ds = [[self bubble] convertSize:ds toView:nil];
- NSRect frame = [[self window] frame];
frame.origin.y -= ds.height;
frame.size.height += ds.height;
[[self window] setFrame:frame display:YES];
« no previous file with comments | « chrome/browser/ui/cocoa/global_error_bubble_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698