summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/geolocation_exceptions_window_controller.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa/geolocation_exceptions_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/geolocation_exceptions_window_controller.mm48
1 files changed, 14 insertions, 34 deletions
diff --git a/chrome/browser/cocoa/geolocation_exceptions_window_controller.mm b/chrome/browser/cocoa/geolocation_exceptions_window_controller.mm
index 7c7bee4..02715bb 100644
--- a/chrome/browser/cocoa/geolocation_exceptions_window_controller.mm
+++ b/chrome/browser/cocoa/geolocation_exceptions_window_controller.mm
@@ -57,11 +57,12 @@ GeolocationExceptionsWindowController* g_exceptionWindow = nil;
@implementation GeolocationExceptionsWindowController
-+ (id)controllerWithSettingsMap:(GeolocationContentSettingsMap*)settingsMap {
++ (id)showWindowWithSettingsMap:(GeolocationContentSettingsMap*)settingsMap {
if (!g_exceptionWindow) {
g_exceptionWindow = [[GeolocationExceptionsWindowController alloc]
initWithSettingsMap:settingsMap];
}
+ [g_exceptionWindow showWindow:nil];
return g_exceptionWindow;
}
@@ -88,22 +89,20 @@ GeolocationExceptionsWindowController* g_exceptionWindow = nil;
DCHECK_EQ(self, [tableView_ dataSource]);
DCHECK_EQ(self, [tableView_ delegate]);
- CGFloat minWidth = [[removeButton_ superview] bounds].size.width +
- [[doneButton_ superview] bounds].size.width;
- [[self window] setMinSize:NSMakeSize(minWidth,
- [[self window] minSize].height)];
+ // Make sure the button fits its label, but keep it the same height as the
+ // other two buttons.
+ [GTMUILocalizerAndLayoutTweaker sizeToFitView:removeAllButton_];
+ NSSize size = [removeAllButton_ frame].size;
+ size.height = NSHeight([removeButton_ frame]);
+ [removeAllButton_ setFrameSize:size];
[self adjustEditingButtons];
-}
-- (void)setMinWidth:(CGFloat)minWidth {
- NSWindow* window = [self window];
- [window setMinSize:NSMakeSize(minWidth, [window minSize].height)];
- if ([window frame].size.width < minWidth) {
- NSRect frame = [window frame];
- frame.size.width = minWidth;
- [window setFrame:frame display:NO];
- }
+ // Give the button bar on the bottom of the window the "iTunes/iChat" look.
+ [[self window] setAutorecalculatesContentBorderThickness:NO
+ forEdge:NSMinYEdge];
+ [[self window] setContentBorderThickness:kButtonBarHeight
+ forEdge:NSMinYEdge];
}
- (void)windowWillClose:(NSNotification*)notification {
@@ -116,7 +115,7 @@ GeolocationExceptionsWindowController* g_exceptionWindow = nil;
// Let esc close the window.
- (void)cancel:(id)sender {
- [self closeSheet:self];
+ [self close];
}
- (void)keyDown:(NSEvent*)event {
@@ -134,25 +133,6 @@ GeolocationExceptionsWindowController* g_exceptionWindow = nil;
[super keyDown:event];
}
-- (void)attachSheetTo:(NSWindow*)window {
- [NSApp beginSheet:[self window]
- modalForWindow:window
- modalDelegate:self
- didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
- contextInfo:nil];
-}
-
-- (void)sheetDidEnd:(NSWindow*)sheet
- returnCode:(NSInteger)returnCode
- contextInfo:(void*)context {
- [sheet close];
- [sheet orderOut:self];
-}
-
-- (IBAction)closeSheet:(id)sender {
- [NSApp endSheet:[self window]];
-}
-
- (IBAction)removeException:(id)sender {
GeolocationContentSettingsTableModel::Rows rows;
[self selectedRows:&rows];