diff options
| author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 08:45:58 +0000 |
|---|---|---|
| committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 08:45:58 +0000 |
| commit | 65ce7b7c05b1ce8bb1ca0c6c460c5a79d726356a (patch) | |
| tree | 0203f2bcc6ec0d20c24437b763f3aad1bf9ea863 /chrome/browser/cocoa/geolocation_exceptions_window_controller.mm | |
| parent | 9435c4c6cd6ef245fd9b5a66dd990400e638ae46 (diff) | |
| download | chromium_src-65ce7b7c05b1ce8bb1ca0c6c460c5a79d726356a.zip chromium_src-65ce7b7c05b1ce8bb1ca0c6c460c5a79d726356a.tar.gz chromium_src-65ce7b7c05b1ce8bb1ca0c6c460c5a79d726356a.tar.bz2 | |
Revert 46049 - [Mac] Make exceptions dialog a sheet.
XIB changes (applying to ContentExceptionsWindow.xib and GeolocationExceptionsWindow.xib):
The window is now drawn in Aqua style, with window margins, Aqua buttons and text labels for them.
At the bottom right of the window there is an additional button for closing the sheet, hooked up to the |doneButton_| outlet in the file's owner and with action |closeSheet:|.
The lefthand side buttons are inside a |GTMWidthBasedTweaker|, as is the done button. The actual tweaking is done by a newly added |GTMUILocalizerAndLayoutTweaker|.
BUG=38021
TEST=Preferences > Under the Hood > Content Settings > Exceptions should be a sheet.
Review URL: http://codereview.chromium.org/1760001
TBR=bauerb@chromium.org
Review URL: http://codereview.chromium.org/1790009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/geolocation_exceptions_window_controller.mm')
| -rw-r--r-- | chrome/browser/cocoa/geolocation_exceptions_window_controller.mm | 48 |
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]; |
