summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/content_settings_dialog_controller.mm
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-03 16:09:15 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-03 16:09:15 +0000
commitec402c3fdadcf3f76cd5d54393050db366a3dfbc (patch)
tree408fb4dde0a6005c9714bba682b41a97437caaf4 /chrome/browser/cocoa/content_settings_dialog_controller.mm
parentb334487af4e2c5b9d27e0807347f7fa94b6d89a5 (diff)
downloadchromium_src-ec402c3fdadcf3f76cd5d54393050db366a3dfbc.zip
chromium_src-ec402c3fdadcf3f76cd5d54393050db366a3dfbc.tar.gz
chromium_src-ec402c3fdadcf3f76cd5d54393050db366a3dfbc.tar.bz2
Reland r46049: [Mac] Make exceptions dialog a sheet.
Now with added unit tests! 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/1817003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/content_settings_dialog_controller.mm')
-rw-r--r--chrome/browser/cocoa/content_settings_dialog_controller.mm16
1 files changed, 13 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/content_settings_dialog_controller.mm b/chrome/browser/cocoa/content_settings_dialog_controller.mm
index 88034ff..fcca282 100644
--- a/chrome/browser/cocoa/content_settings_dialog_controller.mm
+++ b/chrome/browser/cocoa/content_settings_dialog_controller.mm
@@ -135,6 +135,7 @@ class PrefObserverBridge : public NotificationObserver {
[g_instance selectTab:settingsType];
[g_instance showWindow:nil];
+ [g_instance closeExceptionsSheet];
return g_instance;
}
@@ -158,6 +159,13 @@ class PrefObserverBridge : public NotificationObserver {
return self;
}
+- (void)closeExceptionsSheet {
+ NSWindow* attachedSheet = [[self window] attachedSheet];
+ if (attachedSheet) {
+ [NSApp endSheet:attachedSheet];
+ }
+}
+
- (void)awakeFromNib {
DCHECK([self window]);
DCHECK_EQ(self, [[self window] delegate]);
@@ -304,13 +312,15 @@ class PrefObserverBridge : public NotificationObserver {
- (IBAction)showGeolocationExceptions:(id)sender {
GeolocationContentSettingsMap* settingsMap =
profile_->GetGeolocationContentSettingsMap();
- [GeolocationExceptionsWindowController showWindowWithSettingsMap:settingsMap];
+ [[GeolocationExceptionsWindowController controllerWithSettingsMap:settingsMap]
+ attachSheetTo:[self window]];
}
- (void)showExceptionsForType:(ContentSettingsType)settingsType {
HostContentSettingsMap* settingsMap = profile_->GetHostContentSettingsMap();
- [ContentExceptionsWindowController showForType:settingsType
- settingsMap:settingsMap];
+ [[ContentExceptionsWindowController controllerForType:settingsType
+ settingsMap:settingsMap]
+ attachSheetTo:[self window]];
}
- (void)setImagesEnabledIndex:(NSInteger)value {